[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [msmtp-users] 2 domains with msmtp from one PHP?



On Wed, 15 Feb 2012 19:02:32 +0100, A. Bischof wrote:
> >> I have a server running php (with lighttpd, not apache) for
> >> different domains. I have google mail accounts for the domains.
> >> Now I must send mails from domain one.de with another sender then
> >> domain two.de
> >>
> >> How can this be achieved?
> ...
> > -----------
> > defaults
> > host ...
> > tls ...
> > log ...
> >
> > account one
> > from webmaster@...280...
> > user webmaster@...280...
> > password ***
> >
> > account two
> > from webmaster@...281...
> > user webmaster@...281...
> > password ***
> > ------------
> >
> > Now you have multiple options:
> > - if you can use different php.ini files for your domains, you can
> >    choose an account with the --account option.
> > - if your php scripts set a 'From' header in each mail depending on
> > the domain (e.g. 'From: webmaster@...280...' and 'From:
> > webmaster@...281...'), you can use the --read-envelope-from option of
> > msmtp. Then msmtp reads this From address and automatically chooses
> > the account that has a matching 'from' command.
> 
> thanks alot so far! I don't know how to use different php.inis for my 
> domain - it's one lighttpd running the php-cgis, so I assume that's
> not possible.
> 
> I'll test the --read-envelope-from option of msmtp - is it possible
> to use placeholders? Like
> from *@one.de
> and msmtp chooses only by domain, so webmaster@...280... would fit as
> any other mail address from one.de would?

No, that's not currently possible. It looks like a good idea though.

Or maybe msmtp should support something like a 'X-Msmtp-Account:
foobar' header that it uses to choose an account and then removes from
the mail.

Martin