Quantcast
Channel: iRedMail
Viewing all articles
Browse latest Browse all 48162

Re: mailing list and reply-to address

$
0
0

Hi ZhangHuangbin
I think I almost emulated the mimic of mailman just using standard iredmail distribution list. I used a little trick and procmail delivery. I write it here in case anyone is interested

I added procmail transport in 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

then i installed the following /etc/procmailrc

SHELL='/bin/sh'
PATH='/bin:/usr/bin:/usr/local/bin:/usr/X11R6/bin'
DROPPRIVS=yes
LOGFILE='/var/log/procmail.log'
VERBOSE=no
FORMAIL='formail'
SENDMAIL='/usr/sbin/sendmail'
MAILBOX="/var/vmail/procmail1/$DOMAIN/$USER/Maildir/"
DEFAULT="$MAILBOX"
JUNK="${MAILBOX}/.Junk/"
RECIPIENT="${RECIPIENT}"
SENDER="${SENDER}"
:0
* ? [ -d ${MAILBOX} ] || mkdir -p $MAILBOX
{ }
:0 H
* ^X-Spam-Status: YES
${JUNK}
SWITCHRC="/var/vmail/procmail1/$DOMAIN/$USER/.procmailrc"

then I created a normal email user in phpldapadmin and setted
homeDirectory = /var/vmail/procmail1/MYDOMAIN/MYLISTADDR/
mailMessageStore = procmail1/MYDOMAIN/MYLISTADDR/
mtaTransport = procmail

now, doing this, I'm able to use a personalized .procmailrc for each user created this way.
So one external member may write to mylistaddr@mydomain.com that is a procmail mailbox, and let procmail forward the message to the iredmail-distribution-list@mydomain.com created with ldap/iredmail, and add a reply-to and a [LABEL] to each message. This is done by the following  .procmailrc. I'm still working on make it work for closed lists.

place this .procmailrc (owned by vmail) in /var/vmail/procmail1/MYDOMAIN/MYLISTADDR/

:0 H
* ^X-Loop: mylistaddr@mydomain.com
$MAILBOX/.Bounces/

:0 chfw   
SUBJECT=| formail -xSubject:


:0 Wfc
* ^Subject:.*\[ADD_LABEL_TO_SUBJ\]
| formail -A "X-Loop: mylistaddr@mydomain.com" -I "Reply-To: mylistaddr@mydomain.com"

:0 WEfc
* !^Subject:.*\[ADD_LABEL_TO_SUBJ\]
| formail -A "X-Loop: mylistaddr@mydomain.com" -I "Reply-To: mylistaddr@mydomain.com" -I "Subject: [ADD_LABEL_TO_SUBJ] $SUBJECT"

:0 c
! iredmail-distribution-list@mydomain.com

Viewing all articles
Browse latest Browse all 48162

Latest Images

Trending Articles



Latest Images