LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Networking (https://www.linuxquestions.org/questions/linux-networking-3/)
-   -   procmail and formail (https://www.linuxquestions.org/questions/linux-networking-3/procmail-and-formail-425393/)

juniox 03-16-2006 10:24 AM

procmail and formail
 
hello everyone

i would like to block the messages that comes with attachment .exe, .bat, and others
right, this is working...

other thing is send a message to user who send the file
this is working too

/etc/procmailrc
Quote:

| (formail -r -k ; cat /etc/virus.msg) | $SENDMAIL -oi -t -f antivirus
but, together, i would like to send a message to the real receiver

how can i do that?
should be something like

"| (formail $receiver) "... ??

can you help?

unSpawn 03-16-2006 11:12 AM

You can extract the sender to a variable like this: SENDER=`formail -rtzxTo:`.
* Make sure you avoid loops (FROM_DAEMON, FROM_MAILER, stuff like that).

juniox 03-16-2006 11:57 AM

you wanna mean:

Quote:

SENDER=`formail -rtzxTo:`
| (formail $SENDER ; echo "testing") | $SENDMAIL -oi -t -f antivirus
??

unSpawn 03-16-2006 12:20 PM

More something like

match a condition
SENDER=`formail -rtzxTo:`
| echo -en "Subject: some subject\n$(cat some message)\n" | $SENDMAIL -F noreply@yourhost -f noreply@yourhost $SENDER

juniox 03-16-2006 12:50 PM

doesnt work
:-(

unSpawn 03-16-2006 01:00 PM

doesnt work
That reply doesn't contain anything anyone can deal with.
Better post the whole procmail recipe and related error messages.


All times are GMT -5. The time now is 11:48 PM.