sender_dependent_relayhost_maps with different credentials for same relayhost

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

sender_dependent_relayhost_maps with different credentials for same relayhost

Stefan Bauer-2
Hi,

i have:
sender_dependent_relayhost_maps = hash:/etc/postfix/relayhost_maps
smtp_sasl_password_maps = hash:/etc/postfix/smtp_auth

more /etc/postfix/relayhost_maps
@mydomain.de    [smtp.1und1.de]:587

more /etc/postfix/smtp_auth
[smtp.1und1.de]:587    mydomain:mydomainpass    

How can i specify different credentials for same relayhost?

mails from my2domain.de should be relayed through 1und1 but with its own credentials.

Thank you.

Stefan
Reply | Threaded
Open this post in threaded view
|

Re: sender_dependent_relayhost_maps with different credentials for same relayhost

Wietse Venema
Stefan Bauer:

> Hi,
>
> i have:
> sender_dependent_relayhost_maps = hash:/etc/postfix/relayhost_maps
> smtp_sasl_password_maps = hash:/etc/postfix/smtp_auth
>
> more /etc/postfix/relayhost_maps
> @mydomain.de    [smtp.1und1.de]:587
> @my2domain.de [smtp.1und1.de]:587
>
> more /etc/postfix/smtp_auth
> [smtp.1und1.de]:587    mydomain:mydomainpass
>
> How can i specify different credentials for same relayhost?

smtp_sender_dependent_authentication = yes

This will first index smtp_sasl_password_maps with the sender
address, then the host, then the next-hop domain (whatever that
happens to be).

        Wietse

> mails from my2domain.de should be relayed through 1und1 but with its own
> credentials.
>
> Thank you.
>
> Stefan
Reply | Threaded
Open this post in threaded view
|

Re: sender_dependent_relayhost_maps with different credentials for same relayhost

Stefan Bauer-2
Thank you!

Am Montag, 5. November 2018 schrieb Wietse Venema :

> Stefan Bauer:
>> Hi,
>>
>> i have:
>> sender_dependent_relayhost_maps = hash:/etc/postfix/relayhost_maps
>> smtp_sasl_password_maps = hash:/etc/postfix/smtp_auth
>>
>> more /etc/postfix/relayhost_maps
>> @mydomain.de    [smtp.1und1.de]:587
>> @my2domain.de [smtp.1und1.de]:587
>>
>> more /etc/postfix/smtp_auth
>> [smtp.1und1.de]:587    mydomain:mydomainpass
>>
>> How can i specify different credentials for same relayhost?
>
> smtp_sender_dependent_authentication = yes
>
> This will first index smtp_sasl_password_maps with the sender
> address, then the host, then the next-hop domain (whatever that
> happens to be).
>
>         Wietse
>
>> mails from my2domain.de should be relayed through 1und1 but with its own
>> credentials.
>>
>> Thank you.
>>
>> Stefan
>
Reply | Threaded
Open this post in threaded view
|

Re: sender_dependent_relayhost_maps with different credentials for same relayhost

Stefan Bauer-2
In reply to this post by Wietse Venema
After setting

smtp_sender_dependent_authentication = yes

and adding additional credentials postfix rejects change with

#root@postgate01:~# nano /etc/postfix/smtp_auth
 
[securegw.intern]:25        user1:password
[securegw.intern]:25        user2:password

root@postgate01:~# more /etc/postfix/relayhost_maps
@customer1.de    [securegw.intern]:25
@customer2.de    [securegw.intern]:25

#root@postgate01:~# postmap /etc/postfix/smtp_auth
#postmap: warning: /etc/postfix/smtp_auth.db: duplicate entry: "[securegw.intern]:25"
#root@postgate01:~# /etc/init.d/postfix reload && /etc/init.d/postfix restart
#[ ok ] Reloading postfix configuration (via systemctl): postfix.service.
#[ ok ] Restarting postfix (via systemctl): postfix.service.

I would like to route different customers to same relayhost but with different credentials.

