Hello Kuschel,

This is a summary of how to use the POP/IMAP authentication provided
by dbmail with Postfix. I'm also throwing in the method for getting
Postfix to use dbmail's aliases table to decide whether or not to
accept inbound mail, at the end.

-----

To make POP/IMAP-before-SMTP work with Postfix, you must first make
sure that Postfix speaks MySQL... hopefully, you'll already know how
to do that, 'cuz I'm not going to tell you here. B-)

In your postfix main.cf file, you need a line like:

mynetworks = 192.168.0.0/16, mysql:/etc/postfix/my_net.cf

The file /etc/postfix/my_net.cf will contain:

user = postfix
password = [password]
dbname = dbmail
table = pbsp
select_field = since
where_field = ipnumber
additional_conditions = and unix_timestamp() - unix_timestamp(since) <= 18000

With these parameters, any user who has done a POP/IMAP authorization
within the past 1800 seconds (30 minutes) will have their IP validated
for Postfix. At 1801 seconds, the IP will not be validated...

Oh, and, of course, you need to enable DBMail's daemons to feed this,
with the following two settings in dbmail.conf:

DBMAIL_POP_BEFORE_SMTP = yes
DBMAIL_IMAP_BEFORE_SMTP = yes

---

If you're using Postgres instead of MySQL, the patches to make Postfix
talk to Postgres tables are at http://www.rhyme.com.au/postfix.html .
The "additional_conditions" line for my_net.cf needs to be changed,
because of differences in the handling of time fields in Postres.

---

You can have Postfix consult dbmail's aliases table for local users by
adding the following to main.cf:

local_recipient_maps = mysql:/etc/postfix/mailbox.cf

where mailbox.cf contains the parameters for checking an address
against the dbmail aliases table, such as:

user = postfix
password = password
dbname = dbmail
table = aliases
hosts = 192.168.2.2
select_field = alias
where_field = alias

---

This last change has reduced considerably the number of regular
expression spam filters I needed, because we have a number of "spam
trap" addresses that I get bounce messages for before our real
customers get hit. By the time they make it through to the customer
emails, I've already blocked their IPs and email addresses...

-- 
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

Reply via email to