David,

Niblett, David A wrote:
> Good catch, I didn't think about mysql.  The problem is that
> if my SPAM box is SPAM, but something is sent to it as
> [EMAIL PROTECTED] since the case doesn't match a new box
> may be created (provided it's in the allowed create list) or
> the email will be rejected.

Ok. I think I follow; but that kind of logic just doesn't feel right for
db_findmailbox_owner, imo.

There's db_findmailbox_by_regex for this kind of functionality. Which I wouldn't
have guessed hadn't I just applied Geo's fnmatch style listex_match code there
last week. It has a flag for case-sensitivity that will suite you. For 2.0 that
is not relevant of course, since db_findmailbox_by_regex uses straight posix
regex, case-insensitive and all.

I would also like to see some basic unit-tests, esp for remove_folder. And I see
a stack smasher in valid_folder:

+               strcat(tmp, ":");
+               strcat(tmp, folder);
+               strcat(tmp, ":");

where tmp is a const, and no boundary checks are applied to folder. Naughty,
naughty.

+               strcat(tmp, ":");
+               strncat(tmp, folder, sizeof(tmp)-2);
+               strcat(tmp, ":");

That should do it, right?

> Like won't cut it either, I needed something that did a case
> comparison.  I'm open to suggestions.

Looks almost finished enough for svn-trunk. If it works out there it is of
course very much elligible for 2.0.6. This is a great new feature.



-- 
  ________________________________________________________________
  Paul Stevens                                  mailto:[EMAIL PROTECTED]
  NET FACILITIES GROUP                     PGP: finger [EMAIL PROTECTED]
  The Netherlands________________________________http://www.nfg.nl

Reply via email to