Adding a disclaimer per domain Zimbra 8

Discuss your pilot or production implementation with other Zimbra admins or our engineers.
yasanthau
Advanced member
Advanced member
Posts: 57
Joined: Sat Sep 13, 2014 12:52 am

Adding a disclaimer per domain Zimbra 8

Postby yasanthau » Tue Jan 28, 2014 2:14 am

Is it the same method that we have to follow when adding a disclaimer per domain on Zimbra 8 OS edition?
Adding a disclaimer (altermime) or footer - Zimbra :: Wiki
Or else is there any other easy way of doing that.
Thanks.


yasanthau
Advanced member
Advanced member
Posts: 57
Joined: Sat Sep 13, 2014 12:52 am

Adding a disclaimer per domain Zimbra 8

Postby yasanthau » Tue Jan 28, 2014 10:41 pm

With the following two steps, it is possible to add a global disclaimer to Zimbra 8 as well. But there is no way of adding separate disclaimers for separate domains. Is there any body who set up different disclaimers for different domains. I saw in a bug report that this feature will be available in ZCS9. (https://bugzilla.zimbra.com/show_bug.cgi?id=41872). When we will be able to try ZCS9?
1. To create a system wide mandatory signature, enter the following
zmprov mcf zimbraDomainMandatoryMailSignatureEnabled TRUE

zmprov mcf zimbraDomainMandatoryMailSignatureText

zmprov mcf zimbraDomainMandatoryMailSignatureHTML "some html text”
2. Restart Amavis to apply the configuration and global signature files. Type:
/opt/zimbra/bin/zmamavisdctl restart
Cap-Kirk
Posts: 8
Joined: Sat Sep 13, 2014 1:00 am

Adding a disclaimer per domain Zimbra 8

Postby Cap-Kirk » Mon Mar 17, 2014 11:46 am

Using the profanityfilter from http://www.bishopbarrington.net/wiki/howto/zimbracontentfilter" one can add a domain signature to all email per domain.

In the profanity script after checking for profanity section and before "$SENDMAIL "$@"
******

SIGDOM=$(/bin/grep "$MAILADMIN" /opt/signatures/signature-domains.txt)

#Check for marker added to every signature so that it can be checked to see if it exists before adding signature.

PRESENT=$(grep "5XFYSgcMXaNztpyeTSLz9y3m" in.$$)

HTML=$(grep "Content-Type: text/html" in.$$) #checking if email is HTML

#If "not external" AND "email exists (profanity not removed it)" AND "have signature file" AND "no signature" AND "is html"

if [ "$EXTERNAL" = "n" ] && [ -f in.$$ ] && [ -n "$SIGDOM" ] && [ -z "$PRESENT" ] && [ -n "$HTML" ]

then # met all those conditions then add signature

SIGLINEHTML=$(/bin/grep -n "" in.$$ | tail -1 | cut -f1 -d: ) #find pattern last line number

echo ${SIGLINEHTML} >/tmp/sig.txt #check line number

/bin/sed -i "${SIGLINEHTML}s//`cat /opt/signatures/${MAILADMIN}.html`/" in.$$ #add signature HTML1

cat in.$$ >/tmp/html.html #checking output of modified email

fi

*******

mkdir /opt/signatures

chown -R zimbra:zimbra /opt/signatures

List the domains that have signatures here or wherever you choose:

/opt/signatures/signature-domains.txt
I did both text and html signatures but chose to go with HTML email signature to reduce system usage. Of course users have to choose compose in HTML.
Testing: Remove after suitable testing.

echo ${SIGLINEHTML} >/tmp/sig.txt #check line number

cat in.$$ >/tmp/html.html #checking output of modified email
The domain signature is not visible when an email is composed, but dispalys in the recipient’s email mesage.
Domain Signature file:

Create signatures with the domain-name.html similar to below in /opt/signatures/

${MAILADMIN}.html




DOMAIN SIGNATURE
Cap-Kirk
Starfleet Headquarters
San Francisco
California
Earth
Milky Way


5XFYSgcMXaNztpyeTSLz9y3m
***starfleet.com Email Services provided by whatever you want here***
NOTE:

Every html signature file should have the same marker, that is how an email is checked to see if it already has a signature. Example some random password generated from a password generator:

5XFYSgcMXaNztpyeTSLz9y3m


Try at your own risk. Please let me know the results of your testing.

I have tested on my dev server but has not placed in production yet. Hoping to test two domains next month after getting permission from my manager.
Update 5th June 2014.

We have introduced this for one of our domains on the 29th May 2014 . It is working fine without any stress on the server.

Had to make a few changes.
After intro to production with proper DNS, discovered tag leaves artefact in external mail. Remove tag and use something else.
${MAILADMIN}.html

Change




DOMAIN SIGNATURE
Cap-Kirk
Starfleet Headquarters
San Francisco
California
Earth
Milky Way


5XFYSgcMXaNztpyeTSLz9y3m
***starfleet.com Email Services provided by whatever you want here***
To



DOMAIN SIGNATURE
Cap-Kirk
Starfleet Headquarters
San Francisco
California
Earth
Milky Way


***starfleet.com Email Services provided by whatever you want here***


Change:

PRESENT=$(grep "5XFYSgcMXaNztpyeTSLz9y3m" in.$$)
To
PRESENT=$(/bin/grep "$MAILADMIN Email Services provided by whatever you want here" in.$$)
Works without any problems so far. To add another email just update

1) /opt/signatures/signature-domains.txt

