When setting up a postfix + courier + postgresql mail server, I found the following SQL to be quite helpful in allowing me to have a default 'catch-all' type account for incorrectly addressed emails to go into. So in /etc/postfix/pgsql/virtual-mailbox-maps.cf plonk in something like :
query = SELECT maildir FROM mailbox WHERE username = '%s' AND active = true UNION ALL SELECT 'catch-all' || SUBSTRING('%s' FROM POSITION ('@' in '%s')) || '/' LIMIT 1;
I had initially thought of writing a stored procedure to do it, using something like Perl... but DC came up with the above, which works, so I'm happy...
Yet another post designed to help Mr Google
Comments
Wow! A real eye-opener that
Wow!
A real eye-opener that post.
I will check your attempts with Bonzo, I'm sure he can point you in the right direction (I wouldn't waste any time with that orange dog).
Post new comment