third party message delivery agent with sendmail

Jay Cantwell
Regular Advisor

third party message delivery agent with sendmail

My Oracle DBA wishes to read attachments received in sendmail programmatically. In other words when a message is

received in sendmail with attachments she would like a message delivery agent so she can used the data to feed into other programs and files. Anyone know how this can be done without her having to do a bunch of scripting?

Honored Contributor

Re: third party message delivery agent with sendmail

"procmail" is an old regexp-based utility for processing emails automatically. It can be used to detect attachments in incoming emails and pass them to some script or command for further processing.


The configuration syntax of procmail is a bit gnarly (but not nearly as bad as!), but it comes with a man page full of good examples (make sure your MANPATH includes /usr/local/man, then use "man procmailex" after installing):


One of these utilities might be useful for extracting the attachments from the incoming messages:  (this one seems to be out of date)


Personally, I once did something similar with procmail + the munpack utility from the mpack kit, but I think the ripmime package might be even better.


If you cannot (or don't want to) modify the sendmail configuration, you might be able to use the .forward file to call procmail (or maybe ripmime) for the processing of incoming emails. See the NOTES section in "man procmail" for details.