[Raw Msg Headers][Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

smtpserver bind() query and logfile problems

I'm using the current CVS version of zmailer.


During startup of the SMTP server it always seems to try and bind to the 
same addresses twice, the 2nd attempt always fails:

00000000000#    000-setting up: bind(s=4, v4, addr='' port=25)
00000000000#    000-setting up: bind(s=6, v4, addr='' port=25)
00000000000#    000-bind(s=6, v4, port=25) failed; errno=Address already 
in use
00000000000#    000-setting up: bind(s=6, v4, addr='' port=465)
00000000000#    000-setting up: bind(s=7, v4, addr='' port=465)
00000000000#    000-bind(s=7, v4, port=465) failed; errno=Address 
already in use
00000000000#    000-started server pid 11196 at Sat, 22 Jan 2005 
16:14:11 +0000

Is this correct ?


I've been hunting a bug that has made all session logging by the smtp 
server stop right after authentication.

The closest I have got is that I use an external program to verify 
authentication credentials (not SASL) with the "PARAM SMTP-auth-pipe" 
option.  There are very few places that explicitly NULL the logfp 
pointer, I think the reaper() code is cause in my case but I have not 
got as far to verify it yet.

Linux STRACE output of the point.  "foobar" is the password sent to the 
pipe.  close(3) is the logfile being closed AARRGGHH!.  Then I get a 
strange open("") for a bogus filename (char *logfile points to environ 
space, its not strdup()ed, also char *pidfile and *cfgfile the their 
lifetimes seem short) maybe it re-opening the log.  The EACCES is 
because the cwd() is /opt/zmailer/smtpserver.conf/ which is owned by a 
user called zmailer, and smtpserver is running as daemon.

write(10, "foobar\n", 7)                = 7
close(10)                               = 0
munmap(0xb7f0b000, 4096)                = 0
wait4(-1, [{WIFEXITED(s) && WEXITSTATUS(s) == 0}], 0, NULL) = 9982
--- SIGCHLD (Child exited) @ 0 (0) ---
rt_sigprocmask(SIG_BLOCK, [CHLD], NULL, 8) = 0
time([1106673578])                      = 1106673578
close(3)                                = 0
munmap(0xb7f5b000, 131072)              = 0
open("in-addr.btopenworld.com AUTH LOGIN", O_WRONLY|O_APPEND|O_CREAT, 0644)
= -1 EACCES (Permission denied)
waitpid(-1, 0xbffe7828, WNOHANG)        = -1 ECHILD (No child processes)
rt_sigaction(SIGCHLD, {0x804e7e4, [], SA_INTERRUPT|SA_NOMASK}, NULL, 8) = 0
rt_sigprocmask(SIG_UNBLOCK, [CHLD], NULL, 8) = 0

v1.182 of smtpserver.c from Jun-2004 adds the code in smtpserver.c:reaper():

+    if (logfp)
+      fclose(logfp);
+    logfp = NULL;

I wouldn't understand why its there but think its the cause.

Darryl L. Miles

To unsubscribe from this list: send the line "unsubscribe zmailer" in
the body of a message to majordomo@nic.funet.fi