Nous avons un programme de traitement par lots qui intègre JavaMail 1.2 qui envoie des courriels. Dans notre environnement de développement, nous n'avons pas eu l'occasion de rencontrer l'exception mentionnée ci-dessus. Mais dans l'environnement du client, ils avaient connu ce beaucoup de fois avec la trace d'erreur suivant:Exception de débogage de messagerie
javax.mail.MessagingException: 550 Requested action not taken: NUL characters are not allowed.
at com.sun.mail.smtp.SMTPTransport.issueCommand (SMTPTransport.java: 879)
at com.sun.mail.smtp.SMTPTransport.finishData (SMTPTransport.java: 820)
at com.sun.mail.smtp.SMTPTransport.sendMessage (SMTPTransport.java: 322)
...
Je ne sais pas si cela est lié à mon problème, http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4697158. Mais en essayant JavaMail 1.4.2, je vois que l'encodage de transfert de contenu de l'email est toujours 7bit, donc je ne suis pas sûr si l'utilisation de JavaMail 1.4.2 pourrait résoudre le problème. S'il vous plaît prendre note que je ne pouvais faire des tests dans notre environnement de développement qui n'a pas été en mesure de reproduire cela.
Avec l'exception ci-dessus, comment puis-je savoir si cela est du côté de l'expéditeur ou du destinataire? Quelles étapes de débogage pourriez-vous suggérer?
EDIT: Voici un DEBUG de l'envoi (masqué certaines informations) réelle:
DEBUG: not loading system providers in <java.home></a>/lib
DEBUG: not loading optional custom providers file: /META-INF/javamail.providers
DEBUG: successfully loaded default providers
DEBUG: Tables of loaded providers
DEBUG: Providers Listed By Class Name: {com.sun.mail.smtp.SMTPTransport=javax.mail.Provider[TRANSPORT,smtp,com.sun.mail.smtp.SMTPTransport,Sun Microsystems, Inc], com.sun.mail.imap.IMAPStore=javax.mail.Provider[STORE,imap,com.sun.mail.imap.IMAPStore,Sun Microsystems, Inc], com.sun.mail.pop3.POP3Store=javax.mail.Provider[STORE,pop3,com.sun.mail.pop3.POP3Store,Sun Microsystems, Inc]}
DEBUG: Providers Listed By Protocol: {imap=javax.mail.Provider[STORE,imap,com.sun.mail.imap.IMAPStore,Sun Microsystems, Inc], pop3=javax.mail.Provider[STORE,pop3,com.sun.mail.pop3.POP3Store,Sun Microsystems, Inc], smtp=javax.mail.Provider[TRANSPORT,smtp,com.sun.mail.smtp.SMTPTransport,Sun Microsystems, Inc]}
DEBUG: not loading optional address map file: /META-INF/javamail.address.map
DEBUG: getProvider() returning javax.mail.Provider[TRANSPORT,smtp,com.sun.mail.smtp.SMTPTransport,Sun Microsystems, Inc]
DEBUG SMTP: useEhlo true, useAuth false
DEBUG: SMTPTransport trying to connect to host "nnn.nnn.n.nnn", port nn
DEBUG SMTP RCVD: 220 xxxx.xxxxxxxxxxx.xxx SMTP; Mon, 23 Mar 2009 15:18:57 +0800
DEBUG: SMTPTransport connected to host "nnn.nnn.n.nnn", port: nn
DEBUG SMTP SENT: EHLO xxxxxxxxx
DEBUG SMTP RCVD: 250 xxxx.xxxxxxxxxxx.xxx Hello
DEBUG SMTP: use8bit false
DEBUG SMTP SENT: MAIL FROM:<a href="newmsg.cgi?mbx=Main&[email protected]"><[email protected]></a>
DEBUG SMTP RCVD: 250 <a href="newmsg.cgi?mbx=Main&[email protected]"><[email protected]></a>... Sender ok
DEBUG SMTP SENT: RCPT TO:<[email protected]>
DEBUG SMTP RCVD: 250 <[email protected]>... Recipient ok
Verified Addresses
[email protected]
DEBUG SMTP SENT: DATA
DEBUG SMTP RCVD: 354 Enter mail, end with "." on a line by itself
DEBUG SMTP SENT:
.
DEBUG SMTP RCVD: 550 Requested action not taken: NUL characters are not allowed.
J'ai fait ce que vous avez suggéré et mis à jour mon poste avec le journal DEBUG – rizza