diff src/context.cpp @ 266:582cfb9c4031 stable-6-0-33

fix unauthenticated rate limit bug for empty mail from
author Carl Byington <carl@five-ten-sg.com>
date Sat, 21 Jul 2012 13:05:54 -0700
parents e118fd2c6af0
children f941563c2a95
line wrap: on
line diff
--- a/src/context.cpp	Sat Jul 21 12:47:19 2012 -0700
+++ b/src/context.cpp	Sat Jul 21 13:05:54 2012 -0700
@@ -854,10 +854,10 @@
 
 
 bool CONTEXT::is_unauthenticated_limited(const char *user) {
-    if (!user) return false;
     rcpt_rates::iterator i = rcpt_per_hour.find(user);  // look for sender user@email limiting
     if (i != rcpt_per_hour.end()) return true;          // found user@email limiting
     const char *f = strchr(user, '@');
+    if (!f) return false;
     i = rcpt_per_hour.find(f);                  // look for sender @domain limiting
     return (i != rcpt_per_hour.end());          // found @domain limiting
 }