[Dovecot] Home directories
I've noticed that a lot of people are using e.g.:
mail_location = maildir:/var/vmail/%d/%n
Then either they don't have home directory set, or their home directory is the same as the maildir. http://wiki.dovecot.org/VirtualUsers/Home explains all the problems of not separate home and mail directories.
Also whenever I try to suggest using a separate home and mail directory, the answer is way too often: "But I'm using virtual users. (They don't have home directories.)"
So I started wondering. Maybe simply renaming the "home" to something else would help here at least some. Make all of the documentation use only the new word, and add alias for userdb so that the new name and the "home" both work (I guess docs would need to keep using the "home" as field name for some more years).
So far I've only come up with "vhome" as the replacement name. Other ideas?
On Tue, Aug 24, 2010 at 7:57 AM, Timo Sirainen tss@iki.fi wrote:
I've noticed that a lot of people are using e.g.:
mail_location = maildir:/var/vmail/%d/%n
Then either they don't have home directory set, or their home directory is the same as the maildir. http://wiki.dovecot.org/VirtualUsers/Home explains all the problems of not separate home and mail directories.
Also whenever I try to suggest using a separate home and mail directory, the answer is way too often: "But I'm using virtual users. (They don't have home directories.)"
So I started wondering. Maybe simply renaming the "home" to something else would help here at least some. Make all of the documentation use only the new word, and add alias for userdb so that the new name and the "home" both work (I guess docs would need to keep using the "home" as field name for some more years).
So far I've only come up with "vhome" as the replacement name. Other ideas?
Id like to share my experience that I just went through Sunday.
Four years ago I took over as sysadmin, and one of the things I did was clean up our mail system. One of the decisions I made was to get rid of what at the time seemed like an unnecessary extra folder called ".maildir" in every user's directory, which was only mail. So I moved all data to just /mail/domain/initial/username and that seemed to be great.
Now however, I am wishing I never did that. I seem to be having issues giving /mail/domain/initial/username as the home and maildir:~/ as the maildir (per user userdb mysql etc).
So I started a new quick project to move back to having a maildir folder in the user directory, also so I could then migrate to mdbox by having an mdbox folder there. Well on Sunday I had a mixup and i set all my user's home's to maildir:~/ which had a side effect of *moving* my entire domain folder to a different location, all 468 gigs of it and I thought it had all been deleted, total panic attack and a good two hours of going WTF and wanting to cry since my backup had also started running at the same time so I was missing all kinds of stuff on my live backup server, and to top it off, my third incremental backup server had a bad drive so that was totally flaky.
Anyway, I learned two lessons here. 1) Dont procrastinate fixing your backup server even if you have a third and think its not a big deal at the time and 2) I wish I would have kept the "maildir" folder in the user's "home" directory, even if they are virtual users.
On a side note, I happened to find my domain's mail directory and successfully merged it back with only minor noise from customers noticing. Good thing it was a sunday and the fair was in town.
/rookiemove FTL
I use: mail_location: maildir:/srv/mail/vmail/%Ud/%Ln/Maildir
No problems at all. I went this way because i use templates to deploy
new VMs, once running i only have to change the network config on the
new VM and add a new virtual disk to it. The disk size depends on the
service and data needs. I guess i could have mounted the vdisk into /
home/vmail instead of the directory above.
Thanks
Romer Ventura
On Aug 24, 2010, at 10:46 AM, Brandon Lamb wrote:
On Tue, Aug 24, 2010 at 7:57 AM, Timo Sirainen tss@iki.fi wrote:
I've noticed that a lot of people are using e.g.:
mail_location = maildir:/var/vmail/%d/%n
Then either they don't have home directory set, or their home
directory is the same as the maildir. http://wiki.dovecot.org/VirtualUsers/Home explains all the problems of not separate home and mail directories.Also whenever I try to suggest using a separate home and mail
directory, the answer is way too often: "But I'm using virtual users. (They
don't have home directories.)"So I started wondering. Maybe simply renaming the "home" to something else would help here at least some. Make all of the documentation use only the new word, and add alias for userdb so that the new name
and the "home" both work (I guess docs would need to keep using the "home" as field name for some more years).So far I've only come up with "vhome" as the replacement name. Other ideas?
Id like to share my experience that I just went through Sunday.
Four years ago I took over as sysadmin, and one of the things I did was clean up our mail system. One of the decisions I made was to get rid of what at the time seemed like an unnecessary extra folder called ".maildir" in every user's directory, which was only mail. So I moved all data to just /mail/domain/initial/username and that seemed to be great.
Now however, I am wishing I never did that. I seem to be having issues giving /mail/domain/initial/username as the home and maildir:~/ as the maildir (per user userdb mysql etc).
So I started a new quick project to move back to having a maildir folder in the user directory, also so I could then migrate to mdbox by having an mdbox folder there. Well on Sunday I had a mixup and i set all my user's home's to maildir:~/ which had a side effect of *moving* my entire domain folder to a different location, all 468 gigs of it and I thought it had all been deleted, total panic attack and a good two hours of going WTF and wanting to cry since my backup had also started running at the same time so I was missing all kinds of stuff on my live backup server, and to top it off, my third incremental backup server had a bad drive so that was totally flaky.
Anyway, I learned two lessons here. 1) Dont procrastinate fixing your backup server even if you have a third and think its not a big deal at the time and 2) I wish I would have kept the "maildir" folder in the user's "home" directory, even if they are virtual users.
On a side note, I happened to find my domain's mail directory and successfully merged it back with only minor noise from customers noticing. Good thing it was a sunday and the fair was in town.
/rookiemove FTL
On Tue, Aug 24, 2010 at 7:57 AM, Timo Sirainen tss@iki.fi wrote:
I've noticed that a lot of people are using e.g.:
mail_location = maildir:/var/vmail/%d/%n
Then either they don't have home directory set, or their home directory is the same as the maildir. http://wiki.dovecot.org/VirtualUsers/Home explains all the problems of not separate home and mail directories.
Also whenever I try to suggest using a separate home and mail directory, the answer is way too often: "But I'm using virtual users. (They don't have home directories.)"
So I started wondering. Maybe simply renaming the "home" to something else would help here at least some. Make all of the documentation use only the new word, and add alias for userdb so that the new name and the "home" both work (I guess docs would need to keep using the "home" as field name for some more years).
So far I've only come up with "vhome" as the replacement name. Other ideas?
My $0.02 is userdir over the others, but at the same time home and maildir made sense to me as it is.
userdir / user_dir userpath / user_path userlocation / user_location userroot / user_root userbase / user_base
On Tue, 24 Aug 2010 08:53:31 -0700, Brandon Lamb brandonlamb@gmail.com wrote:
On Tue, Aug 24, 2010 at 7:57 AM, Timo Sirainen tss@iki.fi wrote:
I've noticed that a lot of people are using e.g.:
mail_location = maildir:/var/vmail/%d/%n
Then either
My $0.02 is userdir over the others, but at the same time home and maildir made sense to me as it is.
userdir / user_dir userpath / user_path userlocation / user_location userroot / user_root userbase / user_base
thanks timo "Sometimes you invent something and you are not happy with how it is used" author unknow
Op 24-8-2010 17:53, Brandon Lamb schreef:
On Tue, Aug 24, 2010 at 7:57 AM, Timo Sirainentss@iki.fi wrote: My $0.02 is userdir over the others, but at the same time home and maildir made sense to me as it is.
userdir / user_dir userpath / user_path userlocation / user_location userroot / user_root userbase / user_base Good suggestions. Maybe s/user/account/ is also an option.
Regards,
Stephan.
Am 24.08.2010 um 16:57 schrieb Timo Sirainen:
So far I've only come up with "vhome" as the replacement name. Other ideas?
This is pretty hard to eliminate IMHO also taking into account Brandon's recap. There is pros and cons for all kinds of inflexible naming schemes like:
- basedir
- mailroot
- virtual
In the end it is probably better to improve the documentation than introducing self-explantory aliases. In the end both will only target a limited number of people/cases, still leaving room for interpretation.
Regards Thomas
On Tue, 2010-08-24 at 19:37 +0200, Thomas Leuxner wrote:
- basedir
Dovecot already has a base_dir setting, typically /var/run/dovecot
- mailroot
"Mail root dir" is the ~/Maildir/ or ~/mail/ or ~/dbox/ directory.
- virtual
Well, "virtual" alone is used for tons of stuff :) "Virtual home" is what I'm thinking now..
In the end it is probably better to improve the documentation than introducing self-explantory aliases. In the end both will only target a limited number of people/cases, still leaving room for interpretation.
Even if only documentation is changed, it still needs a name. I can't talk about "home directories", because people see only "home" and immediately decide "this doesn't concern me, I don't have home directories" and ignore whatever else comes after it. But if the documentation talked about "virtual home directories", maybe they wouldn't ignore it so easily.
Am 24.08.2010 um 20:01 schrieb Timo Sirainen:
On Tue, 2010-08-24 at 19:37 +0200, Thomas Leuxner wrote:
- basedir
Dovecot already has a base_dir setting, typically /var/run/dovecot
- mailroot
"Mail root dir" is the ~/Maildir/ or ~/mail/ or ~/dbox/ directory.
- virtual
Well I didn't want to promote/favour any of them. Just point out the dilemma around them...
On 24/08/2010 15:57, Timo Sirainen wrote:
I've noticed that a lot of people are using e.g.:
mail_location = maildir:/var/vmail/%d/%n
Then either they don't have home directory set, or their home directory is the same as the maildir. http://wiki.dovecot.org/VirtualUsers/Home explains all the problems of not separate home and mail directories.
Also whenever I try to suggest using a separate home and mail directory, the answer is way too often: "But I'm using virtual users. (They don't have home directories.)"
So I started wondering. Maybe simply renaming the "home" to something else would help here at least some. Make all of the documentation use only the new word, and add alias for userdb so that the new name and the "home" both work (I guess docs would need to keep using the "home" as field name for some more years).
So far I've only come up with "vhome" as the replacement name. Other ideas?
Note what follows is more a collection of ideas which jumps around a bit rather than a cogent coherent logical sequence.
Is there a potential problem with the term "virtual home" in as much as for system users it is not virtual but the user's (actual) home directory?
That being the case I'd avoid the word "virtual". It seems we also want to avoid the word "home".
So I see logic in calling it the "user state directory" which could be "userdir" for short.
-=-
Is there a global configuration directive like "mail_location" wherein the two directives could be placed adjacently?
# Note: Fictional example. Does not work. mail_location = maildir:/var/vmail/%d/%n/mail user_state_directory = /var/vmail/%d/%n
-=-
Could the documentation be re-structured to encourage the configuration of the two parts of the storage
- Mail directory
- User state directory
?
Then to say words to the effect of:
"For virtual user environments, you need to set both of these aspects up. You may want to set up mail as a subdirectory off the user state directory. Alternatively you can put them in separate locations."
"For system user environments, you may want to have the user state directory go directly on to the user's home directory / a subdirectory of the user's home directory."
-=-
Another idea would be to say that, perhaps for Dovecot 2.1 (i.e. a suitably large version bump), that having a configuration which Dovecot could divine leaves things open to filesystem name clashes between the user state directory and the mail directory (or whatever is considered to be a bad outcome of not properly configuring the user state directory) would create a fatal error at daemon start time. Perhaps there could be a configuration directive to override this check, wrapped in suitably comprehensive documentation which means that people who absolutely insist can ice skate uphill, but the path of least resistance would be to configure Dovecot properly.
Bill
Typically when using virtual users all you do is store their emails.
Why not introduce "stores"; Something like virtual_store or vstore
might work nicely.
Thanks
Romer Ventura
On Aug 24, 2010, at 1:43 PM, William Blunn wrote:
On 24/08/2010 15:57, Timo Sirainen wrote:
I've noticed that a lot of people are using e.g.:
mail_location = maildir:/var/vmail/%d/%n
Then either they don't have home directory set, or their home
directory is the same as the maildir. http://wiki.dovecot.org/ VirtualUsers/Home explains all the problems of not separate home
and mail directories.Also whenever I try to suggest using a separate home and mail
directory, the answer is way too often: "But I'm using virtual
users. (They don't have home directories.)"So I started wondering. Maybe simply renaming the "home" to
something else would help here at least some. Make all of the
documentation use only the new word, and add alias for userdb so
that the new name and the "home" both work (I guess docs would
need to keep using the "home" as field name for some more years).So far I've only come up with "vhome" as the replacement name.
Other ideas?Note what follows is more a collection of ideas which jumps around
a bit rather than a cogent coherent logical sequence.Is there a potential problem with the term "virtual home" in as
much as for system users it is not virtual but the user's (actual)
home directory?That being the case I'd avoid the word "virtual". It seems we also
want to avoid the word "home".So I see logic in calling it the "user state directory" which could
be "userdir" for short.-=-
Is there a global configuration directive like "mail_location"
wherein the two directives could be placed adjacently?# Note: Fictional example. Does not work. mail_location = maildir:/var/vmail/%d/%n/mail user_state_directory = /var/vmail/%d/%n
-=-
Could the documentation be re-structured to encourage the
configuration of the two parts of the storage
- Mail directory
- User state directory
?
Then to say words to the effect of:
"For virtual user environments, you need to set both of these
aspects up. You may want to set up mail as a subdirectory off the
user state directory. Alternatively you can put them in separate
locations.""For system user environments, you may want to have the user state
directory go directly on to the user's home directory / a
subdirectory of the user's home directory."-=-
Another idea would be to say that, perhaps for Dovecot 2.1 (i.e. a
suitably large version bump), that having a configuration which
Dovecot could divine leaves things open to filesystem name clashes
between the user state directory and the mail directory (or
whatever is considered to be a bad outcome of not properly
configuring the user state directory) would create a fatal error at
daemon start time. Perhaps there could be a configuration directive
to override this check, wrapped in suitably comprehensive
documentation which means that people who absolutely insist can ice
skate uphill, but the path of least resistance would be to
configure Dovecot properly.Bill
That being the case I'd avoid the word "virtual". It seems we also want to avoid the word "home".
+1. "Virtual" implies it's only for virtual users. "Home" means $HOME.
So I see logic in calling it the "user state directory" which could be "userdir" for short.
"Userdir" may still imply, to some people, $HOME.
I suggest something less overloaded, such as nook, cubby, or stash.
On Tue, 24 Aug 2010 16:45:10 -0500 Mike Abbott michael.abbott@apple.com articulated:
That being the case I'd avoid the word "virtual". It seems we also want to avoid the word "home".
+1. "Virtual" implies it's only for virtual users. "Home" means $HOME.
So I see logic in calling it the "user state directory" which could be "userdir" for short.
"Userdir" may still imply, to some people, $HOME.
I suggest something less overloaded, such as nook, cubby, or stash.
Whats wrong with: stomping_ground, neck_of_the_woods and whatchamacallit.
-- Jerry ✌ Dovecot.user@seibercom.net
Disclaimer: off-list followups get on-list replies or get ignored. Please do not ignore the Reply-To header.
Haste makes waste.
John Heywood
hi,
Am Dienstag, den 24.08.2010, 16:45 -0500 schrieb Mike Abbott:
That being the case I'd avoid the word "virtual". It seems we also want to avoid the word "home".
+1. "Virtual" implies it's only for virtual users. "Home" means $HOME.
that is, what I think too. I also ignored "home" cause, we _have_ $HOME, but in case, it doesn't exist ... so $vhome maybe a good solution.
cu denny
On Tuesday 24 August 2010 16:57:23 Timo Sirainen wrote:
I've noticed that a lot of people are using e.g.:
mail_location = maildir:/var/vmail/%d/%n
Then either they don't have home directory set, or their home directory is the same as the maildir. http://wiki.dovecot.org/VirtualUsers/Home explains all the problems of not separate home and mail directories.
So all it takes is reading and understanding this short piece of text. Should be manageable by someone who attempts to operate a mail server.
Also whenever I try to suggest using a separate home and mail directory, the answer is way too often: "But I'm using virtual users. (They don't have home directories.)"
So I started wondering. Maybe simply renaming the "home" to something else would help here at least some.
OTOH you'd need to make distinction between system and virtual users in docs everywhere home is used, like: "mail_location: relative paths are based on $home for system users, and on $vhome for virtual users."
IMHO a home dir is a valid and understandable concept for virtual users, and I see more disadvantages than advantages if you change the name.
Rainer
On Wed, 2010-08-25 at 09:36 +0200, Rainer Frey wrote:
Also whenever I try to suggest using a separate home and mail directory, the answer is way too often: "But I'm using virtual users. (They don't have home directories.)"
So I started wondering. Maybe simply renaming the "home" to something else would help here at least some.
OTOH you'd need to make distinction between system and virtual users in docs everywhere home is used, like: "mail_location: relative paths are based on $home for system users, and on $vhome for virtual users."
That text is wrong though. Relative paths are strongly discouraged. They probably are based on home, but that's only by chance and may not work in all situations..
On Wed, Aug 25, 2010 at 10:46 AM, Timo Sirainen tss@iki.fi wrote:
On Wed, 2010-08-25 at 09:36 +0200, Rainer Frey wrote:
Also whenever I try to suggest using a separate home and mail directory, the answer is way too often: "But I'm using virtual users. (They don't have home directories.)"
So I started wondering. Maybe simply renaming the "home" to something else would help here at least some.
OTOH you'd need to make distinction between system and virtual users in docs everywhere home is used, like: "mail_location: relative paths are based on $home for system users, and on $vhome for virtual users."
That text is wrong though. Relative paths are strongly discouraged. They probably are based on home, but that's only by chance and may not work in all situations..
Does that mean you do NOT recommend using maildir:~/ as a mail_location in preference of maildir:/full/path/to/maildir ?
On 25.8.2010, at 21.10, Brandon Lamb wrote:
OTOH you'd need to make distinction between system and virtual users in docs everywhere home is used, like: "mail_location: relative paths are based on $home for system users, and on $vhome for virtual users."
That text is wrong though. Relative paths are strongly discouraged. They probably are based on home, but that's only by chance and may not work in all situations..
Does that mean you do NOT recommend using maildir:~/ as a mail_location in preference of maildir:/full/path/to/maildir ?
No, maildir:~/ isn't relative path, since ~/ is expanded to absolute home path. maildir:Maildir is a relative path.
participants (12)
-
Brandon Lamb
-
Charles Marcus
-
Denny Schierz
-
fakessh
-
Jerry
-
Mike Abbott
-
Rainer Frey
-
Romer Ventura
-
Stephan Bosch
-
Thomas Leuxner
-
Timo Sirainen
-
William Blunn