1

Topic: Disclaimer not working with SMTP

Hi
Disclaimer via roundcube webmail all working great however when i send email from an SMTP connection using gmail/thunderbird etc, the disclaimer never appears

i have followed the doc at http://iredmail.org/faq.html and indeed uncommented the line in 50-user file

$defang_maps_by_ccat{+CC_CATCHALL} = [ 'disclaimer' ];
as well as add my domain in the local_domain_maps line
as well as configure the disclaimer_options_bysender_maps section for both per domain and sub-domain

restarted amavis process
but still no disclaimer from thunderbird/gmail

i see this is a known/common issue?

----

Spider Email Archiver: On-Premises, lightweight email archiving software developed by iRedMail team. Supports Amazon S3 compatible storage and custom branding.

2

Re: Disclaimer not working with SMTP

Could you please try to enable debug mode of Amavisd in 50-user:

$log_level = 5;
$sa_debug = 1;

Restart amavisd and monitor log in /var/log/mail.log.

3

Re: Disclaimer not working with SMTP

thanks
i have done that and i assume these are the bits you are looking for?

Aug 13 14:04:45 yyy amavis[17224]: (17224-02) lookup: (scalar) matches, result="disclaimer"
Aug 13 14:04:45 yyy amavis[17224]: (17224-02) lookup [Mangling1] => true,  "xxx@iredmail.org" matches, result="disclaimer", matching_key="(constant:disclaimer)"
Aug 13 14:04:45 yyy amavis[17224]: (17224-02) mangling NO: 0 (orig: disclaimer), discl_allowed=0, <xxx@iredmail.org> -> <xxx@iredmail.org>
Aug 13 14:04:45 yyy amavis[17224]: (17224-02) final_destiny PASS, recip xxx@iredmail.org
Aug 13 14:04:45 yyy amavis[17224]: (17224-02) do_notify_and_quar: ccat=Clean (1,0) ("1":Clean, "0":CatchAll) ccat_block=(), qar_mth=
Aug 13 14:04:45 yyy amavis[17224]: (17224-02) skip admin notification, no administrators
Aug 13 14:04:45 yyy amavis[17224]: (17224-02) do_notify_and_quarantine - done

4

Re: Disclaimer not working with SMTP

Can you please post disclaimer related settings which defined in 50-user?

5

Re: Disclaimer not working with SMTP

sure

# ------------ Disclaimer Setting ---------------
# Uncomment this line to enable singing disclaimer in outgoing mails.
$defang_maps_by_ccat{+CC_CATCHALL} = [ 'disclaimer' ];

# Program used to signing disclaimer in outgoing mails.
$altermime = '/usr/bin/altermime';

# Disclaimer in plain text formart.
@altermime_args_disclaimer = qw(--disclaimer=/etc/postfix/disclaimer/_OPTION_.txt);

@disclaimer_options_bysender_maps = ({
    # Per-domain disclaimer setting: /etc/postfix/disclaimer/host1.iredmail.org.txt
    #'host1.iredmail.org' => 'host1.iredmail.org',

    # Sub-domain disclaimer setting: /etc/postfix/disclaimer/iredmail.org.txt
    #'.iredmail.org'      => 'iredmail.org',

    # Per-user disclaimer setting: /etc/postfix/disclaimer/boss.iredmail.org.txt
    #'boss@iredmail.org'  => 'boss.iredmail.org',

    # Catch-all disclaimer setting: /etc/postfix/disclaimer/default.txt
    '.' => 'default',
},);
# ------------ End Disclaimer Setting ---------------


And the /etc/postfix/disclaimer/default.txt does exist

6

Re: Disclaimer not working with SMTP

Any updates for this? Having the same problem here (CentOS 5). My configs all match, disclaimer does work through roundcube, but not through email programs (Outlook - neither IMAP nor SMTP).

thanks.

7

Re: Disclaimer not working with SMTP

UPDATE:

I was able to get it working (sort of). In order to get amavisd to append the disclaimer to emails sent via outlook, I needed to add the ip address of where the email client resides to @mynetworks.

@mynetworks = qw( 127.0.0.0/8 [::1] [FE80::]/10 [FEC0::]/10
                  10.0.0.0/8 172.16.0.0/12 192.168.0.0/16 my.ip.add.ress );

