1

Topic: Postfix splits multi recipient email into multiple emails

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

Today I noticed very huge load on our mail server, caused by Amavis.
After some debugging we noticed that one of our customer sent one mail with multiple recipients (500 recipients). Postfix has split those mail into 500 copies and send each on of them to amavis for scanning.
Is this happening because I have this setting in postfix: smtp-amavis_destination_recipient_limit = 1 ?

What will break if I increase smtp-amavis_destination_recipient_limit = 100 for example?
If i understand correctly, this will case amavis to scan mail with 500 recipients only 5 times instead of 500 times? If this correct?
Will this affect per-user policy logic?

----

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

2

Re: Postfix splits multi recipient email into multiple emails

roccoro wrote:

Is this happening because I have this setting in postfix: smtp-amavis_destination_recipient_limit = 1 ?

No.

roccoro wrote:

What will break if I increase smtp-amavis_destination_recipient_limit = 100 for example?

Don't do this. Seems you have no idea what you're doing. sad

roccoro wrote:

If i understand correctly, this will case amavis to scan mail with 500 recipients only 5 times instead of 500 times? If this correct?

WRONG. Don't guess, but check Postfix documents.

You can try to update /etc/postfix/master.cf, find lines below for transport "smtp-amavis":

smtp-amavis ...
    -o syslog_name=postfix/amavis
    -o smtp_data_done_timeout=1200
    -o smtp_send_xforward_command=yes
    -o disable_dns_lookups=yes
    -o max_use=20

Append one line to this transport:

smtp-amavis ...
    -o syslog_name=postfix/amavis
    -o smtp_data_done_timeout=1200
    -o smtp_send_xforward_command=yes
    -o disable_dns_lookups=yes
    -o max_use=20
    -o receive_override_options=no_header_body_checks,no_unknown_recipient_checks,no_address_mappings

Restart Amavisd service and try.

3

Re: Postfix splits multi recipient email into multiple emails

Hello.

Thank you for your answers but apparently even you don't know why is this happening.
The suggested solution didn't work.

From Postfix docs:
default_destination_recipient_limit
If an email message exceeds the recipient limit for some destination, the Postfix queue manager breaks up the list of recipients into smaller lists. Postfix will attempt to send multiple copies of the message in parallel.

In our case:
transport_destination_recipient_limit
A transport-specific override for the default_destination_recipient_limit parameter value.

What to do next?

IMHO its not normal that one single mail is scanned multiple times, it is a waste of CPU power and delivery time. Agree?

4

Re: Postfix splits multi recipient email into multiple emails

The key is "no_address_mappings", it expands alias/lists/... before Postfix hands over the email to the content filter.

5

Re: Postfix splits multi recipient email into multiple emails

Thank you.

Tried this:
smtp-amavis unix -  -   n   -   8  smtp
    -o syslog_name=postfix/amavis
    -o smtp_data_done_timeout=1200
    -o smtp_send_xforward_command=yes
    -o disable_dns_lookups=yes
    -o max_use=20
    -o receive_override_options=no_address_mappings

and this:
smtp-amavis unix -  -   n   -   8  smtp
    -o syslog_name=postfix/amavis
    -o smtp_data_done_timeout=1200
    -o smtp_send_xforward_command=yes
    -o disable_dns_lookups=yes
    -o max_use=20
    -o receive_override_options=no_header_body_checks,no_unknown_recipient_checks,no_address_mappings

Tried on two different iredmail servers, but without success.

Any other idea?