Adding html disclaimer to outgoing mail, with header and footer
Posted: Wed Jul 24, 2019 12:15 pm
Hi Everyone,
I asked this question here, https://www.reddit.com/r/Zimbra/comment ... h=66798cb5 :
I'm completely new to zimbra, but I wondering if there's a feature where you can have all outgoing emails sent through, injecting some arbitrary disclaimer/verbiage/html into the emails? I'm essentially trying to use this to add branding to all outgoing emails: write some email, hit send, rule on the server injects some html into the top of the emails and the bottom, with the content that was sent, sandwiched in between. Essentially, the way you're do it in exchange with https://docs.microsoft.com/en-us/exchan ... erver-2019
And as mentioned there, i'm trying to get this result:
And one of the replies was to "add a filter to Zimbra's Postfix instance"...could someone help me with some rudimentary steps on how to do that?
Update: I installed a docker image of Zimbra, locally via https://wiki.zimbra.com/wiki/Deploy_Zim ... ing_docker and using https://wiki.zimbra.com/wiki/New_Featur ... er_support i was able to add a footer disclaimer. So, halfway there. However, i still need the top part, and in looking at the source code of altermime (https://github.com/inflex/alterMIME/blo ... ltermime.c ) there's options for
And i tried modifying /opt/zimbra/conf/amavisd.conf to add those args, but it doesnt seem to be kicking in....does anyone know if that's the file i should be touching, to update the calls in the pipeline to altermime?
Update 2: As suggested here https://www.reddit.com/r/Zimbra/comment ... h=318fca16 i've made the following changes and it's somewhat working, minus the weird base64 side effect:
I found /opt/zimbra/conf/amavisd.conf.in and changed it to
however, funny enough, it seems to be using the base64 version of the option (_OPTION_.b64 where obviously, _OPTION_.b64 is the file named after my domain name), to inject the raw contents (base64 string) into the html version of the message....
but, with this change, calling zmamavisdctl restart actually enacts the change, and i can at least see the .b64 file's contents, in the sample emails i send out, at the top of the message. Maybe im just flapping my gums in the wind, but if nothing else, i'm hoping someone in the future can find some use in this.
Final update: SUCCESS just had to remove the --pretext-b64 argument (which i think was just there in the github link for an altermime fork, and not the actual source code)
I now get exactly what i wanted. Putting my header stuff inside /opt/zimbra/data/altermime/_OPTION_header.html where _OPTION_ is the domain name. Hope this helps someone in the future!
I asked this question here, https://www.reddit.com/r/Zimbra/comment ... h=66798cb5 :
I'm completely new to zimbra, but I wondering if there's a feature where you can have all outgoing emails sent through, injecting some arbitrary disclaimer/verbiage/html into the emails? I'm essentially trying to use this to add branding to all outgoing emails: write some email, hit send, rule on the server injects some html into the top of the emails and the bottom, with the content that was sent, sandwiched in between. Essentially, the way you're do it in exchange with https://docs.microsoft.com/en-us/exchan ... erver-2019
And as mentioned there, i'm trying to get this result:
Code: Select all
<html>
<head></head>
<body>
<h1>My static, auto injected company name </h1>
<p>{ORIGINAL_MESSAGE}</p>
<p>My company's static, auto injected signature/disclaimer</p>
</body></html>
Update: I installed a docker image of Zimbra, locally via https://wiki.zimbra.com/wiki/Deploy_Zim ... ing_docker and using https://wiki.zimbra.com/wiki/New_Featur ... er_support i was able to add a footer disclaimer. So, halfway there. However, i still need the top part, and in looking at the source code of altermime (https://github.com/inflex/alterMIME/blo ... ltermime.c ) there's options for
Code: Select all
#ifdef ALTERMIME_PRETEXT
/*" [--pretext] Insert disclaimer files in pretext mode.\n"*/ // By implication, pretext is inserted based on the file status below.
" [--pretext=<pretext file>]\n"
" [--pretext-html=<pretext HTML file>]\n"
" [--pretext-b64=<BASE64 encoded pretext >]\n"
#endif
Update 2: As suggested here https://www.reddit.com/r/Zimbra/comment ... h=318fca16 i've made the following changes and it's somewhat working, minus the weird base64 side effect:
I found /opt/zimbra/conf/amavisd.conf.in and changed it to
Code: Select all
%%uncomment VAR:zimbraDomainMandatoryMailSignatureEnabled%%@altermime_args_disclaimer = qw(--verbose --disclaimer-b64=/opt/zimbra/data/altermime/_OPTION_.b64 --disclaimer=/opt/zimbra/data/altermime/_OPTION_.txt --disclaimer-html=/opt/zimbra/data/altermime/_OPTION_.html --pretext=/opt/zimbra/data/altermime/_OPTION_.txt --pretext-html=/opt/zimbra/data/altermime/_OPTION_.html --pretext-b64=/opt/zimbra/data/altermime/_OPTION_.b64 );
however, funny enough, it seems to be using the base64 version of the option (_OPTION_.b64 where obviously, _OPTION_.b64 is the file named after my domain name), to inject the raw contents (base64 string) into the html version of the message....
but, with this change, calling zmamavisdctl restart actually enacts the change, and i can at least see the .b64 file's contents, in the sample emails i send out, at the top of the message. Maybe im just flapping my gums in the wind, but if nothing else, i'm hoping someone in the future can find some use in this.
Final update: SUCCESS just had to remove the --pretext-b64 argument (which i think was just there in the github link for an altermime fork, and not the actual source code)
Code: Select all
%%uncomment VAR:zimbraDomainMandatoryMailSignatureEnabled%%@altermime_args_disclaimer = qw(--verbose --disclaimer-b64=/opt/zimbra/data/altermime/_OPTION_.b64 --disclaimer=/opt/zimbra/data/altermime/_OPTION_.txt --disclaimer-html=/opt/zimbra/data/altermime/_OPTION_.html --pretext=/opt/zimbra/data/altermime/_OPTION_header.txt --pretext-html=/opt/zimbra/data/altermime/_OPTION_header.html );