42 comments

  1. Hello Brother,
    when I try to connect using just imap protocol, I receive protocol not supported. I have no problem with imaps and pops. But with just pop or imap, zimbra is not letting me fetch the email. How to resolve this. There is a need that I want to fetch email using just pop or imap ignoring the ssl/tls part.
    Please help.
    Thanks!

  2. Hi,
    thanks for your article.
    I tried to implementit on a Zimbra Network 9.0
    And works, with the exception that in a multipart mime message add only the text part and not the html.

    Any suggestion?
    Thanks

      1. Hi Iman, my email has both (as multipart/alternative) and the disclaimer is added into the text part but the email is displayed in HTML.
        As result of corse the disclaimer is not visibile.
        Attached the source of the email body.

        Thanks
        Luigi

        Content-Type: multipart/alternative; boundary=”0000000000008d83aa05b1f6d9ae”

        –0000000000008d83aa05b1f6d9ae
        Content-Type: text/plain; charset=”UTF-8″

        CAUTION: This email originated from outside of the organization. Do not click links or open attachments unless you recognize the sender and know the content is safe.
        Test email Disclaimer.

        Luigi

        –0000000000008d83aa05b1f6d9ae
        Content-Type: text/html; charset=”UTF-8″

        Test email Disclaimer.Luigi

        –0000000000008d83aa05b1f6d9ae–

          1. Hi Iman,
            Thanks for the clarification, do you think there is any way to solve it for the email arriving from gmail or to force HTML instead of text?

  3. Dear Imanudin Assalamu Alaikum
    Thanks for your nice help. I applied this “External Email Warning Message” also working but problem is that all incoming email shows this warning message including local domain. How can I omit to show warning message when getting email from local domain …?
    What I have done wrong ?

    Regards
    Ashraf

    1. Waalaikumussalam,
      If you already enable disclaimer previously, you can disable by this command

      zmprov mcf zimbraDomainMandatoryMailSignatureEnabled FALSE
      
      1. Dear Iman
        Thanks for quick reply. I applied that command but still same. Please check below line is it ok or not…

        use strict;

        $altermime=’/opt/zimbra/common/bin/altermime’;
        @altermime_args_disclaimer = qw(–verbose –pretext=/opt/zimbra/data/altermime/_OPTION_.txt –pretext-html=/opt/zimbra/data/altermime/_OPTION_.html –force-for-bad-html);
        $defang_maps_by_ccat{+CC_CATCHALL} = [‘disclaimer’];
        $allow_disclaimers = 1;
        @local_domains_maps = ([“.”]);
        @disclaimer_options_bysender_maps = ({
        ‘.’ => ‘external_domains’,

        },);
        1;

        1. Hi Ashraf,
          You can create empty text and html files

          touch /opt/zimbra/data/altermime/local_domains.txt
          touch /opt/zimbra/data/altermime/local_domains.html
          

          Then add local domains in disclaimer_options_bysender_maps

          @disclaimer_options_bysender_maps = ({
                  'example.com' => 'local_domains',
                  '.' => 'external_domains',
          

          Then restart Amavis

  4. Hi Iman,

    After further testing and checking looks like that the problem is that Gmail does not include the tags to the email body and so altermime does not understand where to insert the disclaimer.
    Could you think of any trick to either force altermime to insert the HTML code or to modify the email body to add the 2 missing tags?

    Thanks
    Luigi

    1. Hi Luigi,
      I’ve test in my lab. If you change –pretext and –pretext-html with –disclaimer and –disclaimer-html, altermime works properly. However, altermime will put at the bottom of the message, not at the top of the message

      1. Hi Iman,
        Thanks again, this works.
        I’m checking altermime on why is doing that. I will let you know if I can find a solution.

        Thanks again.

        1. Hi Iman,
          I found this in the changelog of alterMIME, explain the problem, but does not bring us close to the solution.
          05 May 2010:
          PLD-DEV: Changed the way the pretext system works, now it’s the
          same as the disclaimer system of specifying files
          –pretext=
          –pretext-html=
          –pretext-b64=

          If you have BOTH pretext and disclaimer files specified then
          alterMIME will now insert both in the single run.

          PLEASE NOTE – due to the streaming requirements the PRETEXT
          HTML insertion routine -depends- on there being a BODY tag
          present else the insertion will not occur.

  5. Hi Iman,
    I found that the problem is not only related to gmail (which does not insert into the email the and tags) but to any email client which will be using a body tag with additional parameters and moving the closing > into next line).
    The problem is due to the streaming approach of altermime reading the email line by line so if a tag is split in 2 lines altermime sees the beginning but will not find the ending of the tag and decide there is no tag and will not insert the disclaimer.
    Here an extract of an email created by Outlook,:
    <p =
    as you can see the tag body begin on one line but ends in the next line.

    So the solution is to either modify altermime to support tags across lines or to use some other tool to fix the HTML in the email.

    Thanks
    Luigi

          1. Hi Iman bro,

            Thanks for your immediate reply, i did not enabled disclaimer in my zimbra server.. i used your configuration only .. but non gmail domains email header looks like this it included 2 times.. i dont know where to check.

            testetst

            ———————————————————————————————————————————————————————–
            # CAUTION: This email originated from outside of the organization. Do not click links or open attachments unless you recognize the sender and know the content is safe. #
            ———————————————————————————————————————————————————————–
            –=_574ea0e3-95ae-4ba5-adc6-41d08a936039
            Content-Type: text/html; charset=utf-8
            Content-Transfer-Encoding: 7bit

            testetst

            CAUTION: This email originated from outside of the organization. Do not click links or open attachments unless you recognize the sender and know the content is safe.

            CAUTION: This email originated from outside of the organization. Do not click links or open attachments unless you recognize the sender and know the content is safe.

            –=_574ea0e3-95ae-4ba5-adc6-41d08a936039–

  6. Hi Eman,
    Good day,

    When I configure this, this is not working my zimbra version is 8.7.11_GA_3865.NETWORK.
    can you help me with this, please?

    By the way, I have a default disclaimer. when I configure this my default disclaimer also not working

    Thank you

    Thank you.

  7. Hi Iman,

    Is any option to add any tag like [External] in subject for only all external emails..

    I have tried the postfix_header_check rule but it add double exteranal tags for all external mails.. can you give some solution…

    This below rule i added

    cat /opt/zimbra/conf/custom_header_checks
    #/^Subject:(.*)/ REPLACE Subject: [EXTERNAL]

    if /^Subject:/
    # Subject checks go here
    /:(.*)/ REPLACE Subject:[EXTERNAL]$1
    /^/ OK
    endif

  8. Hi,

    Thanks for this article. Can you share how to add in the subject line as External for all incoming messages which are originated from outside domain.

  9. Hello Mr. Iman,

    thank you for your article,
    i try the script in zimbra version Release 8.6.0_GA_but the script is not working when i send the email from another organization, but i try in zimbra version Release 8.7.11_GA is working.

    please advice.
    thank you

    1. It works on Zimbra 8.6
      You just need to change
      /opt/zimbra/common/bin/altermime
      to
      /opt/zimbra/altermime/bin/altermime

  10. Hi,
    I am already using –disclaimer to placed at the bottom, this script breaks everything, how can be used together?

    thanks

  11. Hi Friend,
    I have tried this on ZCS 8.8.8, But Warning adds on both incoming and out going emails as well.
    Do you have any suggestions.

    use strict;

    $altermime=’/opt/zimbra/common/bin/altermime’;
    @altermime_args_disclaimer = qw(–verbose –pretext=/opt/zimbra/data/altermime/_OPTION_.txt –pretext-html=/opt/zimbra/data/altermime/_OPTION_.html –force-for-bad-html);
    $defang_maps_by_ccat{+CC_CATCHALL} = [‘disclaimer’];
    $allow_disclaimers = 1;
    @local_domains_maps = ([“.”]);
    @disclaimer_options_bysender_maps = ({
    ‘example.com’ => ‘local_domains’,
    ‘.’ => ‘external_domains’,

    },);

    1;

  12. Hi Imam,
    I have tried this on 8.8.15
    But the issue is if i send mail to external user, then he also get the same caution message.

  13. I don’t understand. I did everything according to the instructions! All incoming mail is not marked in any way, and everything that I send is marked with a warning. and if I create empty files it doesn’t work at all! Please help me!

  14. zmprov mcf zimbraDomainMandatoryMailSignatureEnabled FALSE
    send mail to my domain for other domain and dont work((((

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.