comparison 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
comparison
equal deleted inserted replaced
265:89578e4f9c87 266:582cfb9c4031
852 return default_rcpt_rate; 852 return default_rcpt_rate;
853 } 853 }
854 854
855 855
856 bool CONTEXT::is_unauthenticated_limited(const char *user) { 856 bool CONTEXT::is_unauthenticated_limited(const char *user) {
857 if (!user) return false;
858 rcpt_rates::iterator i = rcpt_per_hour.find(user); // look for sender user@email limiting 857 rcpt_rates::iterator i = rcpt_per_hour.find(user); // look for sender user@email limiting
859 if (i != rcpt_per_hour.end()) return true; // found user@email limiting 858 if (i != rcpt_per_hour.end()) return true; // found user@email limiting
860 const char *f = strchr(user, '@'); 859 const char *f = strchr(user, '@');
860 if (!f) return false;
861 i = rcpt_per_hour.find(f); // look for sender @domain limiting 861 i = rcpt_per_hour.find(f); // look for sender @domain limiting
862 return (i != rcpt_per_hour.end()); // found @domain limiting 862 return (i != rcpt_per_hour.end()); // found @domain limiting
863 } 863 }
864 864
865 865