Oops I forgot to quote the procmail .. so here it goes again
the trouble I'm having is the "grep -i -q FileNameA" Command ... don't know
how I'm supposed to use that as a filter... it just continues with the
{blokk} and doesn't report error's ??
And the Save attachment ... wich I don't understand how Im going to do ???
-----------.procmailrc-------------------
SENDER=` formail -x"From" -x"From:" -x"Sender:" \`
FILENAME=`grep -e '.*filename=' | sed -e 's/^.*filename=//g' | sed -e
's/\"//g'`
VERBOSE=yes
#LOGABSTRACT=all
LOGFILE=log
##### Check if this is an allowed sender #####
:0 w
* ^FROM_DAEMON
* ^X-Loop: steinar(_at_)linux(_dot_)skyggnir(_dot_)is
*! ? formail -x"From" -x"From:" -x"Sender:" \
| grep -i -q -f UserListA
*! ? formail -x"From" -x"From:" -x"Sender:" \
| grep -i -q -f UserListB
TRASH #will be dev/null later on
############ OK, is he in UserGroup A ################
:0 Efw
* ? formail -x"From" -x"From:" -x"Sender:" \
| grep -i -q -f UserListA
## Compare the sender with the user list ....
* ? grep "-i" "-q" "$FILENAME" "FileNameA"
## check to see if the filename is correct ( does not work )
{
:0 c
| split_program | mail -s "(A) U Have Mail"
steinar(_at_)tolvumyndir(_dot_)is
## Notify that new mail has arrived .. split_program is nothing yet
## maybe I use csplit or split to capture the attached file ??
:0
!steinar(_at_)tolvumyndir(_dot_)is
## this is not needed after I find out how to save attachment
}
#else check the same things for UserGroupB
:0 Efw
* ? formail -x"From" -x"From:" -x"Sender:" \
| grep -i -q -f UserListB
* ? grep "-i" "-q" "$FILENAME" "FileNameB"
{
:0 c
| split_program | mail -s "(B) U Have Mail "
steinar(_at_)tolvumyndir(_dot_)is
:0
!steinar(_at_)tolvumyndir(_dot_)is
}
:0 w
* ? formail -x"From" -x"From:" -x"Sender:" \
| grep -i -q -f UserListA
## Here I reecheck the userName ... maybe I should not..
| mail -s "Villa!, Síðasta skýrsla komst ekki til skila! " $SENDER
## Here I send a Error Msg ... attchatment was missing
:0 Ew
* ? formail -x"From" -x"From:" -x"Sender:" \
| grep -i -q -f UserListA
## Here I reecheck the userName ... maybe I should not..
| mail -s "Villa!, Síðasta skýrsla komst ekki til skila! " $SENDER
## Here I send a Error Msg ... attchatment was missing
:0 E
ERROR
#and save it in a file called ERROR
-----------.procmailrc-------------------
With Regards,
Steinar
--------------------------
Steinar M. Skúlason
TM-Soft
http://www.TolvuMyndir.is
--------------------------