procmail
[Top] [All Lists]

Re: Aliases xFrom address restriction

2006-09-03 04:19:16

On Sat, 2 Sep 2006, Matthias H?ker wrote:



Jasim Asfoor schrieb:

Hi,

I need /etc/procmailrc to restrict "From" mail coming to different
aliases by searching at a common whitelist file.

If the email "To" address is HQ_employee(_at_)domain(_dot_)com , compare the 
mail
"From" address matching pattern with a common "whitelist" file. i.e
eg:/etc/procmail/whitelist

----whitelist file content may be like this---------


the From is easaly faked it i sbetter to look for the Envelope  from

first you have to do something like:

:0  #read the last Received from Header
* ^Received:.*\/[^ ].*
{ X_RECEIVED=$MATCH }

:0   # reading the part after envelope from
* $ X_RECEIVED ?? envelope-from[ ]+\/.*
{ X_ENVELOPE_FROM=$MATCH }


        'envelope-from' not exist in some messages.  Instead of
        'Received:'  I prefer extracting  From_  by formail:

theSENDER=`formail -rz -x"To: "`

Bye,
  Udi



# setting $NL for a newline

NL = "
"

# finding fgrep at the right place
FGREP=/usr/bin/fgrep

:0
* ? (echo "$X_ENVELOPE_FROM" | \
    $FGREP -i -f /etc/mail/friendslist)
{
LOG = "$NL ======> Received Email From \
"$X_ENVELOPE_FROM" is Whitelisted <====== $NL"
WHITE=YES
}



the file

/etc/mail/friendslist

can have the email of your friends 1 by 1 line, a empty line will work
like wild card


now you can use
:0:
*   WHITE ?? YES
/var/mail/whiteinboxfile


Matthias





____________________________________________________________
procmail mailing list   Procmail homepage: http://www.procmail.org/
procmail(_at_)lists(_dot_)RWTH-Aachen(_dot_)DE
http://MailMan.RWTH-Aachen.DE/mailman/listinfo/procmail






************************************************************************************
This footnote confirms that this email message has been scanned by
PineApp Mail-SeCure for the presence of malicious code, vandals & computer 
viruses.
************************************************************************************




____________________________________________________________
procmail mailing list   Procmail homepage: http://www.procmail.org/
procmail(_at_)lists(_dot_)RWTH-Aachen(_dot_)DE
http://MailMan.RWTH-Aachen.DE/mailman/listinfo/procmail

<Prev in Thread] Current Thread [Next in Thread>