Does anyone have a script that will delete attachments in mail messages leaving only the text of the message behind?
Thanks,
Clint
Does anyone have a script that will delete attachments in mail messages leaving only the text of the message behind?
Thanks,
Clint
[This message was sent by private mail as well as posted to Usenet]
to comp.unix.shell:
> Does anyone have a script that will delete attachments in mail
> messages leaving only the text of the message behind?
This one is out of my .procmailrc; it only does a selected kill of
certain kinds of attachments, but that is probably safer than just
kill'em all. Adapt to suit your needs. (Everything up to the "|" is
Procmail-specific but from there on, it's just a shell script.)
:0fbw # f = pipe b = message body w = wait for pipe to finish
* ^Content-Type: multipart/mixed; boundary=
| (echo '\
X-Mime-Note: <<< MIME attachments removed >>>'; \
sed -e "/^Content-Type: application\//,/^\-\-/d" \
-e "/^begin 600 WINMAIL\.DAT/,/^end$/d" )
This was originally written for a very old version of Procmail and
could probably be made much neater. I haven't bothered. One thing you
might want to do is to make the resulting output MIME-compliant; this
one will leave a bit of headers behind but my main purpose was just to
get rid of the offensive bulk of the crock people think they can fill
my mailbox with.
Hope this helps,
/* era */
--
See <http://www.ling.helsinki.fi/~reriksso/> for mantra, disclaimer, etc.
* If you enjoy getting spam, I'd appreciate it if you'd register yourself
at the following URL: <http://www.ling.helsinki.fi/~reriksso/spam.html>
: > Does anyone have a script that will delete attachments in mail
: > messages leaving only the text of the message behind?
: This one is out of my .procmailrc; it only does a selected kill of
: certain kinds of attachments, but that is probably safer than just
: kill'em all. Adapt to suit your needs. (Everything up to the "|" is
: Procmail-specific but from there on, it's just a shell script.)
Ok, but how does one 're-format' an AmiPro 'attach'? Short of shooting the
sender?
--
-jim-
1. Mail Attachment for two or more attachments
Can anybody tell me how can I send a file in attachment with the command
MAILX?
I did an script with uuencode $4 $4.txt | mailx -r $1 -s $2 $3
but i want to do it for more attachments
3. Send mails/attachments using a shell script
5. Creating mail with attachments from a shell script?
7. Scripting e-mail with attachments
8. how to setup sb/cdrom/floppy at startup?
9. Saving attachment from script
10. how to send attachment via email in script?
11. Use of 'mail' in scripts, and attachments
12. send attachment from script
13. Creating Mail Attachments from Shell Script