diff options
Diffstat (limited to 'qmail-smtpd.c')
| -rw-r--r-- | qmail-smtpd.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/qmail-smtpd.c b/qmail-smtpd.c index c8ee61b..25f821c 100644 --- a/qmail-smtpd.c +++ b/qmail-smtpd.c | |||
| @@ -133,6 +133,7 @@ void err_nogateway() | |||
| 133 | out(" (#5.7.1)\r\n"); | 133 | out(" (#5.7.1)\r\n"); |
| 134 | } | 134 | } |
| 135 | #endif | 135 | #endif |
| 136 | void err_badbounce() { out("550 sorry, bounce messages should have a single envelope recipient (#5.7.1)\r\n"); } | ||
| 136 | void err_unimpl() { out("502 unimplemented (#5.5.1)\r\n"); } | 137 | void err_unimpl() { out("502 unimplemented (#5.5.1)\r\n"); } |
| 137 | void err_syntax() { out("555 syntax error (#5.5.4)\r\n"); } | 138 | void err_syntax() { out("555 syntax error (#5.5.4)\r\n"); } |
| 138 | void err_relay() { out("553 we don't relay (#5.7.1)\r\n"); } | 139 | void err_relay() { out("553 we don't relay (#5.7.1)\r\n"); } |
| @@ -443,6 +444,7 @@ stralloc mailfrom = {0}; | |||
| 443 | stralloc rcptto = {0}; | 444 | stralloc rcptto = {0}; |
| 444 | stralloc fuser = {0}; | 445 | stralloc fuser = {0}; |
| 445 | stralloc mfparms = {0}; | 446 | stralloc mfparms = {0}; |
| 447 | int recipcount; | ||
| 446 | 448 | ||
| 447 | int mailfrom_size(arg) char *arg; | 449 | int mailfrom_size(arg) char *arg; |
| 448 | { | 450 | { |
| @@ -559,6 +561,7 @@ void smtp_mail(arg) char *arg; | |||
| 559 | if (!stralloc_copys(&rcptto,"")) die_nomem(); | 561 | if (!stralloc_copys(&rcptto,"")) die_nomem(); |
| 560 | if (!stralloc_copys(&mailfrom,addr.s)) die_nomem(); | 562 | if (!stralloc_copys(&mailfrom,addr.s)) die_nomem(); |
| 561 | if (!stralloc_0(&mailfrom)) die_nomem(); | 563 | if (!stralloc_0(&mailfrom)) die_nomem(); |
| 564 | recipcount = 0; | ||
| 562 | out("250 ok\r\n"); | 565 | out("250 ok\r\n"); |
| 563 | } | 566 | } |
| 564 | void smtp_rcpt(arg) char *arg; { | 567 | void smtp_rcpt(arg) char *arg; { |
| @@ -610,6 +613,7 @@ void smtp_rcpt(arg) char *arg; { | |||
| 610 | if (!stralloc_cats(&rcptto,"T")) die_nomem(); | 613 | if (!stralloc_cats(&rcptto,"T")) die_nomem(); |
| 611 | if (!stralloc_cats(&rcptto,addr.s)) die_nomem(); | 614 | if (!stralloc_cats(&rcptto,addr.s)) die_nomem(); |
| 612 | if (!stralloc_0(&rcptto)) die_nomem(); | 615 | if (!stralloc_0(&rcptto)) die_nomem(); |
| 616 | recipcount++; | ||
| 613 | out("250 ok\r\n"); | 617 | out("250 ok\r\n"); |
| 614 | } | 618 | } |
| 615 | 619 | ||
| @@ -726,6 +730,7 @@ void smtp_data() { | |||
| 726 | 730 | ||
| 727 | if (!seenmail) { err_wantmail(); return; } | 731 | if (!seenmail) { err_wantmail(); return; } |
| 728 | if (!rcptto.len) { err_wantrcpt(); return; } | 732 | if (!rcptto.len) { err_wantrcpt(); return; } |
| 733 | if (mailfrom.len == 1 && recipcount > 1) { err_badbounce(); return; } | ||
| 729 | if (flagbrt) { err_brt(); return; } | 734 | if (flagbrt) { err_brt(); return; } |
| 730 | seenmail = 0; | 735 | seenmail = 0; |
| 731 | if (databytes) bytestooverflow = databytes + 1; | 736 | if (databytes) bytestooverflow = databytes + 1; |
