Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??
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'"


In reply to Re: Manipulating mail parts from Sendmail's queue by rob_au
in thread Manipulating mail parts from Sendmail's queue by chanakya

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":



  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or How to display code and escape characters are good places to start.
Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others perusing the Monastery: (2)
As of 2024-04-19 20:27 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found