--- a/src/master/main.c Sun Sep 13 22:12:35 2009 -0400 +++ a/src/master/main.c Mon Sep 21 18:36:25 2009 +0300 @@ -614,8 +614,6 @@ int main(int argc, char *argv[]) sizeof(ssl_manual_key_password)); } T_END; - open_std_fds(); - /* save TZ environment. AIX depends on it to get the timezone correctly. */ env_tz = getenv("TZ"); @@ -636,6 +634,9 @@ int main(int argc, char *argv[]) mail_process_exec(exec_protocol, exec_args); } + /* closes stdin/stdout, must be after --exec-mail handling */ + open_std_fds(); + /* log all errors to both stderr and log file until we've finished startup. */ set_tee_logfile(settings_root->defaults);