Mailing List Archive

How can qmail do this?
I am tasked to design, build and maintain a new MTA. The company has
one special requirement, for which I'm investigating the simplest solution:

For each incoming message received, every outgoing "reply" must use the
"To:" address from the incoming received message as the "From:" address
in the outgoing reply.

This is trivial when the incoming has "To: sally@domain.com," Sally
reads and replies, and the outgoing message has "From: sally@domain.com"

It's trickier when the incoming has "To: info@domain.com," the MTA
delivers to an Exchange server, which distributes that message to Sally,
and Sally replies. What is the simplest way for that outgoing message
to use "From: info@domain.com?"

Scope is roughly one hundred (100) different domains and, possibly,
thousands of combinations with various username@domain.com.

Ideally, the MTA will handle all of header address processing, whatever
that process might look like. I seek the simplest solution, regardless
how that process looks and compares to the status quo.

Please, advise. Thank you.


~Mike
Re: How can qmail do this? [ In reply to ]
Hi Mike,

On Mon, Mar 02, 2015 at 08:56:13PM -0600, Mike Schleif wrote:
> For each incoming message received, every outgoing "reply" must use
> the "To:" address from the incoming received message as the "From:"
> address in the outgoing reply.

Do you need to write a new MTA? Why not use the qmailqueue patch and
rewrite the envelope at receive time?

> It's trickier when the incoming has "To: info@domain.com," the MTA
> delivers to an Exchange server, which distributes that message to
> Sally, and Sally replies. What is the simplest way for that
> outgoing message to use "From: info@domain.com?"

The qmailqueue patch can invoke a perl script, where regex is your
friend.

Hope this offers a shorter and less complex path.

--
Best regards,
Ed http://www.s5h.net/
Re: How can qmail do this? [ In reply to ]
On Monday 02 Mar 2015 20:56:13 Mike Schleif wrote:
> I am tasked to design, build and maintain a new MTA. The company has
> one special requirement, for which I'm investigating the simplest solution:
>
> For each incoming message received, every outgoing "reply" must use the
> "To:" address from the incoming received message as the "From:" address
> in the outgoing reply.
>
> This is trivial when the incoming has "To: sally@domain.com," Sally
> reads and replies, and the outgoing message has "From: sally@domain.com"
>
> It's trickier when the incoming has "To: info@domain.com," the MTA
> delivers to an Exchange server, which distributes that message to Sally,
> and Sally replies. What is the simplest way for that outgoing message
> to use "From: info@domain.com?"
>
> Scope is roughly one hundred (100) different domains and, possibly,
> thousands of combinations with various username@domain.com.
>
> Ideally, the MTA will handle all of header address processing, whatever
> that process might look like. I seek the simplest solution, regardless
> how that process looks and compares to the status quo.

I'm not 100% clear from your message if you're talking about header or
envelope addresses. It's also not clear how the messages you describe are
received: Are they received because the MTA is the MX for certain domains, or
are they received by mail submission from users using the MTA as their mail
host? Or something else?

The options that spring to mind are a QMAILQUEUE wrapper as suggested by Ed,
exploring mailing list programs like ezmlm-idx, mailman etc to see if they can
provide this functionality, or maybe a dual-[net]qmail server setup: One qmail
instance to receive and rewrite the message that invokes the other to send out
the message; in the latter case the rewriting magic could happen in a .qmail
file where qmail-local's environment variables could come in handy, esp if the
envelope address is pertinent (LOCAL / RECIPIENT / EXT etc - see qmail-command
man page).

cheers,

Andrew.
--
====================================================================
* Custom email solutions * Systems Administration * Networking
http://www.acrconsulting.co.uk/email/qmail.html
====================================================================
Re: How can qmail do this? [ In reply to ]
Geachte heer, mevrouw,

Hartelijk dank voor uw e-mail. Binnen 2 werkdagen ontvangt u van ons een reactie op uw vraag of klacht. Wist u dat u bij de ING ook veel zaken online kunt regelen? Bijvoorbeeld het beheren van uw geldzaken, het aanvragen van nieuwe producten, of het wijzigen van uw gegevens. Meer weten? Klik https://www.ing.nl/particulier/klantenservice/index.html"]hier.

Dit is een automatische ontvangstbevestiging.

Met vriendelijke groet,

ING Bank N.V.

-----------------------------------------------------------------
ATTENTION:
The information in this electronic mail message is private and
confidential, and only intended for the addressee. Should you
receive this message by mistake, you are hereby notified that
any disclosure, reproduction, distribution or use of this
message is strictly prohibited. Please inform the sender by
reply transmission and delete the message without copying or
opening it.

Messages and attachments are scanned for all viruses known.
If this message contains password-protected attachments, the
files have NOT been scanned for viruses by the ING mail domain.
Always scan attachments before opening them.
-----------------------------------------------------------------
Re: How can qmail do this? [ In reply to ]
> I am tasked to design, build and maintain a new MTA. The company has
> one special requirement, for which I'm investigating the simplest
> solution:
>
> For each incoming message received, every outgoing "reply" must use the
> "To:" address from the incoming received message as the "From:" address
> in the outgoing reply.
>
> This is trivial when the incoming has "To: sally@domain.com," Sally
> reads and replies, and the outgoing message has "From: sally@domain.com"
>
> It's trickier when the incoming has "To: info@domain.com," the MTA
> delivers to an Exchange server, which distributes that message to Sally,
> and Sally replies. What is the simplest way for that outgoing message
> to use "From: info@domain.com?"
>
> Scope is roughly one hundred (100) different domains and, possibly,
> thousands of combinations with various username@domain.com.
>
> Ideally, the MTA will handle all of header address processing, whatever
> that process might look like. I seek the simplest solution, regardless
> how that process looks and compares to the status quo.
>
> Please, advise. Thank you.

The reality is, this isn't an MTA issue. It's an MUA issue - the MTA
knows NOTHING of the contents of the message body including the To: and
From: headers, and more importantly it would need to be able to parse the
To: header of the quoted reply, assuming that information was even there
(all of which are things that an MTA isn't really supposed to care about).

What you need is a mail client that can look at the To: header of the
message being replied to and use that as the sending identity. I know my
webmail client (SquirrelMail) can do that, but only if the identity is set
up as a sending identity first. Given what you're talking about, that's
probably not a useful way to do it, but I don't know any mailers that will
do what you want.

Again, the MTA isn't supposed to care about the body of the message, only
the envelope, and that is 100% dependent on what the MUA gives it. I
think you're looking at needing to investigate a bunch of mail clients,
and possibly even modifying one to do what you're asking it to if you
can't find anything that does it out of the box...

Josh

Joshua Megerman
SJGames MIB #5273 - OGRE AI Testing Division
You can't win; You can't break even; You can't even quit the game.
- Layman's translation of the Laws of Thermodynamics
josh@honorablemenschen.com
Re: How can qmail do this? [ In reply to ]
> I am tasked to design, build and maintain a new MTA. The company has
> one special requirement, for which I'm investigating the simplest
> solution:
>
> For each incoming message received, every outgoing "reply" must use the
> "To:" address from the incoming received message as the "From:" address
> in the outgoing reply.
>
> This is trivial when the incoming has "To: sally@domain.com," Sally
> reads and replies, and the outgoing message has "From: sally@domain.com"
>
> It's trickier when the incoming has "To: info@domain.com," the MTA
> delivers to an Exchange server, which distributes that message to Sally,
> and Sally replies. What is the simplest way for that outgoing message
> to use "From: info@domain.com?"
>
> Scope is roughly one hundred (100) different domains and, possibly,
> thousands of combinations with various username@domain.com.
>
> Ideally, the MTA will handle all of header address processing, whatever
> that process might look like. I seek the simplest solution, regardless
> how that process looks and compares to the status quo.

This is the kind of thing that haraka is quite good at: http://haraka.github.io. It’s not especially mature as yet, but it’s pretty fast, extremely flexible, has a built-in message parser and it’s really easy to write plugins for (in javascript of course). If it’s not up to the heavy lifting of handling all your email stuff, you can use it as a processing relay in front of qmail/exchange/postfix or whatever.

Marcus
--
Marcus Bointon
Technical Director, Synchromedia Limited

Creators of http://www.smartmessages.net/
UK 1CRM solutions http://www.syniah.com/
marcus@synchromedia.co.uk | http://www.synchromedia.co.uk/