How to use different auth for smarthost 

Newsgroups:  comp.mail.sendmail
Date:        Thu, 07 Sep 2006 22:06:29 +0200
>> If you mean to be able to use different user/password configurations
>> (AuthInfo) for the same smarthost or mailertable targets: this is not
>> possible.
>
> Ok, just to make it crystal clear,
>
> So if my box is used by more than 2 users, they all have to share the
> same user/password configurations for the smarthost, which will end up
> with the same from field. Ie, there is no way for them to specify their
> own from field? (I'm talking about smarthosts like gmail that do not
> allow you to set your own from field).

Generally the envelope sender and the mail From: header are independent from authentication data used to auth against a foreign server, setup as your smarthost. Both the envelope sender as well the From: header are typically set by a proper configuration of the mail client. From that point it can differ between different users. On the other hand the provider of the MTA which you want to use as smarthost could have configured his system, so that the SMTP AUTH data (AuthInfo on your system, user) has to match the address the user tries to send mail as through that other system. If thats the case, you have not much luck with Sendmail (Postfix since 2.3 provides Sender-dependent SASL authentication support; for Exim there are configuration tricks).

Alexander Dalloz

How to use different auth for smarthost 

> So if my box is used by more than 2 users, they all have to share the
> same user/password configurations for the smarthost, which will end up
> with the same from field. Ie, there is no way for them to specify their
> own from field? (I'm talking about smarthosts like gmail that do not
> allow you to set your own from field).

The suggestions below *MAY* work [no guarantees whatsoever]

You may try to select different "pseudo smart host" based (e.g.) on envelope sender or authentication credentials used during local submission. "Pseudo smart hosts" will be a CNAME to smtp.gmail.com in your local DNS domain (BTW smtp.gmail.com is a CNAME). You may create one wild-card CNAME *.gmail.smtp.example.com for all pseudo smart hosts. It should allow you to specify different outgoing AUTH per "pseudo smart host".

In case of problems with connections caching use custom mailer (variation of esmtp mailer) for smart hosts sending one message per connection.

Relay selection based on envelope sender had been implemented in (discontinued) smarttable. It has been never supported by sendmail.org.

P.S. "Right way" would require changes in sendmail source code: * selecting outgoing authentication credentials based on more data * caching of outgoing connections

BTW It will be better in sendmail X, will not it? ;-)

Andrzej Adam Filip