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 |
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). |
All times are GMT -5. The time now is 10:40 AM. |