1

Topic: change LDA

Hi,

Can sieve pipe into another shell script?  We have some procmail that pipe into another script.
The following is an example of it.  It is a procmail receipt.   If sieve can't handle it, how easy is to configure iredmail to use procmail for only that user?  Thank you.

0:
* ^TO_anita_offline
{
  :0 c
  IN-anita_offline

  :0
  |$HOME/bin/run_mhonarc.sh anita_offline
}

2

Re: change LDA

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.

3

Re: change LDA

Hi,

Thanks for the quick reply, what if I want to have both procmail and sieve?  Just procmail for that particular user.

Thanks.

4

Re: change LDA

ze wrote:

Thanks for the quick reply, what if I want to have both procmail and sieve?  Just procmail for that particular user.

This is per-user setting.

5

Re: change LDA

Hi,

Since I have users authenticate against the iredmail's usermail information.  The procmail in the faq is for global setting.  How do I get procmail to read the user's home directory's .procmailrc?    Thank you.


ZhangHuangbin wrote:
ze wrote:

Thanks for the quick reply, what if I want to have both procmail and sieve?  Just procmail for that particular user.

This is per-user setting.

6

Re: change LDA

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.

As i said, it's per-user setting. If per-user setting isn't available, it will use global setting instead.

How do I get procmail to read the user's home directory's .procmailrc?

You should read procmail documentation.

7 (edited by ze 2009-12-22 18:53:57)

Re: change LDA

HI,

I guess I am a bit dense on this.  I don't see how a user's procmailrc will get executed.  Since iRedMail is virtual and the default user is vmail.  the $HOME variables points to /var/vmail or whatever in the home directory of vmail.  How come sieve mail filtering can't call a script?

Maybe I should use the SWITCHRC to read the .procmailrc in the user's home directory:
somewhere along the /etc/procmailrc:

SWITCHRC="`/usr/bin/getent passwd $USER | cut -d: -f6`/.promailrc". 

The getent is to determine the user's home directory.  Any better solution?  maildrop? Thanks.

ZhangHuangbin wrote:

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.

As i said, it's per-user setting. If per-user setting isn't available, it will use global setting instead.

How do I get procmail to read the user's home directory's .procmailrc?

You should read procmail documentation.