Liam:
> I'd like to request a little more benefit of the doubt, gentlemen... :-)
> 
> I need to send messages (many from ordinary email sources) on an IP WAN with
> unreliable connections to/from nodes whose IPs may vary from session to
> session. This is part of a larger application that I can't discuss publicly.
> It's not a website app; it's more like an IMAP service that doesn't retain
> messages.

This sounds like you intend to stream mail directly, on demand,
from the MTA queue to the websocket client.

There are fundamental problems with on-demand delivery from the MTA
queue. There is a basic mis-match, because the typical MTA queue
(not just Postfix but any MTA that I am familiar with) is NOT
designed to be used as medium-term message store.

Instead, the typical MTA queue is optimized to deliver mail as soon
as it arrives; Postfix optimizes this further by moving "slow" mail
to the deferred queue to avoid polluting the "fast path".

Turning the typical MTA queue into an "on-demand delivery" message
store means that you are going to deliver all mail through the
"slow path", the path that the typical MTA is not optimized for.

With on-demand, slow-path, delivery from the typical MTA mail queue,
the MTA has to search the entire queue for the messages for a
specific web client (all mail for a specific recipient or domain).

Postfix can speed this up by maintaining per-domain lists of queue
file names.  But even with that optimization, on-demand delivery
becomes *incredibly expensive* when non-trivial amounts of mail
are allowed to accumulate in the MTA queue. It is still delivery
through the "slow path".

It would be much more efficient to deliver the mail from the MTA
queue to per-webclient intermediate "queues". Those intermediate
queues can be delivered quickly, on-demand, when a websocket client
comes along.  Kind-of like using an IMAP message store.

Someone could implement an MTA architecture that is optimized for
on-demand delivery from the mail queue.  This would be very different
from the current typical MTA architecture of Postfix and the like,
which is optimized to deliver mail as soon as it arrives.

        Wietse

Reply via email to