[Pkg-exim4-users] How to Connect to smtp.gmail.com with different login/password pairs

Sébastien Hinderer Sebastien.Hinderer at ens-lyon.org
Fri Oct 21 21:14:04 BST 2022

Hey Gary,

Gary Dale (2022/10/11 20:37 -0400):
> On 2022-09-13 16:19, Sébastien Hinderer wrote:
> > Hey Ian,
> > 
> > > Yes, that would be one simple solution.
> > Well, not that simple (for me) actually, sorry.
> > 
> > > > I'll wait a bit to see whether other suggestions come in
> > > > and, if not, try this one. I am slightly reluctant because it  makes me
> > > > create yet another thing (a transport) and it will mean that this one
> > > > password will be apart from others, but if that's the only way I'll go
> > > > for that.
> > > > 
> > > > I guess, ideally, what would be nice would be that the smarthost
> > > > transport would let a router specify a login and then it would be
> > > > possible to pick the password from the passwd.client file. Just that the
> > > > login should be able to contain @ signs because that's how GMail logins
> > > > are and quite possibly other providers (HotMail?) would need the support
> > > > for @ in logins.
> > > Well, i wouldn't have this new transport look at a file that is
> > > formatted like passwd.client. What I would do is look for some data that
> > > is unique to the router, perhaps even the router name, then create a new
> > > file format which uses that as the key for a lookup, and that goes in
> > > the transport.
> > Well as I said I think I could live with a password hard-coded in the
> > dedicated transport but even that I don't know how to achieve.
> > 
> > Basically, I can copy/past the "remote_smtp_smarthost" transport and
> > create, say, a "copany_remote_smtp_smarthost" one but evenif I do that,
> > the  thing I will need to change in the copied transport is the
> > definition of "hosts_try_auth". Is there a syntax to write a login /
> > passowrd / host in the definition of this macro directly?
> > 
> > Sébastien.
> A question: don't know if you covered this in parts of the conversation that
> aren't on the listserve,

Everything is in the list, there was no private conversation.

> but if I got the issue correct, you want some
> e-mail to go through one account and other e-mail to go through another
> account.

Yes, different accounts on the same SMTP smarthost, that's the whoe

> This can be handled by using different passwd.client files for each client.
> I have a similar problem that I solve by changing the passwd.client file
> according to the account I want to send from. The advantage of doing this is
> that it requires no changes to exim4. The disadvantage is that I have to do
> it before sending e-mail from that account.
> This isn't a big deal for me because I don't do it often. However it can
> easily be automated in a wrapper script for your e-mail client if you a
> sending e-mail from the command line, which is how I use exim4. The wrapper
> would need privileges to cp the passwd.client.<from> files...

Many thanks for the proposal. Unfortunately it does not fit my use-case
because I don't send e-mails from the command-line. Also my user would
not have the permission to change passwd.client, I don't want to play
with the permissions.

Another point which makes this not working for me is when I send e-mails
while being off-line. These e-mails will then all be sent asynchronously
when coming back online and there willb e no possibility to control
which passwd.client is used for which e-mail.

Anyway, I feel the use case I have is legitimate and just shows that the
currentway odf doiong things is not flexible enough so I hope we can
find a way to extend it to cover this usecase and so that there is no
need to do weird things. I think it should "just work", somehow.


More information about the Pkg-exim4-users mailing list