Page 1 of 2 12 LastLast
Results 1 to 10 of 11

Thread: domain disclaimer for external mails only

  1. #1
    Join Date
    Jul 2007
    Location
    New York, NY
    Posts
    46
    Rep Power
    8

    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

  2. #2
    Join Date
    Jul 2007
    Location
    New York, NY
    Posts
    46
    Rep Power
    8

    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).

  3. #3
    Join Date
    Dec 2005
    Posts
    150
    Rep Power
    9

    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!

  4. #4
    Join Date
    Jul 2007
    Location
    New York, NY
    Posts
    46
    Rep Power
    8

    Default

    Thanks man. Great work!!! I will try this tonight.

  5. #5
    Join Date
    Jul 2007
    Location
    New York, NY
    Posts
    46
    Rep Power
    8

    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

  6. #6
    Join Date
    Aug 2009
    Location
    Palma de Mallorca, Spain
    Posts
    66
    Rep Power
    6

    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

  7. #7
    Join Date
    Aug 2010
    Posts
    1
    Rep Power
    5

    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!

  8. #8
    Join Date
    Dec 2005
    Posts
    150
    Rep Power
    9

    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

  9. #9
    Join Date
    Oct 2009
    Location
    BDG, ID
    Posts
    3
    Rep Power
    6

    Default

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

    Thx

  10. #10
    Join Date
    Nov 2005
    Posts
    19
    Rep Power
    10

    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

Similar Threads

  1. New Domain disclaimer Admin Extension
    By deugenin in forum Administrators
    Replies: 57
    Last Post: 04-06-2012, 11:45 AM
  2. Replies: 7
    Last Post: 04-27-2009, 03:49 AM
  3. Replies: 3
    Last Post: 11-12-2008, 04:26 AM
  4. Replies: 5
    Last Post: 06-18-2008, 02:50 AM
  5. Replies: 20
    Last Post: 03-18-2008, 06:37 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •