Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical
 
PerlMonks  

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 - 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'"

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

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://470569]
help
Chatterbox?
[Sinistral]: I think that just the sight of his username now causes a downvote storm. I agree, and the gratuitous use of formatting does make reading hard. I've given him +1 on things where there seemed to be actual good advice, but I think the big
[Sinistral]: nail in coffin was the rant against a Schwarzian Transform
[stonecolddevin]: at best, from what i've seen, his knowledge is accurate up to maybe 2002. the sheer volume of words is mostly worthy of a downvote in most cases though i think
[erix]: ITYM Schwartzian Transform :P
[erix]: hey planetscape :)
[planetscape]: howdy stonecolddevin, erix
[Sinistral]: eric Aye. I thought I typed that wrong. All hail Randall! I listen to him on FLOSS Weekly
[Discipulus]: i think his vacuus, trombon like, absence of meaning, joined with a ostentatious style, after many years irritates the most
[erix]: easy to get wrong -- I guess that was sund's point, too :P
[Discipulus]: planetscape welcome back! (or is well comeback?)

How do I use this? | Other CB clients
Other Users?
Others contemplating the Monastery: (10)
As of 2017-06-22 20:56 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    How many monitors do you use while coding?















    Results (530 votes). Check out past polls.