Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw

Re: Manipulating mail parts from Sendmail's queue

by rob_au (Abbot)
on Jun 28, 2005 at 10:43 UTC ( #470569=note: print w/replies, xml ) Need Help??

in reply to Manipulating mail parts from Sendmail's queue

I have done a lot of work with Sendmail and message manipulation in the past and as such suggest that there is a better way to achieve your goal of embedding an image at the top and bottom of the email than directly manipulating the Sendmail mail queue - Indeed, depending upon the processing rules associated with the embedding of images into emails, directly manipulating message queue files may not even provide a practical or complete solution.

So how do I recommend you manipulate the messages in Sendmail? Use the Milter interface provided by Sendmail. Sendmail's Content Management API (milter) provides third-party programs to access mail messages as they are being processed by the Mail Transfer Agent (MTA), allowing them to examine and modify message content and meta-information. Filtering policies implemented by Milter-conformant filters may then be centrally configured and composed in an end-user's MTA configuration file. Uses for filters include spam rejection, virus filtering, and content control.

Using this interface, you could update the content of mail messages as they pass through the SMTP interface of Sendmail , before they are injected into the mail spool. This approach side-steps any race issues which you are likely to encounter with direct manipulation of files in the mail queue.

Further information on the milter interface can be found in the Sendmail distribution and at the Milter community website - It is also worth noting that there are two Perl interfaces to the milter interface, Sendmail::Milter and Sendmail::PMilter, the latter of the two being that which I would recommend for usage (due to its more robust performance and better support).


perl -le "print unpack'N', pack'B32', '00000000000000000000001000000000'"

  • Comment on Re: Manipulating mail parts from Sendmail's queue

Log In?

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://470569]
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (6)
As of 2022-05-16 09:53 GMT
Find Nodes?
    Voting Booth?
    Do you prefer to work remotely?

    Results (62 votes). Check out past polls.