I tryed to manage with a postfix server, my goal is that :
When 1 special user (test@example.com) try to send mail, it will use routing (using a relay server is OK) but I don't understand how to send authentification to the relay server to be authorized to send mail. I do that on my main.cf file :
relay_domains =
$mydestination
proxy:mysql:/etc/postfix/mysql/relay_domains.cf
relay_recipient_maps =
mysql:/etc/postfix/mysql/relay_recipient_maps.cf
The first point is OK : I see that mail use relay specified into my mysql table to send mail The second point has an issue : I think user/passsword are not send to relay so my mail is refused on it. The file /etc/postfix/mysql/relay_recipient_maps.cf content is :
hosts = 127.0.0.1:3306
user = BDD_USER
password = BDD_PASS
dbname = BDD_DBNAME
query = SELECT authentification FROM domain WHERE domain='%s' LIMIT 1
And in MySQL, "authentification" field contain user:password for relay authentification inplain text
Regards and have a good day !