Bonjour,
Je dois faire communiquer un serveur Debian avec Exchange Online (faisant partie d’Office 365) en s’authentifiant avec un compte utilisateur Exchange. Les comptes utilisateurs sont gérés uniquement par Office 365 (pas d’AD)
Remarque : Avec Exchange, il est également possible d’utiliser la fonction de serveur relais mais ce n’est pas une authentification avec un compte utilisateur.
En dehors des configurations ci dessous, les autres fichiers de configuration sont ceux générés par la configuration par défaut.
Versions utilisées :
Debian : 7.4
Exim4 + Exim4-base + Exim4-config + Exim4-daemon-light : 4.80-7
cat /etc/exim4/update-exim4.conf.conf
dc_eximconfig_configtype=‘smarthost’
dc_other_hostnames=’'
dc_local_interfaces=‘127.0.0.1 ; ::1’
dc_readhost=’‘
dc_relay_domains=’'
dc_minimaldns=‘false’
dc_relay_nets=’'
dc_smarthost='smtp.office365.com::587’
CFILEMODE='644’
dc_use_split_config='false’
dc_hide_mailname='false’
dc_mailname_in_oh='true’
dc_localdelivery=‘mail_spool’
cat /etc/exim4/passwd.client
smtp.office365.com:server-debian@mydomain.com:password
cat /etc/email-addresses
user: me@mydomain.com
root: me@mydomain.com
cat /etc/aliases
root: me@mydomain.com
user: me@mydomain.com
Paramètre SMTP pour Exchange Online
Nom de serveur : smtp.office365.com
Port : 587
Méthode de chiffrement : TLS
Test d’envoi d’un message et log :
/usr/sbin/exim4 -v me@mydomain.com
from: server-debian@mydomain.com
to: me@mydomain.com
subject: test
message
.
LOG: MAIN
<= server-debian@mydomain.com U=root P=local S=357
root@servername:/# delivering 1WimKT-00086V-SP
R: smarthost for me@mydomain.com
T: remote_smtp_smarthost for me@mydomain.com
Transport port=25 replaced by host-specific port=587
Connecting to outlook-emeasouth.office365.com [2a01:111:f400:9414::12]:587 … connected
SMTP<< 220 DBXPR07CA011.outlook.office365.com Microsoft ESMTP MAIL Service ready at Fri, 9 May 2014 15:04:37 +0000
SMTP>> EHLO servername
SMTP<< 250-DBXPR07CA011.outlook.office365.com Hello [IP server debian]
250-SIZE 78643200
250-PIPELINING
250-DSN
250-ENHANCEDSTATUSCODES
250-STARTTLS
250-8BITMIME
250-BINARYMIME
250 CHUNKING
SMTP>> STARTTLS
SMTP<< 220 2.0.0 SMTP server ready
SMTP>> EHLO servername
SMTP<< 250-DBXPR07CA011.outlook.office365.com Hello [IP server debian]
250-SIZE 78643200
250-PIPELINING
250-DSN
250-ENHANCEDSTATUSCODES
250-AUTH LOGIN
250-8BITMIME
250-BINARYMIME
250 CHUNKING
SMTP>> MAIL FROM:server-debian@mydomain.com SIZE=1391
SMTP>> RCPT TO:me@mydomain.com
SMTP>> DATA
SMTP<< 530 5.7.1 Client was not authenticated
LOG: MAIN
TLS error on connection to outlook-emeasouth.office365.com [2a01:111:f400:9414::12] (recv): A TLS packet with
unexpected length was received.
SMTP>> QUIT
LOG: MAIN
TLS error on connection to outlook-emeasouth.office365.com [2a01:111:f400:9414::12] (send): The specified session has been invalidated for some reason.
LOG: MAIN
** me@mydomain.com R=smarthost T=remote_smtp_smarthost: SMTP error from remote mail server after MAIL FROM:server-debian@mydomain.com SIZE=1391: host outlook-emeasouth.office365.com [2a01:111:f400:9414::12]: 530 5.7.1 Client was not authenticated
LOG: MAIN
<= <> R=1WimKT-00086V-SP U=Debian-exim P=local S=1356
delivering 1WimKy-00086n-3y
R: smarthost for server-debian@mydomain.com
T: remote_smtp_smarthost for me@mydomain.com
Transport port=25 replaced by host-specific port=587
Connecting to outlook-emeasouth.office365.com [2a01:111:f400:9800::2]:587 … connected
LOG: MAIN
Completed
SMTP<< 220 DBXPR03CA003.outlook.office365.com Microsoft ESMTP MAIL Service ready at Fri, 9 May 2014 15:04:42 +0000
SMTP>> EHLO servername
SMTP<< 250-DBXPR03CA003.outlook.office365.com Hello [IP server debian]
250-SIZE 78643200
250-PIPELINING
250-DSN
250-ENHANCEDSTATUSCODES
250-STARTTLS
250-8BITMIME
250-BINARYMIME
250 CHUNKING
SMTP>> STARTTLS
SMTP<< 220 2.0.0 SMTP server ready
SMTP>> EHLO servername
SMTP<< 250-DBXPR03CA003.outlook.office365.com Hello [IP server debian]
250-SIZE 78643200
250-PIPELINING
250-DSN
250-ENHANCEDSTATUSCODES
250-AUTH LOGIN
250-8BITMIME
250-BINARYMIME
250 CHUNKING
SMTP>> MAIL FROM:<> SIZE=2414
LOG: MAINRCPT TO:server-debian@mydomain.com
TLS error on connection to outlook-emeasouth.office365.com [2a01:111:f400:9800::2] (recv): A TLS packet with unexpected length was received.ot authenticated
SMTP>> QUIT
LOG: MAIN
TLS error on connection to outlook-emeasouth.office365.com [2a01:111:f400:9800::2] (send): The specified session has been invalidated for some reason.
LOG: MAIN
** server-debian@mydomain.com R=smarthost T=remote_smtp_smarthost: SMTP error from remote mail server after MAIL FROM:<> SIZE=2414: host outlook-emeasouth.office365.com [2a01:111:f400:9800::2]: 530 5.7.1 Client was not authenticated
LOG: MAIN
Frozen (delivery error message)
Qu’en pensez vous ?