1

Topic: Can't sending mail over 10MB mail attachment

==== Required information ====
- iRedMail version: iredmail 1.4.4 (iRedAPD 0.9.0 with iRedAdmin-Pro-LDAP-2.2.2)
- Store mail accounts in which backend (LDAP/MySQL/PGSQL): LDAP
- Web server (Apache or Nginx): Apache
- Linux/BSD distribution name and version: Centos 6
- Related log if you're reporting an issue: http://www.iredmail.org/forum/topic8911 … p-222.html
====

Dear All,
Can You help me please. The problem was found 2 weeks ago, after i upgrade iredmail from 0.8.7 to 0.9.0.

I can't sending mail with attachment file over 10MB.
I don't know what happen with this problem, because I dont change anything.

This is the log message if I sending with 15MB attachment file :
-----
Apr 11 20:51:34 mail postfix/qmgr[6370]: B14E69C1F3: from=<sender@domain.co.id>, size=21526699, nrcpt=1 (queue active)
Apr 11 20:51:34 mail amavis[24431]: (24431-17) ESMTP REJECT 'RCPT TO': 552 5.3.4 Declared message size (21526699 B) exceeds size limit for recipient <test@receive.com>
Apr 11 20:51:34 mail postfix/smtp[6409]: B14E69C1F3: to=<test@receive.com>, relay=127.0.0.1[127.0.0.1]:10024, delay=6.3, delays=6.2/0/0.01/0.04, dsn=5.3.4, status=bounced (host 127.0.0.1[127.0.0.1] said: 552 5.3.4 Declared message size (21526699 B) exceeds size limit for recipient <test@receive.com> (in reply to RCPT TO command))
Apr 11 20:51:34 mail postfix/cleanup[6404]: F15AE9C96C: message-id=<20150412005134.F15AE9C96C@mail.receive.com>
Apr 11 20:51:35 mail postfix/bounce[6433]: B14E69C1F3: sender non-delivery notification: F15AE9C96C
Apr 11 20:51:35 mail postfix/qmgr[6370]: F15AE9C96C: from=<>, size=3926, nrcpt=1 (queue active)
Apr 11 20:51:35 mail postfix/qmgr[6370]: B14E69C1F3: removed
Apr 11 20:51:35 mail postfix/smtpd[6402]: disconnect from mail-qk0-f174.google.com[209.85.220.174]
Apr 11 20:51:37 mail postfix/smtp[6434]: F15AE9C96C: to=<sender@domain.co.id>, relay=aspmx.l.google.com[74.125.130.27]:25, delay=2.5, delays=0.01/0.02/1.6/0.89, dsn=2.0.0, status=sent (250 2.0.0 OK 1428799753 hs3si9136133pbb.155 - gsmtp)
Apr 11 20:51:37 mail postfix/qmgr[6370]: F15AE9C96C: removed
-----

I read from this thread : http://www.iredmail.org/forum/topic7033 … imit.html. So I thought this is the main problem because I dont set "mailbox_size_limit".
But, after I set "mailbox_size_limit", the problem is come back.

The bounceback message is :
-----
Delivery to the following recipient failed permanently:

     ttest@receive.com

Technical details of permanent failure:
Google tried to deliver your message, but it was rejected by the server for the recipient domain receive.com by mail.receive.com. [202.158.xxx.xxx].

The error that the other server returned was:
552 5.3.4 Message size exceeds fixed limit
-----

The parameter in postfix (main.cf) is :
message_size_limit = 20971520
mailbox_size_limit = 31457280

----

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

2

Re: Can't sending mail over 10MB mail attachment

Did you set a message size limit with iRedAdmin-Pro? either a global setting, or a per-domain, per-user setting.

3

Re: Can't sending mail over 10MB mail attachment

ZhangHuangbin wrote:

Did you set a message size limit with iRedAdmin-Pro? either a global setting, or a per-domain, per-user setting.

Dear Zhang,

I dont set in perdoamin or per user, i just set in the global setting in postfix (main.cf) :
the parameter is :
message_size_limit = 20971520
mailbox_size_limit = 31457280

I still get problem with the last post :
http://www.iredmail.org/forum/topic8911 … p-222.html

I dont know, what happen.

so now, I disable plugin "amavisd_message_size_limit", but its not work.

4

Re: Can't sending mail over 10MB mail attachment

Dear Zhang,


