From: Jabba on
Hi,
I have a problem with messages to multiple users on my serwer.

I have a virtual domains on mysql.

Directories /home/mail/domain.pl/username

if mail is for 3 users in syslog postfix is called 3 times but with
same pipie number.

where is the problem ?
Maybe someone could help me with write a code to explode users and
domains from ^To header and place message to right folders ?

main.cf:

procmail unix - n n - - pipe
flags=R user=vmail:vmail argv=/usr/bin/procmail -t -m /etc/procmailrc
${recipient}

procmailrc :

SHELL=/bin/sh
VERBOSE=yes
UMASK=007
ADRES=$1
ADRES=`echo $ADRES | /usr/bin/tr A-Z a-z` # force lowercase username
DOMAIN=`echo "${ADRES}" | cut -d @ -f 2 | cut -d "<" -f 2| cut -d">" -
f 1| cut -d @ -f 1`
USER=`echo "${ADRES}" | cut -d @ -f 1 | cut -d "<" -f 2| cut -d">" -f
1| cut -d @ -f 1` # get username for local delivery
SMIETNIK=/home/mail/filtered/
LOGFILE=/home/log/procmailnew.log # for testing & troubleshooting
INCLUDERC=/home/mail/${DOMAIN}/${USER}/.procmailrc # allow users to
create their own recipes
LOGNAME: ${LOGNAME}"
MAILDIR=/home/mail/${DOMAIN}/${USER}/

$MAILDIR

thanx

Marcin Jablonski
From: juair10 on
On 6 mar, 10:01, Jabba <jabba1...(a)gmail.com> wrote:
> Hi,
> I have a problem with messages to multiple users on my serwer.
>
> I have a virtual domains on mysql.
>
> Directories /home/mail/domain.pl/username
>
> if mail is for 3 users in syslog postfix is called 3 times but with
> same pipie number.
>
> where is the problem ?
> Maybe someone could help me with write a code to explode users and
> domains from ^To header and place message to right folders ?
>
> main.cf:
>
> procmail unix - n n - - pipe
> flags=R user=vmail:vmail argv=/usr/bin/procmail -t -m /etc/procmailrc
> ${recipient}
>
> procmailrc :
>
> SHELL=/bin/sh
> VERBOSE=yes
> UMASK=007
> ADRES=$1
> ADRES=`echo $ADRES | /usr/bin/tr A-Z a-z` # force lowercase username
> DOMAIN=`echo "${ADRES}" | cut -d @ -f 2 | cut -d "<" -f 2| cut -d">" -
> f 1| cut -d @ -f 1`
> USER=`echo "${ADRES}" | cut -d @ -f 1 | cut -d "<" -f 2| cut -d">" -f
> 1| cut -d @ -f 1` # get username for local delivery
> SMIETNIK=/home/mail/filtered/
> LOGFILE=/home/log/procmailnew.log # for testing & troubleshooting
> INCLUDERC=/home/mail/${DOMAIN}/${USER}/.procmailrc # allow users to
> create their own recipes
> LOGNAME: ${LOGNAME}"
> MAILDIR=/home/mail/${DOMAIN}/${USER}/
>
> $MAILDIR
>
> thanx
>
> Marcin Jablonski


You must change the lin of procmail in master.cf like this:
flags=DRhu user=vmail argv=/usr/bin/procmail -t -m /etc/procmailrc $
{recipient}

and you must add in main.cf this:
mailbox_command = /usr/bin/procmail -a "$EXTENSION"
procmail_destination_recipient_limit = 1

Then reload postfix