This, however, doesn't seem like a great solution to the problem. I don't know if this is an issue with amavisd, altermime, or what, but it seems like there must be a better way. With this approach, obviously users at other locations, or on mobile devices will be excluded from the disclaimer being appended.

8

Re: Disclaimer not working with SMTP

Did you also append your domain name in amavisd setting "@local_domains_maps"?
Refer to the FAQ page: http://www.iredmail.org/forum/topic210- … mails.html

9

Re: Disclaimer not working with SMTP

ZhangHuangbin wrote:

Did you also append your domain name in amavisd setting "@local_domains_maps"?
Refer to the FAQ page: http://www.iredmail.org/forum/topic210- … mails.html

Thanks for the reply.

I did add the relevant domain names to @local_domains_maps. Everything in my configuration is exactly as instructed in your FAQ.

It seems like for some reason amavisd  is relying on the originating IP address of the email (which explains why it works with RoundCube) to determine whether or not to allow appending the disclaimer. Is there a proper solution for this? The modification of @mynetworks seems like a bad hack to me.

10

Re: Disclaimer not working with SMTP

i am still seeing the same issue - i shall try the mynetworks hack as well but i agree this is a bad hack... sad

11

Re: Disclaimer not working with SMTP

i have same problem use
@altermime_args_disclaimer = qw(--disclaimer=/etc/postfix/disclaimer/_OPTION_.txt --disclaimer-html=/etc/postfix/disclaimer/_OPTION_.txt --force-for-bad-html);

12

Re: Disclaimer not working with SMTP

write4saini wrote:

i have same problem use
@altermime_args_disclaimer = qw(--disclaimer=/etc/postfix/disclaimer/_OPTION_.txt --disclaimer-html=/etc/postfix/disclaimer/_OPTION_.txt --force-for-bad-html);

Please turn on debug mode in amavisd, and monitor /var/log/maillog to check why it happened.

13

Re: Disclaimer not working with SMTP

ZhangHuangbin wrote:
write4saini wrote:

i have same problem use
@altermime_args_disclaimer = qw(--disclaimer=/etc/postfix/disclaimer/_OPTION_.txt --disclaimer-html=/etc/postfix/disclaimer/_OPTION_.txt --force-for-bad-html);

Please turn on debug mode in amavisd, and monitor /var/log/maillog to check why it happened.

==== Provide basic information to help troubleshoot ====
- iRedMail version:
- Linux/BSD distribution name and version:
- Any related log? Log is helpful for troubleshooting.
====

I am wondering if there was ever any update on this? I am having the same problems and think that it may be related to this quote from http://www.3open.org/d/tips/setup_email … mavisd-new

"  For the moment there is one limitation: there can only be one mangler
  in effect at a time, it is not currently possible to both defang and to
  append a disclaimer on the same message: for internal-to-internal mail
  inserting a disclaimer takes precedence."

Ie.. when a mail comes in it would be going through all the checks (because it is not in the trusted networks) so the mangler is waiting to act on it instead of allowing it to append the disclaimer to mail. And though I am unsure how to do it I think that somehow there would be a way to set security to not just mynewtorks but also to sasl authenticated? Does anyone know if this would fix it? and if so how to configure amavis-new to allow it?

14

Re: Disclaimer not working with SMTP

tsradmin19 wrote:

there would be a way to set security to not just mynewtorks but also to sasl authenticated?

Which version of iRedMail do you have?
In later versions, we have below settings in Amavisd by default:

$policy_bank['MYUSERS']= {...};

This policy bank includes mynetworks and SASL authenticated users.

15

Re: Disclaimer not working with SMTP

ZhangHuangbin wrote:
tsradmin19 wrote:

there would be a way to set security to not just mynewtorks but also to sasl authenticated?

Which version of iRedMail do you have?
In later versions, we have below settings in Amavisd by default:

$policy_bank['MYUSERS']= {...};

This policy bank includes mynetworks and SASL authenticated users.

==== Provide basic information to help troubleshoot ====
- iRedMail version:
- Linux/BSD distribution name and version:
- Any related log? Log is helpful for troubleshooting.
====

