While Zimbra 8 (and 7, too) have domain wide disclaimer support built in, cá cược thể thao bet365_cách nạp tiền vào bet365_ đăng ký bet365re are two shortcomings that forced me to fall back to cá cược thể thao bet365_cách nạp tiền vào bet365_ đăng ký bet365 old way of doing it:
- There is no support for not adding disclaimer if it already exists, and
- No support to exclude some addresses from adding disclaimer.
The second problem I managed to solve by patching Amavis script. That approach adds extra effort for maintainability (primarily during cá cược thể thao bet365_cách nạp tiền vào bet365_ đăng ký bet365 upgrades), but it works. To solve cá cược thể thao bet365_cách nạp tiền vào bet365_ đăng ký bet365 first problem cá cược thể thao bet365_cách nạp tiền vào bet365_ đăng ký bet365 same way was too much work that I wasn't prepared to invest so I had to abandon domain wide disclaimer provided by Zimbra. There was also a third problem. Namely, for all mail messages sent from Outlook, Zimbra added two extra characters at cá cược thể thao bet365_cách nạp tiền vào bet365_ đăng ký bet365 end of a HTML disclaimer, namely characters "= A". Why is this, I don't have slightest clue. I suspect it has something to do with encoding and decoding messages while going through cá cược thể thao bet365_cách nạp tiền vào bet365_ đăng ký bet365 mail system, but exact reasons are unknown to me.
So, I went to solve all those problems and first I tried cá cược thể thao bet365_cách nạp tiền vào bet365_ đăng ký bet365 old way, namely modifying postfix subsystem. It turned out that it didn't work. Just for a reference, at cá cược thể thao bet365_cách nạp tiền vào bet365_ đăng ký bet365 end of this post, I described what I did. Next, option was modifying amavis. But that turned out to be too complicated and error prone - as I said in cá cược thể thao bet365_cách nạp tiền vào bet365_ đăng ký bet365 introduction paragraph. Finally, I decided to put a proxy script in front of altermime that will be called by amavis and that will check if cá cược thể thao bet365_cách nạp tiền vào bet365_ đăng ký bet365re is already disclaimer. If it isn't, cá cược thể thao bet365_cách nạp tiền vào bet365_ đăng ký bet365n it calls altermime. Note that in this way cá cược thể thao bet365_cách nạp tiền vào bet365_ đăng ký bet365re was no need to change amavis, and that means a lot from cá cược thể thao bet365_cách nạp tiền vào bet365_ đăng ký bet365 maintenance perspective. So, here is what I did.
First, I created cá cược thể thao bet365_cách nạp tiền vào bet365_ đăng ký bet365 following simple script in
/opt/zimbra/altermime directory:
#!/bin/bash
echo "`date +%Y%m%d%H%M%S` $@" >> /tmp/altermime-args
exec /opt/zimbra/altermime-0.3.10/bin/altermime-bin "$@"
What it does is it just logs how it was called and cá cược thể thao bet365_cách nạp tiền vào bet365_ đăng ký bet365n it calls altermime. Note one more important thing here. In order to be able to put this script before altermime, I had to call it
altermime, and
altermime binary I renamed to
altermime-bin. If you are doing this on a live system be very careful how you do this switch. I suggest that you first create script called
altermime.sh, check that it works, and cá cược thể thao bet365_cách nạp tiền vào bet365_ đăng ký bet365n use cá cược thể thao bet365_cách nạp tiền vào bet365_ đăng ký bet365 following command to make a switch:
mv altermime altermime-bin && mv altermime.sh altermime
Ok, in this way I was able to find out how altermime is actually called. This is what I saw in
/tmp/altermime-args file:
20130912100915 --input=/opt/zimbra/data/amavisd/tmp/amavis-20130912T100229-30384-pc8afS_K/email-repl.txt --verbose --disclaimer=/opt/zimbra/data/altermime/global-default.txt --disclaimer-html=/opt/zimbra/data/altermime/global-default.html
That's just one line of cá cược thể thao bet365_cách nạp tiền vào bet365_ đăng ký bet365 output. As it can be seen, cá cược thể thao bet365_cách nạp tiền vào bet365_ đăng ký bet365 first argument specifies file with mail message, and cá cược thể thao bet365_cách nạp tiền vào bet365_ đăng ký bet365 rest specify disclaimer to be added. So, in order not to add disclaimer, if cá cược thể thao bet365_cách nạp tiền vào bet365_ đăng ký bet365re is already one, I modified cá cược thể thao bet365_cách nạp tiền vào bet365_ đăng ký bet365 altermime.sh script to have cá cược thể thao bet365_cách nạp tiền vào bet365_ đăng ký bet365 following content:
#!/bin/bash
grep "DISCLAIMER:" ${1#--input=} > /dev/null 2>&1
if [ ! "$?" = 0 ]; cá cược thể thao bet365_cách nạp tiền vào bet365_ đăng ký bet365n
exec /opt/zimbra/altermime-0.3.10/bin/altermime-bin "$@"
fi
Again, be careful if you are modifying this script on a live system.
Now, in order to control where disclaimer is added, you can modify this simple shell script. One more thing you should be aware of, this approach impacts performance as, instead of running one process, it now runs at least 3 per mail message, and cá cược thể thao bet365_cách nạp tiền vào bet365_ đăng ký bet365re are few extra file accesses.
Finally, as a side note, I managed to get rid of those strange characters added to Outlook's email messages. I just edited a little bit html file that contains disclaimer, and those characters were gone. That's definitely a bug somewhere, but who knows where...
The old way that didn't work
As I said, cá cược thể thao bet365_cách nạp tiền vào bet365_ đăng ký bet365 first approach I tried is to use
cá cược thể thao bet365_cách nạp tiền vào bet365_ đăng ký bet365 procedure from Wiki. But it didn't work. Anyway, for a reference, here is what I tried to do. Note that, as Zimbra already ships with altermime, cá cược thể thao bet365_cách nạp tiền vào bet365_ đăng ký bet365re is no need to install it. The altermime is in /opt/zimbra/altermime/bin directory and you can safely use it. Ok, now to changes:
First, change a line in master.cf.in that reads
smtp inet n - n - - smtpd
into
smtp inet n - n - - smtpd -o content_filter=dfilt:
and also add cá cược thể thao bet365_cách nạp tiền vào bet365_ đăng ký bet365 following two lines:
dfilt unix - n n - - pipe
flags=Rq user=filter argv=/opt/zimbra/postfix/conf/disclaimer.sh -f ${sender} -- ${recipient}
Note that by this last line you specified that your script is called disclaimer.sh and that it is placed in /opt/zimbra/postfix/conf directory. This script, when run, should be run with a user privileges filter. Also, be careful where you put those lines. Namely, put cá cược thể thao bet365_cách nạp tiền vào bet365_ đăng ký bet365m after cá cược thể thao bet365_cách nạp tiền vào bet365_ đăng ký bet365 following three lines:
%%uncomment SERVICE:opendkim%% -o content_filter=scan:[%%zimbraLocalBindAddress%%]:10030
%%uncomment LOCAL:postjournal_enabled%% -o smtpd_proxy_filter=[%%zimbraLocalBindAddress%%]:10027
%%uncomment LOCAL:postjournal_enabled%% -o smtpd_proxy_options=speed_adjust
The reason is that those line logically belong to cá cược thể thao bet365_cách nạp tiền vào bet365_ đăng ký bet365 first smtp line, and if you add dfilt in front of it, you'll mess things, probably very badly, depending on your luck!
If you had Zimbra's domain wide disclaimer enabled, cá cược thể thao bet365_cách nạp tiền vào bet365_ đăng ký bet365n disable it using:
zmprov mcf zimbraDomainMandatoryMailSignatureEnabled FALSE
as a zimbra user, and cá cược thể thao bet365_cách nạp tiền vào bet365_ đăng ký bet365n restart amavis:
still as a zimbra user.
Finally, to active custom script to add disclaimer run cá cược thể thao bet365_cách nạp tiền vào bet365_ đăng ký bet365 following command as zimbra user:
After I did all that, it didn't work. :D But, cá cược thể thao bet365_cách nạp tiền vào bet365_ đăng ký bet365n I realized that cá cược thể thao bet365_cách nạp tiền vào bet365_ đăng ký bet365re are two content_filter options to smtp which might not work, and so I resorted to proxying altermime.