
robert.sander at epigenomics
Nov 16, 2009, 5:55 AM
Post #1 of 1
(850 views)
Permalink
|
|
check for empty recipient address
|
|
Hi, we have some issues with Thunderbird not recognises multiple recipients in a mailto:-URL separated by semikolon (which violates RFC2368, but some people are used to semikolons...). mailto:a [at] example;b [at] example generates and empty recipient address at the SMTP level when sending the email, mailto:a [at] example,b [at] example works as expected. I know that this is not qmail's fault, maybe not even Thunderbird's, but human errors exist. I have made a simple patch to qmail-smtpd (and ofmipd) to check for an empty recipient address. After reading through RFC2821 it seems to me that an empty recipient is not allowed at all. When receiving an email with such an empty recipient address plain qmail delivers to the empty local address, making it impossible to bounce the email (.qmail-default does not catch it). If there is a better solution to this problem please let me know. --- qmail-1.03/qmail-smtpd.c 1998-06-15 12:53:16.000000000 +0200 +++ qmail-1.03-checknullrcpt/qmail-smtpd.c 2009-11-16 14:32:34.714161529 +0100 @@ -58,6 +58,7 @@ void err_noop() { out("250 ok\r\n"); } void err_vrfy() { out("252 send some mail, i'll try my best\r\n"); } void err_qqt() { out("451 qqt failure (#4.3.0)\r\n"); } +void err_nullrcpt() { out("553 unable to accept empty recipient address\r\n"); } stralloc greeting = {0}; @@ -250,6 +251,7 @@ void smtp_rcpt(arg) char *arg; { if (!seenmail) { err_wantmail(); return; } if (!addrparse(arg)) { err_syntax(); return; } + if (addr.len == 1) { err_nullrcpt(); return; } if (flagbarf) { err_bmf(); return; } if (relayclient) { --addr.len; --- mess822-0.58/ofmipd.c 1998-09-05 04:33:37.000000000 +0200 +++ mess822-0.58-checknullrcpt/ofmipd.c 2009-11-16 14:23:36.483561234 +0100 @@ -46,6 +46,7 @@ void err_wantrcpt() { out("503 RCPT first (#5.5.1)\r\n"); } void err_qqt() { out("451 qqt failure (#4.3.0)\r\n"); } void err_cdb() { out("451 unable to read cdb (#4.3.0)\r\n"); } +void err_nullrcpt() { out("553 unable to accept null recipient\r\n"); } config_str rewrite = CONFIG_STR; stralloc idappend = {0}; @@ -154,6 +155,7 @@ void smtp_rcpt(arg) char *arg; { if (!seenmail) { err_wantmail(); return; } if (!addrparse(arg)) { err_syntax(); return; } + if (!rwaddr.len) { err_nullrcpt(); return; } if (!stralloc_0(&rwaddr)) nomem(); if (!stralloc_cats(&rcptto,"T")) nomem(); if (!stralloc_cats(&rcptto,rwaddr.s)) nomem(); Regards -- Robert Sander Senior Manager Information Systems Epigenomics AG Kleine Praesidentenstr. 1 10178 Berlin, Germany phone:+49-30-24345-0 fax:+49-30-24345-555 http://www.epigenomics.com robert.sander [at] epigenomics
|