[Mailman-Users] Postfix with MySQL

Mark Sapiro mark at msapiro.net
Sat Aug 15 18:29:24 CEST 2015

On 08/14/2015 11:25 PM, Martin Skjöldebrand wrote:
> In the instruction it says that you should do to postfix main.cf:
> virtual_alias_maps = <your normal virtual alias files>,
>         hash:/usr/local/mailman/data/virtual-mailman
> while editing mm_cfg.py to include
> POSTFIX_STYLE_VIRTUAL_DOMAINS = ['dom2.ain', 'dom3.ain']
> As my Postfix installation uses MySQL as a backend it all become
> slightly confusing. And in the end when trying to send mail to the
> list I get 550 errors says the virtual address isn't found.

I'm not too well versed in mixing postfix hash: and mysql: tables, but
if you post the output from `postconf -n`, I may be able to help you get
this working in the "normal" way.

Also, what's in data/virtual-mailman?

and, if you didn't create the lists that have addresses in 'dom2.ain'
and 'dom3.ain' after adding

POSTFIX_STYLE_VIRTUAL_DOMAINS = ['dom2.ain', 'dom3.ain']

to mm_cfg.py, did you run Mailman's bin/genaliases?

> Is there a pointer to a Postfix w/ MySQL and mailman resource? Apart
> from http://wiki.list.org/DOC/Mailman%20-%20Postfix%20integration%20with%20Mailman%20generated%20transport%20or%20other%20maps  

Not that I know of.

> For one thing I'm not sure that I understand 
> "Create /path/to/data/virtual_to_transport with the following content
> sed -r -e 's/(^[^#]\S+\s+).+$/\1local:/' $1 \
>  > /path/to/data/transport-mailman
> /usr/sbin/postmap /path/to/data/transport-mailman"
> Should that create a virtual_to_transport from these statements? Or
> should I first create the file and then feed it with the above? Also
> I'm not altogether certain that it covers mysql-based postfix setups. 

The method in the FAQ is an alternative that should work in your case.
In step 3, suppose that Mailman's data directory is
/var/lib/mailman/data. If not, adjust the following for the correct path.

Create the file /var/lib/mailman/data/virtual_to_transport and put the
three lines

sed -r -e 's/(^[^#]\S+\s+).+$/\1local:/' $1 \
 > /var/lib/mailman/data/transport-mailman
/usr/sbin/postmap /var/lib/mailman/data/transport-mailman

in that file. I.e. "first create the file and then feed it with the above".

Mark Sapiro <mark at msapiro.net>        The highway is for gamblers,
San Francisco Bay Area, California    better use your sense - B. Dylan

More information about the Mailman-Users mailing list