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.

  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?

      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.


        Content-Type: multipart/alternative; boundary=”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.


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

        Test email Disclaimer.Luigi


          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 ?


    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_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. 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?


    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

          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.


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.