3 messages in net.sourceforge.lists.courier-maildrop[maildropl] maildrop forwarder (SRS p...
FromSent OnAttachments
Jeronimo ZuccoJun 19, 2007 11:55 am 
Sam VarshavchikJun 19, 2007 3:41 pm 
Jeronimo ZuccoJun 19, 2007 5:51 pm 
Actions with this message:
Paste this link in email or IM:
Paste this link in email or IM:
Atom feed for this thread
Paste this URL into your reader:
Subject:[maildropl] maildrop forwarder (SRS problem)Actions...
From:Jeronimo Zucco (jczu@ucs.br)
Date:Jun 19, 2007 11:55:30 am
List:net.sourceforge.lists.courier-maildrop

Hi list.

I'm trying to do my own maildrop script to do forward for outside mails. I use a ldap attribute to store the mail address to forward. I was using aliases in postfix, but this is a problem with SPF enabled domains (SRS problem).

I did the following script to do mail forward:

/^To:.*/ getaddr($MATCH) =~ /^.*/; MATCH=tolower($MATCH)

`FORWARD=$(ldapsearch -x -b 'ou=People,dc=domain,dc=com' "(&(uid=$MATCH)(accountStatus=forward))" mailforward | grep ^"mailforward:" | cut -d\: -f2- | cut -d\ -f2- | sed -e "s/[\\\`\\\\\$\(\)]//g" ) ; \ [ "${FORWARD}" ] && { cat - >/tmp/email_enc_${MATCH}$$.eml ; sendEmail -q -f post@domain.com -t ${FORWARD} -u "Forward Message" -a /tmp/email_enc_${MATCH}$$.eml ; rm -f /tmp/email_enc_${MATCH}$$.eml; exit 1 ; } `

if ( $RETURNCODE == 0 ) exit

But this script works only when the first "To:" mail address is the user with forward enabled. If the message has more than one "to:" address and it's not the first address, then mail forward don't work.

Some tip to get this work ? Any other way to solve mail forward with SRS problem ?

http://jczucco.blogspot.com