Postfix new MySQL syntax > Postfix 2.2
I found out just yesterday that Postfix uses a new syntax for SQL lookups.
It seems like my old syntax was still compatible with Postfix 2.2.8.
I guess it will be backward compatible for a while.
I found out just yesterday that Postfix uses a new syntax for SQL lookups.
It seems like my old syntax was still compatible with Postfix 2.2.8.
I guess it will be backward compatible for a while.
Thanks to Luca Gibelli for his document about Postfix SMTP AUTH.
It helped me a lot, this article is largely based on his work, I adapted it to match RHEL/CentOS systems.
What follows is an explanation on how I got courier-imap 4 running as non-root on my CentOS 3 system.
Let’s say you own several domains :
Your default domain : my-domain.be
The domain you registered to protect your trademark, copyright, brand, etc :
- mydomain.be
- my_domain.be
Edit 16 nov 2006 : please consider using SMTP AUTH instead of pop-before-smtp : http://www.wains.be/?p=157
This is not aimed to be a step by step guide.. This is just a review of my current config with some helpful notes, it is probably meant for already advanced postfix users seeking for tips and tricks.
WordPress may have reformated the code in some weird way.. don’t do massive copy paste and hope it works fine straight away, please review everything carefully !!
If you have troubles figuring out something, drop me a line..
I needed to be able to kill spam reaching a certain score on my email gateway, which only delivers to virtual users and virtual domains…
When delivering locally using the “local” delivery agent, you can easily use procmail by setting “mailbox_command = /usr/bin/procmail -whatever options”.. this option doesn’t work for the “virtual” delivery agent though.. I’ll explain below how to trigger procmail when using the virtual delivery agent
The following configuration does this :
If an email reaches the inbound interface on the email gateway, the email will get piped through the “procmail-test” filter, which will run a procmail script.
The procmail-test filter/script will pipe the email through SpamAssassin which will mark the email as spam (or not).
If the email is marked as spam above a score of 4.0 (4 stars ****, check the headers to be sure SpamAssassin puts stars in the headers), the email won’t be delivered to its original recipient(s) but forwarded to catchspam@domain.be.. You can get rid of the email using /dev/null instead of forwarding it.
You can combine many analysis.. such as procmail + amavis…
Make sure both sendmail and postfix packages are installed
Install “system-switch-mail” from the base repository
Run /usr/sbin/system-switch-mail
Set Postfix as the default MTA
You are done
I discovered I could improve Postfix performances when using MySQL as backend
According to http://spike.porcupine.org/test/html/proxymap.8.html :
To consolidate the number of open lookup tables by
sharing one open table among multiple processes.
For example, making mysql connections from every
Postfix daemon process results in “too many connec-
tions” errors.
Edit /etc/postfix/main.cf :
# Allow proxy for the settings using MySQL
proxy_read_maps = $virtual_alias_maps $virtual_mailbox_maps $transport_maps $virtual_uid_maps $virtual_gid_maps
# add proxy: in front of any mysql:
virtual_mailbox_base = /var/spool/postfix/vmail
virtual_minimum_uid = 1000
virtual_mailbox_maps = proxy:mysql:/etc/postfix/vmailsql/vmailbox
virtual_alias_maps = proxy:mysql:/etc/postfix/vmailsql/valias
transport_maps = proxy:mysql:/etc/postfix/vmailsql/transport
virtual_uid_maps = proxy:mysql:/etc/postfix/vmailsql/vuid
virtual_gid_maps = proxy:mysql:/etc/postfix/vmailsql/vgid
local_recipient_maps = $virtual_mailbox_maps
This article will review my current configuration,
this is an update to a previous article : CentOS + Postfix + virtual users + Squirrelmail + …
What I stopped using since the previous article :
- vacation message because the script I was using had a few annoying bugs that I haven’t figured out yet.
- squirrelmail replaced by roundcube webmail (still beta !!), I don’t have many webmail users so I can afford using roundcube, which still has a lot of bugs. If you want a rock solid webmail, go for squirrelmail.
This document describes how to install a mail server based on postfix that is capable of TLS. I tested it on CentOS 3.6 and 4.2.