On Sat, Dec 26, 2009 at 02:59:14AM +0200, Dmitry Katsubo wrote: > I have found that in some rare cases spamd does not send the checked > mail back through sendmail. If is removed from postfix queue and never > sent.
It seems, for some reason, that spamc is ignoring or otherwise unable to
process the -e command line argument. In the strace output you sent,
spamc is pid 9711:
[pid 9710] clone(Process 9711 attached child_stack=0,
flags=CLONE_CHILD_CLEARTID|CLONE_CHILD_SETTID|SIGCHLD, child_tidptr=0xb730d938)
= 9711
...
[pid 9711] execve("/usr/bin/spamc", ["/usr/bin/spamc", "-u",
"H.W.P.vandenToorn", "b.vanbreukelen", "-e", "/usr/sbin/sendmail", "-oi", "-f",
"[email protected]", "[email protected]", "[email protected]"],
[/* 3 vars */]) = 0
You can see where spamc connects to spamd and passes it the message:
[pid 9711] socket(PF_INET, SOCK_STREAM, IPPROTO_TCP) = 3
[pid 9711] rt_sigaction(SIGALRM, {0x804e140, [], 0}, {SIG_DFL, [], 0}, 8) = 0
[pid 9711] alarm(600) = 0
[pid 9711] connect(3, {sa_family=AF_INET, sin_port=htons(783),
sin_addr=inet_addr("127.0.0.1")}, 16) = 0
[pid 9711] alarm(0) = 600
[pid 9711] rt_sigaction(SIGALRM, {SIG_DFL, [], 0}, {0x804e140, [], 0}, 8) = 0
[pid 9711] send(3, "PROCESS SPAMC/1.4\r\nUser:
H.W.P.vandenToorn\r\nContent-length: 1961\r\n\r\n", 68, 0) = 68
[pid 9711] send(3, "Return-Path: <[email protected]>\nReceived: from
[127.0.0.1] (localhost [127.0.0.1])\n\t(using TLSv1 with cipher
DHE-RSA-AES25"..., 1961, 0) = 1961
Then later where it reads the processed message back from spamd with a
long repeating sequence of:
[pid 9711] rt_sigaction(SIGALRM, {SIG_DFL, [], 0}, {0x804e140, [], 0}, 8) = 0
[pid 9711] rt_sigaction(SIGALRM, {0x804e140, [], 0}, {SIG_DFL, [], 0}, 8) = 0
[pid 9711] alarm(600) = 0
[pid 9711] recv(3, "P", 1, 0) = 1
It then writes the processed message back out file descriptor 1, which
is the pipe it has set up with pid 9710 (pipe(8)). This is how it would
normally operate, if -e wasn't given.
Does spamc not log anything? If you add the '-l' flag, which tells it
to log to stderr, does postfix do anything useful with those logs?
Also, I wonder if passing spamc the '-x' flag would be useful here.
Normally, if spamc encounters an error, it just returns the unaltered
message. However, the docs aren't clear about how this interacts with
'-e'. Maybe having spamc exit with a meaningful error code would be
useful, or at least helpful for our debugging, in this case.
noah
signature.asc
Description: Digital signature