Am Mo., 5. Nov. 2018 um 20:47 Uhr schrieb Wietse Venema <[hidden email]>:
Stefan Bauer:
> Hi,
>
> i have:
> sender_dependent_relayhost_maps = hash:/etc/postfix/relayhost_maps
> smtp_sasl_password_maps = hash:/etc/postfix/smtp_auth
>
> more /etc/postfix/relayhost_maps
> @mydomain.de    [smtp.1und1.de]:587
> @my2domain.de [smtp.1und1.de]:587
>
> more /etc/postfix/smtp_auth
> [smtp.1und1.de]:587    mydomain:mydomainpass
>
> How can i specify different credentials for same relayhost?

smtp_sender_dependent_authentication = yes

This will first index smtp_sasl_password_maps with the sender
address, then the host, then the next-hop domain (whatever that
happens to be).

        Wietse

> mails from my2domain.de should be relayed through 1und1 but with its own
> credentials.
>
> Thank you.
>
> Stefan
Reply | Threaded
Open this post in threaded view
|

Re: sender_dependent_relayhost_maps with different credentials for same relayhost

Stefan Bauer-2
Found it. Was required to modify smtp_auth to

customer1.de user1:password
customer2.de user2:password.


Am Do., 22. Nov. 2018 um 10:22 Uhr schrieb Stefan Bauer <[hidden email]>:
After setting

smtp_sender_dependent_authentication = yes

and adding additional credentials postfix rejects change with

#root@postgate01:~# nano /etc/postfix/smtp_auth
 
[securegw.intern]:25        user1:password
[securegw.intern]:25        user2:password

root@postgate01:~# more /etc/postfix/relayhost_maps
@customer1.de    [securegw.intern]:25
@customer2.de    [securegw.intern]:25

#root@postgate01:~# postmap /etc/postfix/smtp_auth
#postmap: warning: /etc/postfix/smtp_auth.db: duplicate entry: "[securegw.intern]:25"
#root@postgate01:~# /etc/init.d/postfix reload && /etc/init.d/postfix restart
#[ ok ] Reloading postfix configuration (via systemctl): postfix.service.
#[ ok ] Restarting postfix (via systemctl): postfix.service.

I would like to route different customers to same relayhost but with different credentials.

Am Mo., 5. Nov. 2018 um 20:47 Uhr schrieb Wietse Venema <[hidden email]>:
Stefan Bauer:
> Hi,
>
> i have:
> sender_dependent_relayhost_maps = hash:/etc/postfix/relayhost_maps
> smtp_sasl_password_maps = hash:/etc/postfix/smtp_auth
>
> more /etc/postfix/relayhost_maps
> @mydomain.de    [smtp.1und1.de]:587
> @my2domain.de [smtp.1und1.de]:587
>
> more /etc/postfix/smtp_auth
> [smtp.1und1.de]:587    mydomain:mydomainpass
>
> How can i specify different credentials for same relayhost?

smtp_sender_dependent_authentication = yes

This will first index smtp_sasl_password_maps with the sender
address, then the host, then the next-hop domain (whatever that
happens to be).

        Wietse

> mails from my2domain.de should be relayed through 1und1 but with its own
> credentials.
>
> Thank you.
>
> Stefan
Reply | Threaded
Open this post in threaded view
|

Re: sender_dependent_relayhost_maps with different credentials for same relayhost

Viktor Dukhovni
> On Nov 22, 2018, at 4:32 AM, Stefan Bauer <[hidden email]> wrote:
>
> Found it. Was required to modify smtp_auth to
>
> customer1.de user1:password
> customer2.de user2:password.

Nope:

  http://www.postfix.org/SASL_README.html#client_sasl_sender

Generally, with Postfix lookups by email address, the lookup key is either
the full localpart@domain address, or an "@domain" wildcard, as e.g. with
all address rewriting tables, ...

The primary exceptions are access(5) lookups and transport(5) lookups,
which use the bare domain.

--
        Viktor.