LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 09-21-2004, 10:38 PM   #1
irubin
LQ Newbie
 
Registered: Dec 2003
Posts: 2

Rep: Reputation: 0
sendmail - strip attachments - is this possible


Hello,

Is it possible to strip attachments from an email (as it comes in) and store it on the server. In addition, I will need to keep a log of each file that is stripped along with an email of the original message recipient.

The user will receive the message without the attachment.

Is this possible?


Thanks.

-R
 
Old 09-22-2004, 08:23 AM   #2
rjlee
Senior Member
 
Registered: Jul 2004
Distribution: Ubuntu 7.04
Posts: 1,991

Rep: Reputation: 76
It's certainly possible.

You will need to write a filter script to process a single message read from stdin. I'd suggest writing it in Perl and using Perl's built-in MIME handling to parse the email, and strip anything that isn't text/plain or text/html. You then have the script print out whatever is to be sent to the recipient, with the appropriate headers.

You then need to tell sendmail to use this script as a filter on all incoming email addresses. I don't know how to do that off-hand but it's a fairly common feature (you can definitely do this with qmail).
 
  


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
Help Strip / Remove attachments (Replace with TXT file if Possible) Vince0000 Linux - General 2 09-17-2010 06:46 PM
strip -s blackzone Linux - Newbie 1 09-01-2004 12:08 AM
Sendmail & How to reject mail with executable attachments WorldBuilder Linux - Networking 3 02-04-2004 03:27 PM
sending attachments from sendmail in a script pr0fess0r Linux - General 2 05-20-2003 05:49 AM
Sendmail and attachments Satriani Linux - Software 2 04-27-2003 12:09 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

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