LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
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, 10: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, 11:12 AM   #2
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,415
Blog Entries: 55

Rep: Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600
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, 11:57 AM   #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, 12:20 PM   #4
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,415
Blog Entries: 55

Rep: Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600
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, 12:50 PM   #5
juniox
Member
 
Registered: Apr 2003
Posts: 34

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

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


Reply



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 09:29 AM
formail with procmail priyesh Programming 2 10-22-2003 11:01 PM
Procmail and formail aBl_tR3kr Linux - Software 1 03-26-2003 10:15 AM
procmail and formail aBl_tR3kr Linux - Networking 1 03-26-2003 10:02 AM
procmail and formail aBl_tR3kr Linux - Newbie 0 03-26-2003 09:41 AM

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

All times are GMT -5. The time now is 06:15 AM.

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