diff options
author | gshapiro <gshapiro@FreeBSD.org> | 2004-02-14 21:53:31 +0000 |
---|---|---|
committer | gshapiro <gshapiro@FreeBSD.org> | 2004-02-14 21:53:31 +0000 |
commit | 238623a0204c90e8d61dbde7b3b499a5036f2e5d (patch) | |
tree | 136f3e97b372409d2104603a771ff37e36631243 /contrib/sendmail/src/srvrsmtp.c | |
parent | 96b960fca637a0765d566591885b7d42576e723f (diff) | |
download | FreeBSD-src-238623a0204c90e8d61dbde7b3b499a5036f2e5d.zip FreeBSD-src-238623a0204c90e8d61dbde7b3b499a5036f2e5d.tar.gz |
Import sendmail 8.12.11
Diffstat (limited to 'contrib/sendmail/src/srvrsmtp.c')
-rw-r--r-- | contrib/sendmail/src/srvrsmtp.c | 51 |
1 files changed, 26 insertions, 25 deletions
diff --git a/contrib/sendmail/src/srvrsmtp.c b/contrib/sendmail/src/srvrsmtp.c index 52d47a1..e752aa0 100644 --- a/contrib/sendmail/src/srvrsmtp.c +++ b/contrib/sendmail/src/srvrsmtp.c @@ -16,7 +16,7 @@ # include <libmilter/mfdef.h> #endif /* MILTER */ -SM_RCSID("@(#)$Id: srvrsmtp.c,v 8.829.2.31 2003/07/01 17:30:01 ca Exp $") +SM_RCSID("@(#)$Id: srvrsmtp.c,v 8.829.2.34 2004/01/14 19:13:46 ca Exp $") #if SASL || STARTTLS # include <sys/time.h> @@ -1288,6 +1288,7 @@ smtp(nullserver, d_flags, e) case CMDEHLO: case CMDNOOP: case CMDRSET: + case CMDERROR: /* process normally */ break; @@ -2338,6 +2339,29 @@ tlsfail: case CMDRCPT: /* rcpt -- designate recipient */ DELAY_CONN("RCPT"); + if (BadRcptThrottle > 0 && + n_badrcpts >= BadRcptThrottle) + { + if (LogLevel > 5 && + n_badrcpts == BadRcptThrottle) + { + sm_syslog(LOG_INFO, e->e_id, + "%s: Possible SMTP RCPT flood, throttling.", + CurSmtpClient); + + /* To avoid duplicated message */ + n_badrcpts++; + } + + /* + ** Don't use exponential backoff for now. + ** Some servers will open more connections + ** and actually overload the receiver even + ** more. + */ + + (void) sleep(1); + } if (!smtp.sm_gotmail) { usrerr("503 5.0.0 Need MAIL before RCPT"); @@ -2384,29 +2408,6 @@ tlsfail: e, true); macdefine(&e->e_macro, A_PERM, macid("{addr_type}"), NULL); - if (BadRcptThrottle > 0 && - n_badrcpts >= BadRcptThrottle) - { - if (LogLevel > 5 && - n_badrcpts == BadRcptThrottle) - { - sm_syslog(LOG_INFO, e->e_id, - "%s: Possible SMTP RCPT flood, throttling.", - CurSmtpClient); - - /* To avoid duplicated message */ - n_badrcpts++; - } - - /* - ** Don't use exponential backoff for now. - ** Some servers will open more connections - ** and actually overload the receiver even - ** more. - */ - - (void) sleep(1); - } if (Errors > 0) goto rcpt_done; if (a == NULL) @@ -3146,7 +3147,7 @@ smtp_data(smtp, e) doublequeue = false; aborting = Errors > 0; - if (!aborting && + if (!(aborting || bitset(EF_DISCARD, e->e_flags)) && #if _FFR_QUARANTINE (QueueMode == QM_QUARANTINE || e->e_quarmsg == NULL) && #endif /* _FFR_QUARANTINE */ |