iRedMail supports procmail too.
Steps to use procmail instead of sieve LDA:
- Add below lines in postfix master.cf
procmail unix - n n - - pipe
flags=DRhu user=vmail:vmail argv=/usr/bin/procmail -r -t SENDER=${sender} RECIPIENT=${recipient} DOMAIN=${nexthop} -m USER=${user} EXTENSION=${extension} /etc/procmailrc
Tip: iRedMail ships a sample procmailrc under samples/ directory.
- Create log file if necessary:
# touch /var/log/procmail.log
# chown vmail:vmail /var/log/procmail.log
# chmod 0700 /var/log/procmail.log
- Set transport of this user in your MYSQL/LDAP backend.
In MySQL backend, change value of 'transport' column in vmail.mailbox table. set to 'procmail' (this is what we defined in postfix master.cf).
In OpenLDAP backend, change value of 'mtaTransport' attribute of this user.
- Be CAREFUL, maildir generated by iRedMail is hashed, but seems procmail can't find them, so maybe you should change maildir related paths in SQL/LDAP of this user, so that it can receive mails.
e.g. In MySQL backend, you may want to change value of 'storagebasedirectory' and 'maildir' columns in vmail.mailbox table. In LDAP backend, you may want to change value of 'storageBaseDirectory' and 'mailMessageStore' attributes.
If you want to change these paths, it's a good idea to not mix procmail mailboxes and default LDA mailboxes, you may want to use /var/vmail/procmail01/ as storageBaseDirectory instead of /var/vmail/vmail01 which used by default LDA.