2) Add HTML file for new domain in /opt/signatures/ named domainname.html
Cap-Kirk
Posts: 8
Joined: Sat Sep 13, 2014 1:00 am

Adding a disclaimer per domain Zimbra 8

Postby Cap-Kirk » Mon Jul 07, 2014 5:46 am

No comments? No one has used this? Did I waste my time and effort?
dik23
Outstanding Member
Outstanding Member
Posts: 264
Joined: Sat Sep 13, 2014 1:44 am

Adding a disclaimer per domain Zimbra 8

Postby dik23 » Wed Jul 09, 2014 3:27 am

I'm sure you didn't waste your effort, I'm sure your Zimbra now adds a domain signature to all email per domain.
And it was good of you to post your solution here. Personally I've chosen to take a different path.
As zimbra :
zmprov mcf zimbraDomainMandatoryMailSignatureEnabled TRUE

Patch amavisd as described here
Replace
altermime with a script that points to the re-named altermime-bin as described here
Make sure I've added both mydomain.txt and mydomain.html files to /opt/zimbra/data/altermime
Edit /opt/zimbra/conf/amavisd.conf.in :
@disclaimer_options_bysender_maps = (

{ '.mydomain.com' => 'mydomain' }, <<<<<<<<<<<<<<<<
{ '.' => 'global-default' },

);

Then restart zimbra
zmcontrol restart

Once it's working I backup the changed files, as root :
cd /

tar -pcvzf changed-files.tar.gz /opt/zimbra/data/altermime/* /opt/zimbra/..... /opt/zimbra/......

Then after an update resets everything I simply unpack as root :
cd / 

tar -pxvzf changed-files.tar.gz

And I'm ready to go again.
It took me a while to get to this result but now I've got it working it's only a couple of minutes to help others. In Zimbra 8.5 this should be included.
Cap-Kirk
Posts: 8
Joined: Sat Sep 13, 2014 1:00 am

Adding a disclaimer per domain Zimbra 8

Postby Cap-Kirk » Thu Jul 10, 2014 7:34 am

Thanks for the pat on the back.
It's good to know there are multiple solutions to the same problem.
Why has it taken Zimbra so long to make this a standard feature?
My company were already using the profanity filter because our customers are schools. Rather than adding something else to eat more resources I used what was available.
In our setup there is no restart when adding a new signature. A restart wasn't even required to set it up either.
When we upgrade we have to setup the profanity filter in postfix master.cf.in and main.cf anyway, so really there is no extra work for the domain signature.
Lets' hope the other zimbra Administrators make usage of our ideas.
dik23
Outstanding Member
Outstanding Member
Posts: 264
Joined: Sat Sep 13, 2014 1:44 am

Adding a disclaimer per domain Zimbra 8

Postby dik23 » Fri Jul 11, 2014 4:56 am

[quote user="Cap-Kirk"]

Why has it taken Zimbra so long to make this a standard feature?

[/QUOTE]
Please see here
A
disclaimer is a legal requirement in the EU, a region with a mere 500 million people. Not being able to implement per domain makes Zimbra useless for hosting companies.
To put this into context the US has a population of 300 million
Cap-Kirk
Posts: 8
Joined: Sat Sep 13, 2014 1:00 am

Adding a disclaimer per domain Zimbra 8

Postby Cap-Kirk » Mon Jul 14, 2014 10:37 am

A mere 500 million and expanding Eastward. ;)
Saaidi
Posts: 30
Joined: Fri Sep 12, 2014 11:54 pm

Adding a disclaimer per domain Zimbra 8

Postby Saaidi » Wed Aug 27, 2014 12:18 am

i cannot alter this --> zimbraDomainMandatoryMailSignatureEnabled: FALSE to TRUE..
im using 8.0.7_GA_6021 NE..
everytime i change the value to TRUE and restart amavis, the value will go back to FALSE..
phoenix
Ambassador
Ambassador
Posts: 26347
Joined: Fri Sep 12, 2014 9:56 pm
Location: Liverpool, England

Adding a disclaimer per domain Zimbra 8

Postby phoenix » Wed Aug 27, 2014 12:54 am

[quote user="Saaidi"]im using 8.0.7_GA_6021 NE..[/quote]Why don't you upgrade to ZCS 8.5.0, it has the feature you're looking for. ;)
Regards

Bill

Rspamd: A high performance spamassassin replacement

If you'd like to see this implemented in a future version of ZCS then please vote on Bugzilla entries 97706 & 108168

Return to “Administrators”

Who is online

Users browsing this forum: No registered users and 8 guests