LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 03-16-2006, 11:24 AM   #1
juniox
Member
 
Registered: Apr 2003
Posts: 34

Rep: Reputation: 15
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?
 
Old 03-16-2006, 12:12 PM   #2
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,415
Blog Entries: 55

Rep: Reputation: 3599Reputation: 3599Reputation: 3599Reputation: 3599Reputation: 3599Reputation: 3599Reputation: 3599Reputation: 3599Reputation: 3599Reputation: 3599Reputation: 3599
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).
 
Old 03-16-2006, 12:57 PM   #3
juniox
Member
 
Registered: Apr 2003
Posts: 34

Original Poster
Rep: Reputation: 15
you wanna mean:

Quote:
SENDER=`formail -rtzxTo:`
| (formail $SENDER ; echo "testing") | $SENDMAIL -oi -t -f antivirus
??
 
Old 03-16-2006, 01:20 PM   #4
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,415
Blog Entries: 55

Rep: Reputation: 3599Reputation: 3599Reputation: 3599Reputation: 3599Reputation: 3599Reputation: 3599Reputation: 3599Reputation: 3599Reputation: 3599Reputation: 3599Reputation: 3599
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
 
Old 03-16-2006, 01:50 PM   #5
juniox
Member
 
Registered: Apr 2003
Posts: 34

Original Poster
Rep: Reputation: 15
doesnt work
:-(
 
Old 03-16-2006, 02:00 PM   #6
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,415
Blog Entries: 55

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


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
formail fails on virtual user [qmail,vpopmail,procmail,formail] jonavogt Linux - Networking 2 01-15-2009 10:29 AM
formail with procmail priyesh Programming 2 10-23-2003 12:01 AM
Procmail and formail aBl_tR3kr Linux - Software 1 03-26-2003 11:15 AM
procmail and formail aBl_tR3kr Linux - Networking 1 03-26-2003 11:02 AM
procmail and formail aBl_tR3kr Linux - Newbie 0 03-26-2003 10:41 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 05:54 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration