On Aug 13, 2008, at 4:42 AM, Heiko Schlichting wrote:

All parts of dovecot except deliver uses the result of hostpid_init() in
src/lib/hostpid.c as a hostname which only asks gethostname().

deliver honours environment variable HOSTNAME in src/deliver/ deliver.c:

   getenv("HOSTNAME");

and uses the hostname of hostpid_init() as a fallback.

Well, this is actually trying to use the hostname setting from dovecot.conf. The settings just happen to get passed in environment.

Wouldn't it be consequent to evaluate the environment variable HOSTNAME in
hostpid_init() with fallback to gethostname() and remove the special
behavior from deliver? The dovecot master process should export $HOSTNAME
to all childs in this case.

Another alternative would be to make the hostname setting global in dovecot.conf and have imap processes use that.

Dovecot uses the hostname as part of Maildir file names and gethostname() is not fully qualified on all operating systems (it is on IRIX but not on Linux). But unqualified hostnames are not unique and it is frequent that
dovecot hosts are named "mail" oder "imap" as hostname. To distinguish
between mail.domain1.com and mail.domain2.net would be easier if dovecot evaluate $HOSTNAME in all case not just deliver as program imap can create
Maildir files as well.

I always thought that hostnames were unique within the installation everywhere even without the domain part, and the domain would just waste disk space in the filenames (and dovecot-uidlist)..

Attachment: PGP.sig
Description: This is a digitally signed message part

Reply via email to