ZhangHuangbin,
     Thank you for the quick reply, I am running version 0.6.1 so I am guessing that I must be prior to when that directive was included in the amavisd.conf, I was actally looking for something similar to this when I found it wasn't working but did not find it.
     Do you happen to know if it is possible to add this in to earlier versions? I think I am going to try if no one knows it not to work.
    Thank you again! iRedMail is a very good solution!!

16

Re: Disclaimer not working with SMTP

You can add below code of policy_bank['MYUSERS'] in amavisd.conf manually:

# Apply to mails which coming from internal networks or authenticated
# roaming users.
# mail supposedly originating from our users
$policy_bank{'MYUSERS'} = {
    # declare that mail was submitted by our smtp client
    originating => 1,

    # enables disclaimer insertion if available
    allow_disclaimers => 1,

    # notify administrator of locally originating malware
    virus_admin_maps => ["root\@$mydomain"],
    spam_admin_maps  => ["root\@$mydomain"],
    warnbadhsender   => 0,
    warnvirussender  => 1,
    warnspamsender   => 1,

    # forward to a smtpd service providing DKIM signing service
    #forward_method => 'smtp:[127.0.0.1]:10027',

    # force MTA conversion to 7-bit (e.g. before DKIM signing)
    smtpd_discard_ehlo_keywords => ['8BITMIME'],

    # don't remove NOTIFY=SUCCESS option
    terminate_dsn_on_notify_success => 0,

    # don't perform spam/virus/header check.
    #bypass_spam_checks_maps => [1],
    #bypass_virus_checks_maps => [1],
    #bypass_header_checks_maps => [1],

    # allow sending any file names and types
    bypass_banned_checks_maps => [1],
};

17

Re: Disclaimer not working with SMTP

ZhangHuangbin wrote:

You can add below code of policy_bank['MYUSERS'] in amavisd.conf manually:

# Apply to mails which coming from internal networks or authenticated
# roaming users.
# mail supposedly originating from our users
$policy_bank{'MYUSERS'} = {
    # declare that mail was submitted by our smtp client
    originating => 1,

    # enables disclaimer insertion if available
    allow_disclaimers => 1,

    # notify administrator of locally originating malware
    virus_admin_maps => ["root\@$mydomain"],
    spam_admin_maps  => ["root\@$mydomain"],
    warnbadhsender   => 0,
    warnvirussender  => 1,
    warnspamsender   => 1,

    # forward to a smtpd service providing DKIM signing service
    #forward_method => 'smtp:[127.0.0.1]:10027',

    # force MTA conversion to 7-bit (e.g. before DKIM signing)
    smtpd_discard_ehlo_keywords => ['8BITMIME'],

    # don't remove NOTIFY=SUCCESS option
    terminate_dsn_on_notify_success => 0,

    # don't perform spam/virus/header check.
    #bypass_spam_checks_maps => [1],
    #bypass_virus_checks_maps => [1],
    #bypass_header_checks_maps => [1],

    # allow sending any file names and types
    bypass_banned_checks_maps => [1],
};

==== Provide basic information to help troubleshoot ====
- iRedMail version:
- Linux/BSD distribution name and version:
- Any related log? Log is helpful for troubleshooting.
====
Thank you ZhangHuangbin,
     I did as you mentioned and it works perfectly now! Thank you so much for the help! I love iRedMail it is an awesome product!!!

18

Re: Disclaimer not working with SMTP

==== Provide basic information to help troubleshoot ====
- iRedMail version: *How can I check this?*
- Linux/BSD distribution name and version: CentOS release 5.5
- Any related log? Log is helpful for troubleshooting.
====

Hello all, I am having a similar issue. I followed the FAQ and setup the Disclaimer. Below is my amavisd.conf output for the Disclaimer:

# ------------ Disclaimer Setting ---------------
# Uncomment this line to enable singing disclaimer in outgoing mails.
@local_domains_maps = ['ajmatson.com',];
$defang_maps_by_ccat{+CC_CATCHALL} = [ 'disclaimer' ];

# Program used to signing disclaimer in outgoing mails.
$altermime = '/usr/bin/altermime';

# Disclaimer in plain text formart.
@altermime_args_disclaimer = qw(--disclaimer=/etc/postfix/disclaimer/_OPTION_.txt);

