On 09/02/2010 03:26 PM, Zhou, Yan wrote:
Hi there,

If Postfix server gets a mail message with multiple TO: address (i.e.,
multiple recipients), does Postfix send one message to each address?

These decisions are not made when postfix receives mail.
The message in the incoming queue includes all recipients that postfix _accepted_.

When the qmgr(8) picks up the message, several settings are consulted, and by default postfix will send one copy of the message to each destination domain/nexthop. So if the message contains multiple recipients that can be delivered over one transport, they will be combined in one message.

  If so, at what stage does this happen?

If you mean the exact process, that would be the qmgr(8).
Take a look at how postfix operates: http://www.postfix.org/OVERVIEW.html

  The postfix log seems to indicate
that.

For my Postfix, I customized my transport in postfix like this,

transport_maps = hash:/etc/postfix/transport

where the transport file reads like this (connector is a script that
calls a program to consume emails).

<my domain name>          connector:

I observed that the transport only get one single message with multiple
TO: address in it. So, this means my transport should do the work of
sending to multiple destinations?

There is no reason it "should", no.
You can force postfix to split them up into single-recipient messages with the $transport_destination_recipient_limit = 1 parameter (where $transport is the name of your transport) - this will limit each message to that transport to a single recipient. This will often be necessary for delivery to programs (as opposed to mail servers) that can only handle one recipient at a time.

If I do not use any customized transport, rather, use the default
Maildir/ format, I am sure that Postfix will place one message in each
destination folder.

"The default transport" and "the default Maildir format" are not related.
What happens to local mail is decided by the local(8) mail delivery agent (MDA) included with postfix.
How physical mailboxes are addressed is configured there, and nowhere else.

The qmgr(8) uses the term "destination" in two distinct ways, depending on the setting of $transport_destination_recipient_limit. In general (for any transports that do not have that setting defined), a destination refers to a mail server, not a message recipient. In the above case, however, the default for local_destination_recipient_limit is 1, so "destination" does mean "single recipient".

Your transport is not local(8), and has no relation to it.
If you don't explicitly set it, $yourtransport_destination_recipient_limit will be 50.

My assumption, by using a customized transport, I am taking away what
Postfix delivery agent does, which is copy one message to each
destination?

No.
By default, local_destination_recipient_limit = 1, so the qmgr(8) already breaks them up into separate messages.
For a custom transport, however, the built-in default is 50.

The transport is not involved in either case - it's the qmgr(8) that decides this.

In conclusion, yes, you can use a transport that only accepts a single recipient - if you configure it.


J.

Reply via email to