I finally got it working with 6.0.5. The procedure is a mix of what is stated in the release notes and hacking.
The first part is to define the message in LDAP with the commands of your post (zmprov mcf ...). The variables exist for each domain, but they are not used yet.
Then you have to edit /opt/zimbra/conf/amavisd.conf.in and customize the message files per domain in the section:
Code:
@disclaimer_options_bysender_maps = (
{ '.' => 'global-default' },
); Here you can use a different file name for each domain, for instance:
Code:
@disclaimer_options_bysender_maps = (
{ '.foo.com' => 'foo' },
{ '.whatever.org' => 'whatever'},
{ '.' => 'global-default' },
); The "global-default" files should be generated automatically by zmamavisdctl upon startup, but they are not. I did it manually with:
Code:
su - zimbra
/opt/zimbra/libexec/zmaltermimeconfig
This generates the 'global-default' files in /opt/zimbra/data/altermime. I guess the same script will generate per-domain files in the future, but not just now. But you can of course generate the files manually and name them according to the map.
Then the tricky thing is that the disclaimer is added to all e-mails generated by your users, even internal e-mails. This is related to the way Zimbra connects Postcript and Amavis. Looking at amavisd code I found a way around by adding 3 lines to amavisd:
Code:
--- amavisd 2010-03-06 19:43:45.000000000 +0100
+++ amavisd.disc 2010-03-06 19:43:22.000000000 +0100
@@ -11085,7 +11085,9 @@
@rfc2822_from, $rfc2822_sender, $sender)) {
$to_be_mangled = 0; # not for foreign 'Sender:' or 'From:'
do_log(5,"will not add disclaimer, originator not local");
- }
+ } else {
+ $to_be_mangled = 0 if $r->recip_is_local;
+ }
}
} else { # defanging (not disclaiming)
# defanging and other mail mangling/munging only applies to Basically, if the recipient is local no disclaimer is added.
That's all!