@disclaimer_options_bysender_maps = ({
    # Per-domain disclaimer setting: /etc/postfix/disclaimer/host1.iredmail.org.txt
    #'host1.iredmail.org' => 'host1.iredmail.org',

    # Sub-domain disclaimer setting: /etc/postfix/disclaimer/iredmail.org.txt
    #'.iredmail.org'      => 'iredmail.org',

    # Per-user disclaimer setting: /etc/postfix/disclaimer/boss.iredmail.org.txt
    #'boss@iredmail.org'  => 'boss.iredmail.org',

    # Catch-all disclaimer setting: /etc/postfix/disclaimer/default.txt
    '.' => 'default',
},);
# ------------ End Disclaimer Setting ---------------

In the email I cannot see the disclaimer at the bottom of the message, but if I look at the headers it is there. I have tried several recipient accounts with different mail clients and none of them show up.

MIME-Version: 1.0
Date: Wed, 02 May 2012 15:10:41 -0700
From: <ajmatson(at)ajmatson.com>
To: <ajmatson@gmail.com>
Subject: Test Disclaimer 4
Message-ID: <f46d2fbb81d842a54262fc098c7eb00c@127.0.0.1>
X-Sender: ajmatson(at)ajmatson.com
User-Agent: RoundCube WebMail
Content-Type: multipart/alternative;
    boundary="=_88b4b4628468328af71721b1132f622f"

--=_88b4b4628468328af71721b1132f622f
Content-Transfer-Encoding: 8bit
Content-Type: text/plain; charset=UTF-8



Final Test

Alan

----
This message has been scaned for spam and viruses. It has also been stripped of any sensitive data using Websense Data Loss Prevention. If you need to report this message please notify admin(at)ajmatson.com
--=_88b4b4628468328af71721b1132f622f
Content-Transfer-Encoding: quoted-printable
Content-Type: text/html; charset=UTF-8

<p>Final Test</p>
<p>Alan</p>
--=_88b4b4628468328af71721b1132f622f--

Any ideas? Regards

19

Re: Disclaimer not working with SMTP

So one little update I noticed. If I send mail from RoundCube in HTML the disclaimer is not added to the recipient. If I change and send the mail in plain text the Disclaimer is added and can be viewed by the recipient. How can I get this to show on HTML formatted mail?

20

Re: Disclaimer not working with SMTP

Try add one more option in @altermime_args_disclaimer like below:

@altermime_args_disclaimer = qw(--disclaimer=/etc/postfix/disclaimer/_OPTION_.txt --disclaimer-html=/etc/postfix/disclaimer/_OPTION_.html);

Then create /etc/postfix/disclaimer/default.html with HTML code. For example:

<p>Final Test</p>
<p>Alan</p>

Restarting Amavisd service is required.

21

Re: Disclaimer not working with SMTP

ZhangHuangbin wrote:

Try add one more option in @altermime_args_disclaimer like below:

@altermime_args_disclaimer = qw(--disclaimer=/etc/postfix/disclaimer/_OPTION_.txt --disclaimer-html=/etc/postfix/disclaimer/_OPTION_.html);

Then create /etc/postfix/disclaimer/default.html with HTML code. For example:

<p>Final Test</p>
<p>Alan</p>

Restarting Amavisd service is required.

I had config as the FAQ and this topic. iRedMail 0.9.2 using Thunderbird, enabled disclaimer with catch-all default.txt

1. If the message is digitally signed using my S/MIME cert, the disclaimer will not shown. If not digitally signed, disclaimer works.
2. If I received email from Gmail account for example, the disclaimer will show in the arriving email. Sound strange?

How do I fix that?

Thank you and best regards,

Quy

22

Re: Disclaimer not working with SMTP

quyhoang wrote:

1. If the message is digitally signed using my S/MIME cert, the disclaimer will not shown. If not digitally signed, disclaimer works.

AlterMIME program cannot decode your S/MIME email, so cannot append disclaim text.

quyhoang wrote:

2. If I received email from Gmail account for example, the disclaimer will show in the arriving email. Sound strange?

A known bug in iRedMail-0.9.2 and earlier versions. We have a fix in upcoming iRedMail-0.9.3. Here's the document if you want to take a look:
http://www.iredmail.org/docs/upgrade.ir … d-messages

WARNING: above link is DRAFT document, do not apply it right now.