Note, that I'm a beginner in Linux and I first saw procmail about a week ago
:/
all these flags and pipes and !^'´<>!*[(/\ get me all mixed up :)
I was trying to understand this sed commands .. but no luck, maybe there is
some better documentation about it somewhere ?
Any way's the thing I'm doing here is first check if the sender is allowed
... if not
put it in Rejected (just to begin with... will change to dev/null)
If an allowed sender sends no attachment or the wrong kind of attachment it
bounce's( haven't figured out how I can change the subject when I bounce ..
I'm just using !email(_at_)address(_dot_)com ?? )
But if the sender is allowed and the attachment has the right name .. a mail
notification goes to steinar(_at_)tolvumyndir(_dot_)is and then the attachment
is
supposed to be saved (haven't figured the save part out yet).
Any guidance is appreciated.
-----------.procmailrc-------------------
SENDER=` formail -x"From" -x"From:" -x"Sender:"`
FILENAME=`grep -e '.*filename=' | sed -e 's/^.*filename=//g' | sed -e
's/\"//g'`
VERBOSE=yes
LOGFILE=log
#(f) flag use pipe as filter and (w) wait for filter to finish and use
exitCode
:0fw
* ? formail -x"From" -x"From:" -x"Sender:" \
| grep -i -q -f .markad
* ^[-- Type: text/plain,
* ? | grep -i -q $FILENAME .files
{
:0 c
| split_program | mail -s "(mar) U Have Mail"
steinar(_at_)tolvumyndir(_dot_)is
:0
!steinar(_at_)tolvumyndir(_dot_)is
}
#Else
:0Efw
* ? formail -x"From" -x"From:" -x"Sender:" \
| grep -i -q -f .utgerd
* ^[-- Type: text/plain,
* ? | "grep -i -q $FILENAME .files"
{
:0 c
| split_program | mail -s "(sky) U Have Mail "
steinar(_at_)tolvumyndir(_dot_)is
:0
!steinar(_at_)tolvumyndir(_dot_)is
}
:0E
* ? formail -x"From" -x"From:" -x"Sender:" \
| grep -i -q -f .markad
!${SENDER}
#Else
:0E
* ? formail -x"From" -x"From:" -x"Sender:" \
| grep -i -q -f .utgerd
!${SENDER}
#Else
:0E
Rejected
-----------.procmailrc-------------------
With Regards,
Steinar
--------------------------
Steinar M. Skúlason
TM-Soft
http://www.TolvuMyndir.is
--------------------------