1

Topic: Limiting message_size WITHIN ONE DOMAIN

==== REQUIRED BASIC INFO OF YOUR IREDMAIL SERVER ====
- iRedMail version (check /etc/iredmail-release):
0.9.6 MARIADB edition.
- Deployed with iRedMail Easy or the downloadable installer?
Instalator
- Linux/BSD distribution name and version:
Centos 7
- Store mail accounts in which backend (LDAP/MySQL/PGSQL):
Mysql
- Web server (Apache or Nginx):
Apache
- Manage mail accounts with iRedAdmin-Pro?
Yup
- [IMPORTANT] Related original log or error message is required if you're experiencing an issue.
====
Hi!

[root@irm ~]# cat /etc/postfix/main.cf | grep message_size
# Default message_size_limit.
message_size_limit = 125829120

[root@irm ~]# cat /opt/iredapd/settings.py | grep plugin
# Enabled plugins.
plugins = ["reject_null_sender", "reject_sender_login_mismatch", "throttle", "amavisd_wblist", "sql_alias_access_policy"]

- "Global" size limit set in postfix/main.cf works about fine
- size limit set "per domain" in iredadmin/throttle - work about fine, BUT
users still can send messages bigger, than the limit within one domain, and we don't wan this.

when johnny@domain.1 sends e-mail to billy@domain.2 , and domain2 is outside of our mail server - limit is working ok
when johnny@domain.1 sends e-mail to billy@domain.3 , and domain3 is on of our mail server, within local delivery - limit is working ok
but
when johnny@domain.1 sends e-mail to billy@domain.1 - then it is possible to send attachments bigger, than the message_size_limit

Is there a way, to limit the size of message sent to someone from the same domain?

----

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

2

Re: Limiting message_size WITHIN ONE DOMAIN

Append one line  in /opt/iredapd/settings.py, then restart iredapd service:

THROTTLE_BYPASS_SAME_DOMAIN = False

Defaults to True, defined in /opt/iredapd/libs/default_settings.py.

3

Re: Limiting message_size WITHIN ONE DOMAIN

Hi ZhangHuangbin, thank you for your answer.
I've added the line and restarted iredapd service, but still can send e-mails bigger than set in throttle tab wihin same domain.
My settings.py now looks like this:

[root@irm iredapd]# cat settings.py | grep -v "#"
from libs.default_settings import *
MYNETWORKS = ['ip_of_proxy1', 'ip_of_proxy2']
listen_address = "127.0.0.1"
listen_port = "7777"

run_as_user = "iredapd"

pid_file = '/var/run/iredapd.pid'

log_file = "/var/log/iredapd/iredapd.log"

log_level = "info"

backend = "mysql"

plugins = ["reject_null_sender", "reject_sender_login_mismatch", "throttle", "amavisd_wblist", "sql_alias_access_policy"]

ldap_uri = 'ldap://127.0.0.1:389'
ldap_basedn = 'o=domains,dc=iredmail,dc=org'
ldap_binddn = 'cn=vmail,dc=iredmail,dc=org'
ldap_bindpw = 'somepassword'

vmail_db_server = "127.0.0.1"
vmail_db_port = "3306"
vmail_db_name = "vmail"
vmail_db_user = "vmail"
vmail_db_password = "somepass1"

amavisd_db_server = "127.0.0.1"
amavisd_db_port = "3306"
amavisd_db_name = "amavisd"
amavisd_db_user = "amavisd"
amavisd_db_password = "somepass2"

iredapd_db_server = "127.0.0.1"
iredapd_db_port = "3306"
iredapd_db_name = "iredapd"
iredapd_db_user = "iredapd"
iredapd_db_password = "somepass3"

THROTTLE_BYPASS_SAME_DOMAIN = False

4

Re: Limiting message_size WITHIN ONE DOMAIN

Which version of iRedAPD are you running? Please upgrade to the latest iRedAPD-2.4 and try again.
FYI: https://docs.iredmail.org/upgrade.iredapd.html