Beefy Boxes and Bandwidth Generously Provided by pair Networks
Come for the quick hacks, stay for the epiphanies.
 
PerlMonks  

Re: Manipulating mail parts from Sendmail's queue

by rob_au (Abbot)
on Jun 28, 2005 at 10:43 UTC ( [id://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 - http://www.milter.org. 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'"

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others sharing their wisdom with the Monastery: (5)
As of 2024-03-29 11:02 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found