I read file amavisd_message_size_limit.py in directory : /opt/iredapd/plugins/
I saw the first line (documentation) like this :
# How to use this plugin:
#
# *) Enable `@lookup_sql_dsn` in Amavisd config file.
#
# *) Set Amavisd lookup SQL database related parameters (amavisd_db_*) in
#    iRedAPD config file `settings.py`, and enable this plugin.
#
# *) Enable iRedAPD in Postfix `smtpd_end_of_data_restrictions`.
#    For example:
#
#    smtpd_end_of_data_restrictions =
#           check_policy_service inet:[127.0.0.1]:7777,
#           ...
#
# *) Enable this plugin in iRedAPD config file (/opt/iredapd/settings.py).
# *) Restart both iRedAPD and Postfix services.

in this step :

*) Set Amavisd lookup SQL database related parameters (amavisd_db_*) in
   iRedAPD config file `settings.py`, and enable this plugin.

I dont configure anything parameters start with "amavisd_db_" in file /opt/iredapd/settings.py
And I not found parameter which start with "amavisd_db_" in /opt/iredapd/settings.py

5

Re: Can't sending mail over 10MB mail attachment

jco wrote:

Apr 11 20:51:34 mail amavis[24431]: (24431-17) ESMTP REJECT 'RCPT TO': 552 5.3.4 Declared message size (21526699 B) exceeds size limit for recipient <test@receive.com>

This was rejected by Amavisd, not iRedAPD.
Could you please check records in SQL table "amavisd.policy", do you have any policy limits the message size (check column `policy.message_size_limit`)?

6 (edited by jco 2015-04-12 22:31:47)

Re: Can't sending mail over 10MB mail attachment

ZhangHuangbin wrote:
jco wrote:

Apr 11 20:51:34 mail amavis[24431]: (24431-17) ESMTP REJECT 'RCPT TO': 552 5.3.4 Declared message size (21526699 B) exceeds size limit for recipient <test@receive.com>

This was rejected by Amavisd, not iRedAPD.
Could you please check records in SQL table "amavisd.policy", do you have any policy limits the message size (check column `policy.message_size_limit`)?


Dear Zhang,

Thankyou for your reply.

This is the result from capture all from table policy in amavisd database :
http://ur1.ca/k5nwb

I try to sending mail with attachment file size 15MB to testingcbn@receive.com.



I try to disable plugin "amavisd_message_size_limit" in /opt/iredapd/settings.py
but, its also can't sending.
this is bouceback message :
==============================================
Delivery to the following recipient failed permanently:

     testingcbn@receive.com

Technical details of permanent failure:
Google tried to deliver your message, but it was rejected by the server for the recipient domain receive.com by mail.receive.com. [202.158.114.xxx].

The error that the other server returned was:
552 5.3.4 Message size exceeds fixed limit
==============================================



Then I try again to enable plugin "amavisd_message_size_limit" in /opt/iredapd/settings.py
but, its also can't sending mail, this is the bounceback message :
==============================================
Delivery to the following recipient failed permanently:

     testingcbn@receive.com

Technical details of permanent failure:
Google tried to deliver your message, but it was rejected by the server for the recipient domain receive.com by mail.receive.com. [202.158.114.xxx].

The error that the other server returned was:
552 5.3.4 Message size exceeds fixed limit
==============================================

Thank you Zhang.

7

Re: Can't sending mail over 10MB mail attachment

It's very clear in the SQL output:

mysql> select * from policy \G;
*************************** 1. row ***************************
                          id: 2
                 policy_name: postmaster@receive.com
          message_size_limit: 41943040
*************************** 2. row ***************************
                          id: 3
                 policy_name: @receive.com
          message_size_limit: 20971520
*************************** 4. row ***************************
                          id: 8
                 policy_name: testcloud@receive.com
          message_size_limit: 26214400
*************************** 5. row ***************************
                          id: 7
                 policy_name: testingcbn@receive.com
          message_size_limit: 62914560

Amavisd will read this message size limit and reject email after email was queued by Postfix, and iRedAPD plugin will read it and reject email during smtp session before queued.

8

Re: Can't sending mail over 10MB mail attachment

ZhangHuangbin wrote:

It's very clear in the SQL output:

mysql> select * from policy \G;
*************************** 1. row ***************************
                          id: 2
                 policy_name: postmaster@receive.com
          message_size_limit: 41943040
*************************** 2. row ***************************
                          id: 3
                 policy_name: @receive.com
          message_size_limit: 20971520
*************************** 4. row ***************************
                          id: 8
                 policy_name: testcloud@receive.com
          message_size_limit: 26214400
*************************** 5. row ***************************
                          id: 7
                 policy_name: testingcbn@receive.com
          message_size_limit: 62914560

Amavisd will read this message size limit and reject email after email was queued by Postfix, and iRedAPD plugin will read it and reject email during smtp session before queued.

Dear Zhang,

Thank you for your reply,

I try to sending mail to testingcbn@receive.com, in that information "message_size_limit: 26214400" its mean 25MB right?
But I can't sending mail with attachment file 15MB. I don't know about this problem.

