procmail
[Top] [All Lists]

multiple recipient filtering - HELP!!! :-)

1998-02-22 07:59:18
I am setting up a mail server for my fathers company. The server dials out
to the internet at various intervals and checks one POP3 account which
contains email for various members of the company. (the ISP forwards all
email to *(_at_)mydomain(_dot_)com to one account). I am using procmail to 
filter out
this incoming mail and have almost got it going...

one problem, if a message is sent to multiple recipients, the procmail
script will deliver it, but will not bounce back the message to the sender
if one of the multiple recipients is invalid. (If only one recipient is
specified and the address is invalid, the mail bounces properly).

My .procmailrc file is as follows:

# my .procmailrc.... used to distribute all emails from the outside world
PATH=/bin:/usr/bin:/usr/bin
MAILDIR=$HOME/Mail      #you'd better make sure it exists
DEFAULT=$MAILDIR/mbox   #completely optional
LOGFILE=$MAILDIR/from   #recommended

#debugging line - I will remove once all works :-)
:0 c
        passthrough

flag = "0"

:0 c
* ^TOneil(_at_)mydomain(_dot_)com
! neil

        :0 E
        { flag = "1" }

:0 c
* ^TOdave(_at_)mydomain(_dot_)com
! dave

        :0 E
        { flag = "1" }

:0 c
* ^TOroland(_at_)mydomain(_dot_)com
! roland

        :0 E
        { flag = "1" }

:0
* flag ?? (0)
  |(/usr/bin/formail -r -k \
        -A"X-loop: mtrade(_at_)mydomain(_dot_)com "| \
        /usr/bin/gawk '{print }\
        /^/ && !HEADER \
          { system("/bin/cat nosuchuser"); \
          print"--" ;\
          HEADER=1 }' ) |\
          /usr/sbin/sendmail -t

# Do nothing - just to finish up.....
:0
        /dev/null

exit

has anyone had any experience setting this kind of thing up? or can anyone
help me... I got the beginnings of this script off the
Linux-Offline-Mailing HOWTO and changed it so I could process multiple
recipients, but I need to bounce if one of these recipients is invalid...

Thanks in advance

Simon

<Prev in Thread] Current Thread [Next in Thread>
  • multiple recipient filtering - HELP!!! :-), Simon Helson (Mr Blobby) <=