LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Security
User Name
Password
Linux - Security This forum is for all security related questions.
Questions, tips, system compromises, firewalls, etc. are all included here.

Notices


Reply
  Search this Thread
Old 06-08-2004, 05:43 PM   #1
ciop
LQ Newbie
 
Registered: Feb 2004
Location: Bucharest
Posts: 3

Rep: Reputation: 0
Remove attachments with Procmail?


I have this very simple qustion but for which I haven't found an answer yet.

How can I write a procmail recipe that will deliver an email without it's attachment ?

I'm starting thinking it might not be possilble other ways than to make a copy of the message and forward it.
But than again ... how do I do that without copying the attachment too ?

Thank you.
 
Old 06-08-2004, 09:09 PM   #2
plan9
Member
 
Registered: May 2004
Location: USA
Distribution: Slackware-Current
Posts: 74

Rep: Reputation: 15
I think that I may be able to help, as i've set up some crazy procmail stuff in the past. Please post your .procmailrc and any other related config scripts.

plan9
 
Old 06-09-2004, 02:48 AM   #3
ciop
LQ Newbie
 
Registered: Feb 2004
Location: Bucharest
Posts: 3

Original Poster
Rep: Reputation: 0
My procmailrc file look like this:


#LOGABSTRACT=all
VERBOSE=on

SPOOL=/var/spool/mail/
JUNK=$HOME/junk

PMDIR=/etc/spamm
LOGFILE=$HOME/log.procmail
INCLUDERC=$PMDIR/rc.spamm



The rc.spamm recipe file has the follwoing entries in which I'm most interested:

#Declarations...
# ANY = any character including newline
ANY='(.|$)'
# NAME = characters valid in a user or host name.
NAME=[a-z0-9_.-]


#The recipe...

:0B

* $ Content-type:$ANY+name=".+\.(bat|com|exe|hta|lnk|mdb|mus|pif|scr|vbs|wav)"

#Decision
{

:0 f

#And this one gives me headaches ...
| formail -i "Content-type: text/plain"

:0
$SPOOL

}



As you can see , I intend to keep the message , but without the attachment. Forwarding the message with its attachment as plain text in the body message ... is not good enough.

Is there some adjustment to what I've done , or some totaly different recipe that will just strip the attachment off the message ... so I can just place it in $SPOOL ?


Thanks again.
 
Old 06-09-2004, 03:11 PM   #4
plan9
Member
 
Registered: May 2004
Location: USA
Distribution: Slackware-Current
Posts: 74

Rep: Reputation: 15
ciop,

I see that you appear to want to filter for common virus types. Wanting to kill the attachments, but still be able to check out the message. I have not done anything like that myself- my experience is limited to file servers and complex auto-responders.

I did some searching for you and found something that I think will work for you, it's called the E-mail Sanitizer, and it's web page can be found here:

http://www.impsec.org/email-tools/pr...-security.html

There is also a procmail email list that was very helpful to me when I was putting my proc stuff together, it can be found here:

http://www.procmail.org/era/lists.html

Also, at the link above, is SmartList, which may be of interest as well.

Sorry that I don't have a quick answer for you! Please let me know what you find out and how it is that you implement your rc script.

plan9
 
  


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
Help Strip / Remove attachments (Replace with TXT file if Possible) Vince0000 Linux - General 2 09-17-2010 06:46 PM
Problem with mail delivery procmail>cyrus imap (using sendmail,procmail,cyrus,imap) bwana Linux - Software 2 03-24-2005 07:01 PM
Sendmail and attachments Satriani Linux - Software 2 04-27-2003 12:09 PM
Mail and attachments wvrhlu Linux - Software 2 04-02-2003 10:06 AM
Procmail & mail attachments PcHammer Linux - Software 1 02-05-2003 08:31 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Security

All times are GMT -5. The time now is 05:56 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