9

Re: Can't sending mail over 10MB mail attachment

Please try this:

*) Enable iRedAPD plugin 'amavisd_wblist' in /opt/iredapd/settings.py, as FIRST plugin. And enable debug mode, like this:

log_level = 'debug'
plugins = ['amavisd_wblist', ...]

*) Restart iRedAPD service. Send one more testing email, and show us iRedAPD log in /var/log/iredapd.log. Let's see which restriction rule is applied.

10

Re: Can't sending mail over 10MB mail attachment

ZhangHuangbin wrote:

Please try this:

*) Enable iRedAPD plugin 'amavisd_wblist' in /opt/iredapd/settings.py, as FIRST plugin. And enable debug mode, like this:

log_level = 'debug'
plugins = ['amavisd_wblist', ...]

*) Restart iRedAPD service. Send one more testing email, and show us iRedAPD log in /var/log/iredapd.log. Let's see which restriction rule is applied.

Dear Zhang,

Thank you for your reply, and sorry for the late reply,

I try this, but I can't show the log in /var/log/iredapd.log.
FYI, I enable 'amavisd_wblist' plugin has been from a few days ago. Than I restart iredapd service like as your suggest.
Must I see the archive iredapd.log? Because after I sending 2 mail with attachment 15MB it's not recording to /var/log/iredapd.log.

[root@mail log]# cat /var/log/iredapd.log | grep "testingcbn@receive.com"
[root@mail log]#

11

Re: Can't sending mail over 10MB mail attachment

With default iRedMail setting, Amavisd is configured as after-queue filter, iRedAPD will check incoming emails before Amavisd. So it's supposed that iRedAPD will log something related to this testing email first, then Amavisd.

jco wrote:

Apr 11 20:51:34 mail amavis[24431]: (24431-17) ESMTP REJECT 'RCPT TO': 552 5.3.4 Declared message size (21526699 B) exceeds size limit for recipient <test@receive.com>

According to this message, this email was rejected by Amavisd due to exceed size limit. So the 'policy.message_size_limit' was used by Amavisd.

Could you please show us output of command 'postconf -n'?

12

Re: Can't sending mail over 10MB mail attachment

ZhangHuangbin wrote:

With default iRedMail setting, Amavisd is configured as after-queue filter, iRedAPD will check incoming emails before Amavisd. So it's supposed that iRedAPD will log something related to this testing email first, then Amavisd.

jco wrote:

Apr 11 20:51:34 mail amavis[24431]: (24431-17) ESMTP REJECT 'RCPT TO': 552 5.3.4 Declared message size (21526699 B) exceeds size limit for recipient <test@receive.com>

According to this message, this email was rejected by Amavisd due to exceed size limit. So the 'policy.message_size_limit' was used by Amavisd.

Could you please show us output of command 'postconf -n'?

Dear Zhang,
Thankyou for your reply,

This is output of "postconf -n"
http://fpaste.org/211334/14291170/raw/

In there I set to configure 2 parameter about size :
mailbox_size_limit = 31457280 =>> 30MB
message_size_limit = 20971520 =>> 20MB

Btw, I try sending 10MB mail attachment, but it's detect 13MB in inbox mail roundcube.
You can see that in this post.

Thank you Zhang.

13

Re: Can't sending mail over 10MB mail attachment

Postfix configuration looks fine. I still have no idea why iRedAPD is not invoked BEFORE Amavisd. Could you please show me some more info:

*) File /opt/iredapd/settings.py. Note: remove password in this file before pasting.
*) File /etc/postfix/master.cf.

Did you send email through port 587?

14

Re: Can't sending mail over 10MB mail attachment

ZhangHuangbin wrote:

Postfix configuration looks fine. I still have no idea why iRedAPD is not invoked BEFORE Amavisd. Could you please show me some more info:

*) File /opt/iredapd/settings.py. Note: remove password in this file before pasting.
*) File /etc/postfix/master.cf.

Did you send email through port 587?

Dear Zhang,

Thank you for your replay,
Ya I don't know about this problem, so I ask to you.

This is iredapd file ( /opt/iredapd/settings.py ) :
http://fpaste.org/211501/42914967/raw/

And This is master.cf file ( /etc/postfix/master.cf ) :
http://fpaste.org/211502/49918142/raw/

Btw, about mail. I send from gmail with browser.

Thank you Zhang.
I know you can fix it.

15

Re: Can't sending mail over 10MB mail attachment

iRedAPD and Postfix master.cf look just fine, I have no idea yet.
is it possible to let me login to your server for further testing? If yes, please contact me: http://www.iredmail.org/contact.html
I need ssh access with root privilege, and a testing email account used to reproduce this issue.