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.

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

--
David A. Niblett               | email: [EMAIL PROTECTED]
Network Administrator          | Phone: (352) 334-3400
Gainesville Regional Utilities | Web: http://www.gru.net/



-----Original Message-----
From: Paul J Stevens [mailto:[EMAIL PROTECTED] 
Sent: Thursday, May 19, 2005 3:35 AM
To: DBMail mailinglist
Subject: Re: [Dbmail] How to Filter in dbmail


David,

I was reviewing your patch. First thing I noticed was:

diff -urN dbmail-2.0.4/db.c dbmail-2.0.4-folders/db.c
--- dbmail-2.0.4/db.c   2005-03-17 09:43:07.000000000 -0500
+++ dbmail-2.0.4-folders/db.c   2005-05-18 10:34:08.067901170 -0400
@@ -2559,7 +2559,7 @@

        snprintf(query, DEF_QUERYSIZE,
                 "SELECT mailbox_idnr FROM dbmail_mailboxes "
-                "WHERE name='%s' AND owner_idnr='%llu'",
+                "WHERE name~*'%s' AND owner_idnr='%llu'",
                 escaped_local_name, owner_idnr);
        dm_free(local_name);
        dm_free(escaped_local_name);


You're using posix regexp in a query here. That wont go for mysql. At least
not in the syntax you use. Why not use a LIKE query here? Or even, why use
pattern matches at all here.


Niblett, David A wrote:
> I was reading a post on DBMail SPAM filtering.  Sorry if this doesn't 
> end up in the thread.
> 
> Currently I have a patch that I wrote for DBMail-2.0.1 and I just 
> updated for DBMail-2.0.4.  It's in the bug list for DBMail.
> 
> I added the feature to the lmtpd server to accept
>   [EMAIL PROTECTED]
> 
> With that I'm using postfix -> amavisd-new -> dbmail.  I have amavisd 
> modify the email if it's tagged as spam to be
>   [EMAIL PROTECTED]
> 
> Then when dbmail stores the message it's automatically put into the 
> SPAM folder.
> 
> You can also use the patch to deliver to any folder you want. It's 
> particularly useful for list servers as well.  For example, if you 
> subscribe to the this list as:
> 
>   [EMAIL PROTECTED]
> 
> All your list Email will be automatically sorted into the dbmail 
> folder.
> 
> You can find the patch at:
> http://www.dbmail.org/mantis/bug_view_advanced_page.php?bug_id=0000057
> 
> As always, use at your own risk, but it's working fine for me.
> 
> --
> David A. Niblett               | email: [EMAIL PROTECTED]
> Network Administrator          | Phone: (352) 334-3400
> Gainesville Regional Utilities | Web: http://www.gru.net/
> 
> _______________________________________________
> Dbmail mailing list
> [email protected] https://mailman.fastxs.nl/mailman/listinfo/dbmail
> 

-- 
  ________________________________________________________________
  Paul Stevens                                      paul at nfg.nl
  NET FACILITIES GROUP                     GPG/PGP: 1024D/11F8CD31
  The Netherlands________________________________http://www.nfg.nl
_______________________________________________
Dbmail mailing list
[email protected] https://mailman.fastxs.nl/mailman/listinfo/dbmail

Reply via email to