* Marwan Tanager <marwan.t...@gmail.com>:
> Hi everyone,
> 
> I have two gmail accounts, and I want to configure my local postfix server as 
> a 
> client which does SASL authentication with smtp.gmail.com:587 with 
> credentials 
> that depend on the sender address.
> 
> So, let's say that my gmail accounts are: a...@gmail.com and a...@gmail.com. 
> If 
> I sent a mail from a...@gmail.com, then postfix should use the credentials: 
> a...@gmail.com:passwd1 to do SASL authentication with gmail.  Similarly with 
> a...@gmail.com, it should use a...@gmail.com:passwd2.  Sounds fairly simple.
> 
> The reason I want to do this is that I want to implement profiles by 
> diffrentiating Mutt configurations and sourcing the relevant configurations 
> according to the desired profile.
> 
> Typically each profile would have a different value for the FROM header 
> field, 
> so postfix should be willing to cooperate and do sender dependent SASL 
> authentication based on those addresses.
> 
> Well, I followed the postfix official documentation at 
> http://www.postfix.org/SASL_README.html, and I ended up with the following 
> relevant configurations:
> 
> /etc/postfix/main.cf:
> 
>     smtp_sasl_auth_enable = yes
>     smtp_sasl_security_options = noanonymous
>     smtp_sasl_password_maps = hash:/etc/postfix/sasl_passwd
>     smtp_sender_dependent_authentication = yes
>     sender_dependent_relayhost_maps = hash:/etc/postfix/sender_relay
> 
>     relayhost = smtp.gmail.com:587
> 
> /etc/postfix/sasl_passwd:
> 
>     a...@gmail.com      a...@gmail.com:passwd1
>     a...@gmail.com      a...@gmail.com:passwd2
> 
>     smtp.gmail.com:587  a...@gmail.com:passwd1
> 
> /etc/postfix/sender_relay:
> 
>     a...@gmail.com      smtp.gmail.com:587
>     a...@gmail.com      smtp.gmail.com:587
> 
> After that I updated the mapping databases:
> 
>     # postmap /etc/postfix/sasl_passwd
>     # postmap /etc/postfix/sender_relay
>     # /etc/init.d/postfix restart
> 
> The problem is that when I send a mail from a...@gmail.com, the message ends 
> up 
> in the destination with sender address a...@gmail.com and NOT a...@gmail.com. 
> If 
> I changed that last line in sasl_passwd (the default credentials) to include 
> a...@gmail.com:passwd2, the mail gets to the destination from a...@gmail.com. 
>   
> So, apparently, postfix ignores the per-sender configurations in sasl_passwd 
> and 
> always uses the default configurations. In turn, this means that Mutt's 
> configurations "means nothing" to postfix.
> 
> So, if changing the "FROM" header field with Mutt doesn't affect the sender 
> address that postfix sees, What does?

Nope. You need to change the envelope sender address:

set envelope_from_address='a...@gmail.com'

-- 
All technical questions asked privately will be automatically answered on the
list and archived for public access unless privacy is explicitely required and
justified.

saslfinger (debugging SMTP AUTH):
<http://postfix.state-of-mind.de/patrick.koetter/saslfinger/>

Reply via email to