procmail
[Top] [All Lists]

Re: Stripping all atachments

2001-03-29 21:44:26

I was wondering if it is possible to use Procmail to strip all 
attachments from a mail before sending it to a printer, while 
having an intact original forwarded to another address?

:0c
| metamail  -x  2>&1 |\
 fgrep -v 'metamail: Ignoring invalid mailcap' |\
 sed '/^This message contains/,/Wrote file/d' |\ 
 lpr -h -p

(Use your own arguments to lpr as you like.  Also, remove the 'sed' 
line if you *want* to see where metamail wrote the attachments.)

NOTE: See 'man metamail' regarding the KEYIGNHEADS and KEYHEADS 
variables, as well as the METAMAIL_TMPDIR if you don't want your 
attachments written to /tmp

TjL


_______________________________________________
procmail mailing list
procmail(_at_)lists(_dot_)RWTH-Aachen(_dot_)DE
http://MailMan.RWTH-Aachen.DE/mailman/listinfo/procmail

<Prev in Thread] Current Thread [Next in Thread>