aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEric S. Raymond <esr@thyrsus.com>1999-05-03 03:36:39 +0000
committerEric S. Raymond <esr@thyrsus.com>1999-05-03 03:36:39 +0000
commit2fa3184aaaa257a1eb54347e1d14b7df084e4d97 (patch)
treed22569d331af18b04416ac55659800441b10af00
parent6efc562bccfcf4484e8c18ee98296e0c1fb60eac (diff)
downloadfetchmail-2fa3184aaaa257a1eb54347e1d14b7df084e4d97.tar.gz
fetchmail-2fa3184aaaa257a1eb54347e1d14b7df084e4d97.tar.bz2
fetchmail-2fa3184aaaa257a1eb54347e1d14b7df084e4d97.zip
Correct an embarassing buffer smash.
svn path=/trunk/; revision=2463
-rw-r--r--sink.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/sink.c b/sink.c
index d854ba20..49d4a6aa 100644
--- a/sink.c
+++ b/sink.c
@@ -378,9 +378,6 @@ static int handle_smtp_report(struct query *ctl, struct msgblk *msg)
xalloca(responses[0], char *, strlen(smtp_response)+1);
strcpy(responses[0], smtp_response);
- /* required by RFC1870; sets us up to be able to send bouncemail */
- SMTP_rset(ctl->smtp_socket);
-
/*
* Note: send_bouncemail message strings are not made subject
* to gettext translation because (a) they're going to be
@@ -404,6 +401,7 @@ static int handle_smtp_report(struct query *ctl, struct msgblk *msg)
* 571 = sendmail's "unsolicited email refused"
*
*/
+ SMTP_rset(ctl->smtp_socket); /* stay on the safe site */
send_bouncemail(ctl, msg, XMIT_ACCEPT,
"Our spam filter rejected this transaction.\r\n",
1, responses);
@@ -436,6 +434,7 @@ static int handle_smtp_report(struct query *ctl, struct msgblk *msg)
* this is not an actual failure, we're very likely to be
* able to recover on the next cycle.
*/
+ SMTP_rset(ctl->smtp_socket); /* required by RFC1870 */
return(PS_TRANSIENT);
case 552: /* message exceeds fixed maximum message size */
@@ -444,6 +443,7 @@ static int handle_smtp_report(struct query *ctl, struct msgblk *msg)
* ESMTP server. Don't try to ship the message,
* and allow it to be deleted.
*/
+ SMTP_rset(ctl->smtp_socket); /* required by RFC1870 */
send_bouncemail(ctl, msg, XMIT_ACCEPT,
"This message was too large.\r\n",
1, responses);
@@ -454,12 +454,14 @@ static int handle_smtp_report(struct query *ctl, struct msgblk *msg)
* These latter days 553 usually means a spammer is trying to
* cover his tracks.
*/
+ SMTP_rset(ctl->smtp_socket); /* stay on the safe side */
send_bouncemail(ctl, msg, XMIT_ACCEPT,
"Invalid address.\r\n",
1, responses);
return(PS_REFUSED);
default: /* bounce the error back to the sender */
+ SMTP_rset(ctl->smtp_socket); /* stay on the safe side */
if (send_bouncemail(ctl, msg, XMIT_ACCEPT,
"General SMTP/ESMTP error.\r\n",
1, responses))