diff options
Diffstat (limited to 'sink.c')
-rw-r--r-- | sink.c | 17 |
1 files changed, 13 insertions, 4 deletions
@@ -245,7 +245,8 @@ static void sanitize(char *s) char *rcpt_address(struct query *ctl, const char *id, int usesmtpname) { - static char addr[HOSTLEN+USERNAMELEN+1]; + static char addr[HOSTLEN+USERNAMELEN+1000]; + if (strchr(id, '@')) { snprintf(addr, sizeof (addr), "%s", id); @@ -844,7 +845,7 @@ static int open_smtp_sink(struct query *ctl, struct msgblk *msg, const char *ap; struct idlist *idp; char options[MSGBUFSIZE]; - char addr[HOSTLEN+USERNAMELEN+1]; + char addr[HOSTLEN+USERNAMELEN+1000]; #ifdef EXPLICIT_BOUNCE_ON_BAD_ADDRESS char **from_responses; #endif /* EXPLICIT_BOUNCE_ON_BAD_ADDRESS */ @@ -1490,8 +1491,16 @@ int close_sink(struct query *ctl, struct msgblk *msg, flag forward) } if (smtp_err != SM_OK) { - responses[errors] = xstrdup(smtp_response); - errors++; + /* + * amavis returns the SMTP code from the recieving + * host after the DATA-DOT. So we need to compare the + * response to the antispam option here instead. + */ + if (handle_smtp_report(ctl, msg) != PS_REFUSED) { + /* Only count an error if the message was not refused */ + responses[errors] = xstrdup(smtp_response); + errors++; + } } } |