[Dovecot] RfE: use HOSTNAME environment variable in hostpid_init()
Heiko Schlichting
dovecot-l at fu-berlin.de
Wed Aug 13 11:42:39 EEST 2008
Hi,
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.
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.
Motivation:
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.
Heiko
Heiko Schlichting Freie Universität Berlin
heiko at FU-Berlin.DE Zentraleinrichtung für Datenverarbeitung (ZEDAT)
Telefon +49 30 838-54327 Fabeckstraße 32
Telefax +49 30 838454327 14195 Berlin
More information about the dovecot
mailing list