procmail
[Top] [All Lists]

problems with a recipie that handles the undeliverable emails

2001-08-15 02:58:57
Hi List

I have a problem with a procmail recpie that I use to inform the sender
that one adress is not valid. Our email server qpopper and sendmail
delivers a emails that do not match with one of the email-users, to an
special account.
In this account a procmail recepie extract SUBJECT and TO and create a
new mail that sends this emails back to the sender with TO so that the
sender knows what email adress is not valid.
But the problem now is that when the TO Field contains more
email-adresses than formail extracts all TO-adresses a not only the
false so that the sender gets the mail back with many adress. 
So my questions how can handle only with a text file containing all the
adresse or have procmail a special command for this problem 


Thanx very musch for help.

Erik

Here the .procmailrc

#####
SHELL=/bin/sh
PATH=/usr/local/bin/:/bin:/usr/bin

# GETTING SOME STUFF

SUBJ_=`formail -c -xSubject: \
       | sed -e 's/^[ ]*//g' -e 's/[ ]*$//g'`
       
TO_=`formail -rt -xTo: \
          | expand | sed -e 's/^[ ]*//g' -e 's/[ ]*$//g'`



:0:
* !^FROM_DAEMON
* !^X-LOOP: postmaster(_at_)intra(_dot_)cii(_dot_)berlin

|(formail -r \
     -A "X-Loop: postmaster(_at_)intra(_dot_)cii(_dot_)berlin" ; \
     -I "Subject:>>>> UNDELIVERABLE EMAIL <<<<<" ; \
     -I "From: postmaster(_at_)intra(_dot_)cii(_dot_)berlin" ; \
     echo "Dear Sender," ; \
     echo "" ; \
     echo "Thank you for your email about" ; \
     echo "\"${SUBJ_}\"" ; \
     echo "" ; \
     echo "But the email adress you have entered " ; \
     echo "\"${TO_}\"" ; \
     echo "is not a valid email-adress" ; \
     echo "" ; \
     echo "" ; \
     echo "Please check the correct spelling !!!" ; \
     echo "" ; \
     echo "------------------------------------------------" ; \
     echo "" ; \
     echo "If you felt you have recevied this message error" ;  \
     echo "contact error(_at_)cii(_dot_)de" ; \
     echo "" ; \
     echo "------------------------------------------------" ) \
     | /usr/lib/sendmail -oi -t postmaster(_at_)intra-cii(_dot_)berlin
#####
 

_______________________________________________
procmail mailing list
procmail(_at_)lists(_dot_)RWTH-Aachen(_dot_)DE
http://MailMan.RWTH-Aachen.DE/mailman/listinfo/procmail

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