My company has set recently set up an Active Directory driven Microsoft Exchange environment to consolidate outgoing mails. We do have a set of staging servers which should now use our MSEXCHG as smarthost for outgoing mail.
These servers are located in the DMZ, which is why the upvoted solution in Authenticating to Exchange 2010 smarthost? is not an alternative, as we cannot allow a server in the DMZ to just send mails willy-nilly via our Exchange server.
Things we have done in MSEXCHG:
- Add a user (stagingserver@contoso.com)
Things we have done in exim4 (8)
:
- Using
update-exim4.conf (8)
(c.f.exim4_files (5)
) we configured exim to useexchange.contoso.com:587
as a smarthost. - In passwd.client (
exim4_files (5)
) I have added the following line:exchange.contoso.com:stagingserver@activedirectory.contoso.com:secret123
)
After starting exim with the configuration described above, I get the following two TLS errors in mainlog:
TLS error on connection to ex.contoso.com [192.168.1.8] (recv): A TLS packet with unexpected length was received.
TLS error on connection to ex.contoso.com [192.168.1.8] (send): The specified session has been invalidated for some reason.
Our MSEXCHG then refuses to send the mail and the following (ultimate) log entry shows up:
** kiewiet@contoso.com R=smarthost T=remote_smtp_smarthost: SMTP error from remote mail server after MAIL FROM:<root@contoso-stage.com> SIZE=1538: host ex.contoso.com [192.168.1.8]: 530 5.7.1 Client was not authenticated
Further things I have tried:
- Put
MAIN_TLS_ENABLE = 1
intoexim4.conf.localmacros
(http://blog.xig.ch/Exim-Smarthost-mit-Authentifizierung-%FCber-STARTTLS_127.html) - Steps described in https://askubuntu.com/questions/167043/how-do-i-configure-exim4-to-send-mail-through-a-password-protected-ssl-smtp-mail
So, obligatory question: How can we get exim to use our MSEXCHG environment as smarthost?