amavisd-new custom hook to modify email - add content to beginning and end of emails
Budget: $30 – $250 USD
Using the latest version of amavisd-new (https://www.ijs.si/software/amavisd/), I need a simple custom hook created that allows me to add content to the start and/or end of every email that passes through the system.
Amavisd-new custom hooks are implemented in perl, and it appears a "before_send" hook is the appropriate place to implement this code. The "amavisd-custom.conf" example in the amavisd-new code demonstrates how these custom hooks work.
This hook needs to:
1. Prepend some content to the beginning of every email.
2. Add some content to the end of every email.
This must work with both the plain text and HTML portions of an email and support both single and multipart MIME encoded emails.
When modifying the plain text portion of the email, the content added would simply be offset by a string delimiter like "\n---------------\n". When modifying the HTML portion of an email, the new content would be included in a separate div, basically styled to set it apart from the rest of the message.
It must also support scenarios where the body content has been base64 encoded. I've seen this with certain paypal emails, for example, that contain a base64-encoded bit of HTML.
I will provide approximately 10 sample emails that should be tested for compatibility.
The code will need to properly parse out the various MIME boundaries and modify any plain text portions, and parse out any HTML code to properly add the prepended content after any "<body>" tag, and the signature before the closing "</body>" tag, so some basic HTML parsing may be required.
You may want to use a cpan module like MIME::Signature or the like to assist.
Deliverable is a file containing a self-contained custom hook that can be added to a generic amavisd-new configuration. The content of the content to be prepended to the email and the content to be appended to the email can be described statically in the file - no outside data lookups necessary. It has to pass a general test by properly modifying emails sent from major email provders (public ones like gmail, outlook, etc) and typical email clients (iphone and android mail, desktop apps like apple Mail.app and Outlook).
Amavisd-new custom hooks are implemented in perl, and it appears a "before_send" hook is the appropriate place to implement this code. The "amavisd-custom.conf" example in the amavisd-new code demonstrates how these custom hooks work.
This hook needs to:
1. Prepend some content to the beginning of every email.
2. Add some content to the end of every email.
This must work with both the plain text and HTML portions of an email and support both single and multipart MIME encoded emails.
When modifying the plain text portion of the email, the content added would simply be offset by a string delimiter like "\n---------------\n". When modifying the HTML portion of an email, the new content would be included in a separate div, basically styled to set it apart from the rest of the message.
It must also support scenarios where the body content has been base64 encoded. I've seen this with certain paypal emails, for example, that contain a base64-encoded bit of HTML.
I will provide approximately 10 sample emails that should be tested for compatibility.
The code will need to properly parse out the various MIME boundaries and modify any plain text portions, and parse out any HTML code to properly add the prepended content after any "<body>" tag, and the signature before the closing "</body>" tag, so some basic HTML parsing may be required.
You may want to use a cpan module like MIME::Signature or the like to assist.
Deliverable is a file containing a self-contained custom hook that can be added to a generic amavisd-new configuration. The content of the content to be prepended to the email and the content to be appended to the email can be described statically in the file - no outside data lookups necessary. It has to pass a general test by properly modifying emails sent from major email provders (public ones like gmail, outlook, etc) and typical email clients (iphone and android mail, desktop apps like apple Mail.app and Outlook).