1 Sep 2006 06:21
Re: qmail-dk dropping mail?
Jeff Thompson <lists <at> threeputt.org>
2006-09-01 04:21:32 GMT
2006-09-01 04:21:32 GMT
Russ Nelson wrote:
Russ, thank you for replying... I would agree that would be the proper way to handle a malformed message, however, qmail-dk exiting with a 31 causes the email to not be delivered. I've looked into this and I believe the error occurs here in qmail-dk.c:
if (dksign || dkverify)
for(i=0; i < n; i++) {
if (x[i] == '\n') st = dk_message(dk, "\r\n", 2);
else st = dk_message(dk, x+i, 1);
maybe_die_dk(st);
}
In my case, dk_message is returning DK_STAT_SYNTAX, which is correct due to two "From:" headers being present, however, maybe_die_dk causes qmail-dk to exit with status 31 as shown below:
void maybe_die_dk(e) DK_STAT e; {
switch(e) {
case DK_STAT_BADKEY: _exit(55);
case DK_STAT_CANTVRFY: _exit(74);
case DK_STAT_NORESOURCE: _exit(51);
case DK_STAT_ARGS: _exit(12);
case DK_STAT_SYNTAX: _exit(31);
case DK_STAT_INTERNAL: _exit(81);
}
}
Commenting out the maybe_die_dk(st); call above allows qmail-dk to finish building the message and upon completion, adds the header:
DomainKeys-Status: no signature
Here's the patch that removes the maybe_die_dk call:
--- qmail-dk.c.orig 2006-08-31 23:07:07.000000000 -0500
+++ qmail-dk.c 2006-08-31 23:09:55.000000000 -0500
<at> <at> -229,7 +229,6 <at> <at>
for(i=0; i < n; i++) {
if (x[i] == '\n') st = dk_message(dk, "\r\n", 2);
else st = dk_message(dk, x+i, 1);
- maybe_die_dk(st);
}
if (substdio_put(&ssout,x,n) == -1) die_write();
substdio_SEEK(&ssin,n);
I'm not sure whether a patch like this would be accepted for qmail-dk, but if not, can anyone suggest another method to prevent qmail-dk from exiting before the mail is queued for delivery?
Thanks,
Jeff
Jeff Thompson writes:Although the email message is malformed, should qmail-dk drop a message> that has not been signed or should it allow the message to be queued for > delivery? I would treat syntax errors the same as having no signature. Anybody who wants their email to pass inspection isn't going to send it with a syntax error.
Russ, thank you for replying... I would agree that would be the proper way to handle a malformed message, however, qmail-dk exiting with a 31 causes the email to not be delivered. I've looked into this and I believe the error occurs here in qmail-dk.c:
if (dksign || dkverify)
for(i=0; i < n; i++) {
if (x[i] == '\n') st = dk_message(dk, "\r\n", 2);
else st = dk_message(dk, x+i, 1);
maybe_die_dk(st);
}
In my case, dk_message is returning DK_STAT_SYNTAX, which is correct due to two "From:" headers being present, however, maybe_die_dk causes qmail-dk to exit with status 31 as shown below:
void maybe_die_dk(e) DK_STAT e; {
switch(e) {
case DK_STAT_BADKEY: _exit(55);
case DK_STAT_CANTVRFY: _exit(74);
case DK_STAT_NORESOURCE: _exit(51);
case DK_STAT_ARGS: _exit(12);
case DK_STAT_SYNTAX: _exit(31);
case DK_STAT_INTERNAL: _exit(81);
}
}
Commenting out the maybe_die_dk(st); call above allows qmail-dk to finish building the message and upon completion, adds the header:
DomainKeys-Status: no signature
Here's the patch that removes the maybe_die_dk call:
--- qmail-dk.c.orig 2006-08-31 23:07:07.000000000 -0500
+++ qmail-dk.c 2006-08-31 23:09:55.000000000 -0500
<at> <at> -229,7 +229,6 <at> <at>
for(i=0; i < n; i++) {
if (x[i] == '\n') st = dk_message(dk, "\r\n", 2);
else st = dk_message(dk, x+i, 1);
- maybe_die_dk(st);
}
if (substdio_put(&ssout,x,n) == -1) die_write();
substdio_SEEK(&ssin,n);
I'm not sure whether a patch like this would be accepted for qmail-dk, but if not, can anyone suggest another method to prevent qmail-dk from exiting before the mail is queued for delivery?
Thanks,
Jeff
RSS Feed