I have some web application which is used as a webmail client to exchange. I can pull emails from exchange server via IMAP, but problem is at sending mails.
Application is using MSMTP client to send mails, and I have installed local postfix mail server to relay all emails to exchange as described in the post:
and I also added Frontend recieve connector on exchange for practicular IP address of postfix server.
When I send a test email to postfix via msmtp i always recieve:
websrv1 postfix/smtp: 8618411EF7F: to=<firstname.lastname@example.org>, relay=mail.domain.com[192.168.10.2]:587, delay=5, delays=0.01/0/0.02/5, dsn=5.7.1, status=bounced (host mail.domain.com[192.168.10.2] said: 530 5.7.1 Client was not authenticated (in reply to MAIL FROM command))
So, what I need to do for this to work?
The msmtp client config:
account default logfile /home/app/msmtp_default.log host localhost port 25 from email@example.com keepbcc off auth off tls off tls_certcheck off
Exchange server version is 2016.
I've done authentication, now I receive another error from exchange server:
5.7.1 Client does not have permissions to send as this sender (in reply to end of DATA command))
I am using authenticated relay, so my postfix server connects as particular user. What permissions I need to add to this user to be able to relay emails to exchange?