amavisd split local and remote recipient in different email

Mark Martinec Mark.Martinec+amavis at
Fri Apr 20 02:28:01 CEST 2012


> i have an amavisd-new integrated with postfix through content_filter.
> In amavisd.conf i have:
> ........
> $mydomain = '';
> ........
> ........
> @local_domains_maps = ( [".$mydomain"] );
> ........
> The problem is that if i send a spam's mail to 5 recipients (3 of
> and 2 of amavisd splits this mail in two
> different mail (1 for the domain and another for
> This actions create a problem in my backend smtp server.
> If i delete [".$mydomain"] from @local_domains_maps, it doen't split
> email and i don't have problem.
> Is there another way to tell it not to split the emails?

If a mail message addressed to multiple recipients needs to be
edited differently (e.g. inserting X-Spam* header field for
some and not for others, which is probably happening in your case),
amavisd has no other choice but to split deliveries. Deliveries
are grouped by what changes are needed: all recipients which need
the same treatment will be clustered into a common delivery.

Similar splitting happens for example when recipients have
different spam levels or different white/blacklisting configured,
or when some but not all have defanging enabled.

To minimize the chance of mail splitting, avoid individual
(per-recipient) settings, and turn off inserting X-Spam* header
fields, as these are only inserted for local recipients and
not for outbound mail.

Something like this could help:
  $allowed_added_header_fields{lc('X-Spam-Status')} = 0;
  $allowed_added_header_fields{lc('X-Spam-Level')} = 0;
  $allowed_added_header_fields{lc('X-Spam-Flag')} = 0;
  $allowed_added_header_fields{lc('X-Spam-Score')} = 0;
  $allowed_added_header_fields{lc('Authentication-Results')} = 0;
  $allowed_added_header_fields{lc('X-Quarantine-ID')} = 0;
  $allowed_added_header_fields{lc('X-Amavis-Alert')} = 0;
  $allowed_added_header_fields{lc('X-Amavis-PenPals')} = 0;
  $allowed_added_header_fields{lc('X-Amavis-OS-Fingerprint')} = 0;
  $allowed_added_header_fields{lc('Authentication-Results')} = 0;

and keep spam_subject tags off:
  @spam_subject_tag_maps = ();
  @spam_subject_tag2_maps = ();
  @spam_subject_tag3_maps = ();

and defanging off.

To be absolutely sure you could configure your MTA to split mail
to single-recipient copies before going to a content filter,
although that would be a bit wasteful. Better to fix whatever
is bothering your backend smtp server.



More information about the amavis-users mailing list