A short tutorial:
## Setup
/etc/postfix/master.cf:
```
# ${nexthop} is '%d/%u' in transport ('mlmmj:%d/%u')
mlmmj unix - n n - - pipe
flags=ORhu user=mlmmj argv=/usr/bin/mlmmj-receive -F -L /var/spool/mlmmj/${nexthop}
# flags=ORhu user=mlmmj argv=/usr/bin/mlmmj-receive -F -L /var/spool/mlmmj/${domain}/${user}
```
/etc/postfix/main.cf:
```
mlmmj_destination_recipient_limit = 1
virtual_alias_maps = proxy:mysql:/etc/postfix/mysql/mlmmj.cf, ...
transport_maps =
proxy:mysql:/etc/postfix/mysql/transport_maps_user.cf,
proxy:mysql:/etc/postfix/mysql/transport_maps_mlmmj.cf,
proxy:mysql:/etc/postfix/mysql/transport_maps_domain.cf
```
/etc/postfix/mysql/mlmmj.cf:
```
user = vmail
password = qsescZvV03f6YUtTMN2bQTejmjatzz
hosts = 127.0.0.1
port = 3306
dbname = vmail
query = SELECT '%s' FROM alias WHERE address='%s' AND islist=1 AND active=1
```
/etc/postfix/mysql/transport_maps_mlmmj.cf:
```
user = vmail
password = qsescZvV03f6YUtTMN2bQTejmjatzz
hosts = 127.0.0.1
port = 3306
dbname = vmail
query = SELECT 'mlmmj:%d/%u' FROM alias WHERE address='%s' AND islist=1 AND active=1
```
## create new mailing list with mlmmj-agent program
Create a new mailing list with domain.com/listname style:
```
mlmmj-make-ml -L 'alist' -s /var/spool/mlmmj/a.cn -c mlmmj
```
In /var/spool/mlmmj/b.cn/alist/control/customheaders:
```
X-Mailinglist: alist@b.cn
Reply-To: alist@b.cn
```
## References
* http://mlmmj.org/docs/readme-postfix/