I think you're wrong:
I'm sorry for being dumb. I see the problem now. A stack trace shows the included, possibly useful information.
From the trace, I can pick out that sendmail has forked and exec'd submit. It started up with only fd #0 open, which was attached to a file containing the message that should have been sent.
In the main() function of sendmail.c, the process sets an alarm, and fails somewhere in the code that follows.
It looks like the failure is probably caused by trying to write "root\n" to fd #2, which isn't open. It then tries to write the error message to fd #1, which also isn't open.
... blah blah, more code analysis...
Looks like the function submit_fork closes fd #0 and fd #1 assuming that those are stdin and stdout. In this case, however, fd #1 is pipe0[0], and the new process has just closed both ends of pipe0.
Perhaps the solution would be to reserve fd #1 and fd #2 by opening /dev/null a couple of times before creating the pipes? Not too sure on this one.
[pid 31178] close(0) = 0
[pid 31178] close(1) = 0
[pid 31178] close(2) = 0
...
[pid 31178] open("a00005010daabd", O_RDONLY) = 0
...
[pid 31178] execve("/usr/sbin/sendmail", ["sendmail", "gordon"], [/* 13 vars */]) = 0
...
[pid 31178] pipe([1, 2]) = 0
[pid 31178] pipe([3, 4]) = 0
...
[pid 31178] clone(child_stack=0, flags=CLONE_CHILD_CLEARTID|CLONE_CHILD_SETTID|0x11, <ignored>, <ignored>, 0x4002a2c8) = 31181
[pid 31181] --- SIGSTOP (Stopped (signal)) @ 0 (0) ---
[pid 31181] --- SIGSTOP (Stopped (signal)) @ 0 (0) ---
[pid 31181] close(2 <unfinished ...>
[pid 31181] <... close resumed> ) = 0
[pid 31181] close(3 <unfinished ...>
[pid 31181] <... close resumed> ) = 0
[pid 31181] close(0 <unfinished ...>
[pid 31181] <... close resumed> ) = 0
[pid 31181] close(1 <unfinished ...>
[pid 31181] <... close resumed> ) = 0
[pid 31181] dup(1 <unfinished ...>
[pid 31181] <... dup resumed> ) = -1 EBADF (Bad file descriptor)
[pid 31181] dup(4 <unfinished ...>
[pid 31181] <... dup resumed> ) = 0
[pid 31181] close(1 <unfinished ...>
[pid 31181] <... close resumed> ) = -1 EBADF (Bad file descriptor)
[pid 31181] close(4 <unfinished ...>
[pid 31181] <... close resumed> ) = 0
[pid 31181] chdir("/usr/lib/courier" <unfinished ...>
[pid 31181] <... chdir resumed> ) = 0
[pid 31181] execve("/usr/lib/courier/libexec/courier/submit", ["submit", "local", "dns; localhost (localhost [127.0.0.1])", "uid 0"], [/* 3 vars */] <unfinished ...>
...
[pid 31178] alarm(1800 <unfinished ...>
[pid 31178] <... alarm resumed> ) = 0
[pid 31178] getuid32( <unfinished ...>
[pid 31178] <... getuid32 resumed> ) = 0
[pid 31178] socket(PF_UNIX, SOCK_STREAM, 0 <unfinished ...>
[pid 31178] <... socket resumed> ) = 1
[pid 31178] connect(1, {sa_family=AF_UNIX, path="/var/run/.nscd_socket"}, 110 <unfinished ...>
[pid 31178] <... connect resumed> ) = 0
[pid 31178] writev(1, [{"\2\0\0\0\1\0\0\0\2\0\0\0", 12}, {"0\0", 2}], 2 <unfinished ...>
[pid 31178] <... writev resumed> ) = 14
[pid 31178] read(1, <unfinished ...>
[pid 31178] <... read resumed> "\230$\23B\1\0\0\0\5\0\0\0\2\0\0\0\0\0\0\0\0\0\0\0\5\0\0\0\6\0\0\0\n\0\0\0", 36) = 36
[pid 31178] read(1, <unfinished ...>
[pid 31178] <... read resumed> "root\0x\0root\0/root\0/bin/bash\0", 28) = 28
[pid 31178] close(1 <unfinished ...>
[pid 31178] <... close resumed> ) = 0
[pid 31178] write(2, "root\n", 5 <unfinished ...>
[pid 31178] <... write resumed> ) = -1 EPIPE (Broken pipe)
[pid 31178] --- SIGPIPE (Broken pipe) @ 0 (0) ---
[pid 31178] fstat64(1, <unfinished ...>
[pid 31178] <... fstat64 resumed> 0xbffff900) = -1 EBADF (Bad file descriptor)
[pid 31178] mmap2(NULL, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0 <unfinished ...>
[pid 31178] <... mmap2 resumed> ) = 0x40019000
[pid 31178] write(1, "432 Service temporarily unavailable.\n", 37 <unfinished ...>
[pid 31178] <... write resumed> ) = -1 EBADF (Bad file descriptor)
[pid 31178] munmap(0x40017000, 4096 <unfinished ...>
[pid 31178] <... munmap resumed> ) = 0
[pid 31178] munmap(0x40019000, 8192 <unfinished ...>
[pid 31178] <... munmap resumed> ) = 0
[pid 31178] exit_group(75) = ?
------------------------------------------------------- This SF.Net email sponsored by: Free pre-built ASP.NET sites including Data Reports, E-commerce, Portals, and Forums are available now. Download today and enter to win an XBOX or Visual Studio .NET. http://aspnet.click-url.com/go/psa00100003ave/direct;at.aspnet_072303_01/01 _______________________________________________ courier-users mailing list [EMAIL PROTECTED] Unsubscribe: https://lists.sourceforge.net/lists/listinfo/courier-users
