Zimbra offers Open Source email server software and shared calendar for Linux and the Mac
Go Back   Zimbra :: Forums > Zimbra Collaboration Suite > Administrators

Welcome to the Zimbra :: Forums!
Welcome, if you would like to post a comment please register. We also encourage you to explore all things Zimbra with our team and members of the community.

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 01-14-2010, 11:38 AM
Active Member
 
Posts: 46
Default domain disclaimer for external mails only

Hi All,

I am currently on 6.0.4.

By these commands below(in release note), I found all my emails are attached with disclaimer message.

To create a system wide mandatory signature, enter the following:
zmprov mcf zimbraDomainMandatoryMailSignatureEnabled TRUE
zmprov mcf zimbraDomainMandatoryMailSignatureText <some text>
zmprov mcf zimbraDomainMandatoryMailSignatureHTML
"<html><body>some html text</body></html>"

Restart amavis to apply the configuration and write out the global signature
files used by altermime. Type:
/opt/zimbra/bin/zmamavisdctl restart

Is that possible to modify amavis or other settings to only attach disclaimer messages to external mails(not Zimbra domains) or ON/NOT ON some specific domains?

Regards,
Chadsel
Reply With Quote
  #2 (permalink)  
Old 01-14-2010, 01:41 PM
Active Member
 
Posts: 46
Default

When I checked in wiki, I found Daniel's script has this feature(outbound disclaimer only). Does Zimbra already have this feature(some settings) in version 6.0.4? Or it's a force-all?

Thanks
Chadsel

Domain Disclaimer Extension Admin UI - Zimbra :: Wiki

OPTION. To ensure disclaimer is added only to outbound mail:
192.168.0.1:smtp inet n - n - - smtpd
192.168.0.2:smtp inet n - n - - smtpd
-o content_filter=dfilt:
127.0.0.1:smtp inet n - n - - smtpd
-o content_filter=dfilt:
dfilt unix - n n - - pipe
flags=Rq user=zimbra argv=/opt/zimbra/postfix/conf/disclaimer -f ${sender} -- ${recipient}


Adding a disclaimer (altermime) or footer - Zimbra :: Wiki

9a) OPTION: To ensure that the disclaimer is added only if:
the mail body doesn't contents the disclaimer in this moment (i.e. because of Reply to the mail containing disclaimer; please note the presence of disclaimer is verified by the presence of the fourth line from the end of disclaimer.txt in the body of the mail);
the sender is from the domain defined in the DOMAIN variable (so, there are only outgoing mail affected) - remember to edit line 5 of the script!;
the recipient is NOT from the domain defined in the DOMAIN variable (so, the mails destinated to the same domain doesn't need the disclaimer).
Reply With Quote
  #3 (permalink)  
Old 03-06-2010, 10:48 AM
Project Contributor
 
Posts: 136
Default Disclaimer with 6.0.5

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!
Reply With Quote
  #4 (permalink)  
Old 03-08-2010, 09:52 AM
Active Member
 
Posts: 46
Default

Thanks man. Great work!!! I will try this tonight.
Reply With Quote
  #5 (permalink)  
Old 03-08-2010, 07:01 PM
Active Member
 
Posts: 46
Default

Can you explain a little more for "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" ? What do you refer to? I tried to zmprov for domains but doesn't success.

Thanks
Reply With Quote
  #6 (permalink)  
Old 03-18-2010, 06:43 AM
Translation Moderator
 
Posts: 64
Default Just to be sure ...

... this is ZimbraInternal stuff, right?

I have to upgrade a 3.5k user environment from 5 to 6 and am currently parallized because of the "global-disclaimer-extension" problem.

Basically, the stuff discribed in this thread is included in zimbra 6, without a gui for changing the disclaimers, etc, right?

And this will work in principle like the old "global-disclaimer-extension", right?

thx,
best
Ray
Reply With Quote
  #7 (permalink)  
Old 08-11-2010, 02:53 AM
Starter Member
 
Posts: 1
Default

Hi, Thanks for providing an easy way to add the disclaimer but I am having
a problem implementing the last part of your tutorial and would really appreciate your help.

The part that is difficult is knowing where to add this piece of code

Quote:
Originally Posted by cvidal View Post
I finally got it working with 6.0.5. The procedure is a mix of what is stated in the release notes and hacking.

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!
Reply With Quote
  #8 (permalink)  
Old 02-04-2011, 03:13 AM
Project Contributor
 
Posts: 136
Default

Quote:
Originally Posted by dasspiegel View Post
Hi, Thanks for providing an easy way to add the disclaimer but I am having
a problem implementing the last part of your tutorial and would really appreciate your help.

The part that is difficult is knowing where to add this piece of code
I'm sorry for the long delay in the answer, I have not checked the list for a while. The file to change is /opt/zimbra/amavisd/sbin/amavisd. You can apply the patch published above (patch < /whatever/patch.txt) or edit by hand around line 11085.

To define the message in ldap, just do:

Code:
zmprov mcf zimbraDomainMandatoryMailSignatureText <some text>
zmprov mcf zimbraDomainMandatoryMailSignatureHTML "<html><body>some html text</body></html>"
Carlos
Reply With Quote
  #9 (permalink)  
Old 05-02-2011, 07:32 PM
Starter Member
 
Posts: 3
Default

why amavisd.conf back to default if i run zmcontrol restart or zmamavisdctl restart ?

Thx
Reply With Quote
  #10 (permalink)  
Old 11-11-2011, 12:55 AM
Intermediate Member
 
Posts: 19
Default LDAP Informations in Signature

Hi,

is there any way to add "variables" from LDAP to thze signatures. I.e. like the Name, Email Address, PhoneNumber etc.

Here is a Exchange2010 Example:

Chris and Robin's Technology blog: Exchange 2010 Hub Transport - building an automated signature
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes


Similar Threads

Why Join?

Registering let's you ask questions, makes it easier to search, displays any files attached to posts, and notifies you about replies.

blog.zimbra.com




 

SEO by vBSEO ©2011, Crawlability, Inc.