Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: DBMail: users

(REPOST) Filtering from Dbmail and Postfix

 

 

DBMail users RSS feed   Index | Next | Previous | View Threaded


butche at bpsnetworks

May 22, 2002, 8:11 AM

Post #1 of 4 (224 views)
Permalink
(REPOST) Filtering from Dbmail and Postfix

> I have a couple of domains running on dbmail (Postfix). I want to do
> selective filtering for viruses/spam.
>
> i.e.
> user1 [at] domain is filtered (all his aliases as well)
> user2 [at] domain is NOT filtered
>
> Does the new filtering capabilities in dbmail-smtpd address this? (I
> know that dbmail is not actually DOING the filtering.) I had thought
> that I could simply set up aliases for certain users in postfix that
> were pre-processed by the filter, then dumped into dbmail,
> but not sure
> this would work.
>
> user2 [at] domain (not filtered) -> postfix transport -> dbmail
> user1 [at] domain (filtered) -> postfix alias -> postfix transport ->
> <insert filter here> -> dbmail-smtpd + appropriate args
>
> Does this make sense? Would it work as is, or is there a better way?
>
>
> --
> Butch Evans
> 573-293-2638
> BPS Networks
> PO BOX 550
> 114 W Main
> Bernie, MO 63822
>


jeffb at espi

May 22, 2002, 8:21 AM

Post #2 of 4 (211 views)
Permalink
Re: (REPOST) Filtering from Dbmail and Postfix [In reply to]

>> I have a couple of domains running on dbmail (Postfix). I want to do
>> selective filtering for viruses/spam.

We have two separate servers feeding dbmail, one with reduced
filtering, and we point domains that can't stand agressive anti-spam
filtering to one, while the "fully filtered" domains go to the other.
This is because the spam filtering on our system is ONLY done by
postfix, since I don't even want it reaching dbmail if it's spam.

However, you could use a Perl script as the "transport agent" out of
postfix, instead of directly dumping to dbmail... This script would do
a look-up on the destination address to determine what filters to
apply, THEN call dbmail-smtp to insert the resulting message into the
database.

--
Jeff Brenton
President,
Engineered Software Products, Inc
http://espi.com
Questionable web page: http://dididahdahdidit.com

Liberalism grants you the freedom to advocate any idea*.
* Please see http://www.dididahdahdidit.com/except.php for a
current list of exceptions


butche at bpsnetworks

May 22, 2002, 8:33 AM

Post #3 of 4 (210 views)
Permalink
RE: (REPOST) Filtering from Dbmail and Postfix [In reply to]

> >> I have a couple of domains running on dbmail (Postfix). I
> want to do
> >> selective filtering for viruses/spam.
>
> We have two separate servers feeding dbmail, one with reduced
> filtering, and we point domains that can't stand aggressive
> anti-spam filtering to one, while the "fully filtered"
> domains go to the other. This is because the spam filtering
> on our system is ONLY done by postfix, since I don't even
> want it reaching dbmail if it's spam.
>

This is using header/body checks in postfix?

> However, you could use a Perl script as the "transport agent"
> out of postfix, instead of directly dumping to dbmail... This
> script would do a look-up on the destination address to
> determine what filters to apply, THEN call dbmail-smtp to
> insert the resulting message into the database.

Something like:
1. transport for bpsnetworks.com is a pipe to filter.pl
2. filter.pl does:
a. lookup enduser [at] bpsnetworks
b. if unfiltered, call dbmail-smtpd to deliver message
c. if filtered, call virus/spam filters and then hand it to
dbmail-smtpd (if it lives)

Is that what you are suggesting? If so, it seems that this would
require one of 2 options.
1. either use an existing, unused field in the db (like user.clientid)
2. add an additional field to either the user or aliases table to
indicate filtering or not

Am I understanding your suggestion correctly? OR, are you suggesting
doing this lookup on a postfix table (I have mysql support in postfix).
Also, is there a tool already in existence that would get me started on
this? I don't mind doing some tweaking, but I am not that familiar with
perl to write it from the ground up.



--
Butch Evans
573-293-2638
BPS Networks
PO BOX 550
114 W Main
Bernie, MO 63822


jeffb at espi

May 22, 2002, 8:52 AM

Post #4 of 4 (209 views)
Permalink
Re[2]: (REPOST) Filtering from Dbmail and Postfix [In reply to]

BE> This is using header/body checks in postfix?

The "loose" server does NOT do regexp checks, while the "tight" server
does.

Both use a MySQL table of blocked addresses (similar to the "access"
table in postfix), and each has a postfix hash table of IPs to not
accept mail from.

Eventually, everything except the REGEXP be combined into a single
MySQL table of email addresses/domains and IP subnets, with a "level"
field - the different mail servers will do their selects from this
table with a 'where' clause that will chose which level to use.

That is, "select action from myaccess where mailfrom = 'badguy [at] u'
and level < 2" would ignore a block on this address that had a level
of 4 assigned.

>> However, you could use a Perl script as the "transport agent"

BE> Something like:
BE> 1. transport for bpsnetworks.com is a pipe to filter.pl
BE> 2. filter.pl does:
BE> a. lookup enduser [at] bpsnetworks
BE> b. if unfiltered, call dbmail-smtpd to deliver message
BE> c. if filtered, call virus/spam filters and then hand it to
BE> dbmail-smtpd (if it lives)

BE> Is that what you are suggesting? If so, it seems that this would
BE> require one of 2 options.
BE> 1. either use an existing, unused field in the db (like user.clientid)
BE> 2. add an additional field to either the user or aliases table to
BE> indicate filtering or not

Yes, this is what I'm suggesting. The Perl script wouldn't have to use
any special file/database; a simple text file of "exceptions" to
"standard" processing would be usable. If the address doesn't match a
pattern in this exception file, it gets filtered. Otherwise, act upon
the options found within the filter.

We use the clientid fields to separate domains for listing in our
setup. But adding an additional field to the aliases table would not
be a bad thing... except when the table changes at version upgrades.
B-(

If you want filtering options ONLY at the domain level, that can be
handled in the transport table - if you're using my mysql-based
suggestion, you have complete control over that table anyway.

User-level filtering options, though, involve getting access to either
the user or aliases table, OR A COPY THEREOF. The aliases table would
be the more useful; you could have different actions for different
aliases of the same user...

BE> Am I understanding your suggestion correctly? OR, are you suggesting
BE> doing this lookup on a postfix table (I have mysql support in postfix).
BE> Also, is there a tool already in existence that would get me started on
BE> this? I don't mind doing some tweaking, but I am not that familiar with
BE> perl to write it from the ground up.

I haven't seen a tool like this, but it could probably be cobbled
together by a Perl expert in an hour or so... someone new to Perl
(like me) would take a few hours to do it. B-)

--
Jeff Brenton
President,
Engineered Software Products, Inc
http://espi.com
Questionable web page: http://dididahdahdidit.com

Liberalism grants you the freedom to advocate any idea*.
* Please see http://www.dididahdahdidit.com/except.php for a
current list of exceptions

DBMail users RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.