ComposantsComponents › InternetInternet
Envoie un e-mail par un serveur SMTP : destinataires, copie et copie cachée, objet, texte ou HTML, pièces jointes et en-têtes ajoutés. La connexion peut être chiffrée (SSL ou STARTTLS) et authentifiée (mot de passe ou jeton OAuth2). Le client est celui de Jakarta Mail 1.6.7. Le composant ne fait qu'envoyer : pour relever une boîte aux lettres, prenez un tPOP. Sends an email through an SMTP server: recipients, copy and blind copy, subject, text or HTML, attachments and added headers. The connection can be encrypted (SSL or STARTTLS) and authenticated (password or OAuth2 token). The client is the one of Jakarta Mail 1.6.7. The component only sends: to fetch a mailbox, take a tPOP.
EntréeInput
Aucune : il peut commencer un sous-job (un message). Sinon un lien Main (un message par ligne, dont les colonnes servent dans les champs) ou Iterate (un message par itération). None: it can start a subjob (one message). Otherwise one Main link (one message per row, whose columns can be used in the fields) or Iterate link (one message per iteration).
SortieOutput
Un lien Main : chaque ligne reçue est transmise telle quelle, après l'envoi de son message. One Main link: each received row is passed on as it is, after its message is sent.
Déclencheurs en sortieOutput triggers
On Subjob Ok On Subjob Error On Component Ok On Component Error Run if
Le fichier écrit par le premier sous-job part en pièce jointe ; l'objet peut citer un compteur, "Export : " + globalMap.get("tFileOutputDelimited_1_NB_LINE") + " lignes". Relié par On Subjob Error, le même composant prévient d'un échec.
The file written by the first subjob goes as an attachment; the subject can quote a counter, "Export: " + globalMap.get("tFileOutputDelimited_1_NB_LINE") + " rows". Connected with On Subjob Error, the same component reports a failure.
Chaque ligne reçue envoie son propre message, avec sa propre connexion au serveur. Les champs utilisent ses colonnes : À row1.email, Objet "Bonjour " + row1.name (voir l'exemple).
Each received row sends its own message, over its own connection to the server. The fields use its columns: To row1.email, Subject "Bonjour " + row1.name (see the example).
"UTF-8" et, pour un message HTML, le Sous-type MIME à HTML.
In the advanced settings, set the charset to "UTF-8" and, for an HTML message, the MIME subtype to HTML.
Les libellés sont ceux de l'onglet Composant, dans son ordre ; le nom technique, en gris, est celui du paramètre dans le fichier du job. Les champs de texte sont des expressions Java : une valeur fixe s'écrit entre guillemets. Labels are those of the Component tab, in its order; the technical name, in grey, is the parameter name in the job file. Text fields are Java expressions: a fixed value is written in quotes.
| ParamètreSetting | DéfautDefault | VisibleShown | Description |
|---|---|---|---|
| ÀToTO | "receiver@example.com" |
ToujoursAlways |
Destinataires, séparés par , ou ; (changé en ,). L'adresse est lue sans contrôle strict : une espace sépare aussi deux adresses, et "alice@example.com, bob at example.com" a donné quatre destinataires (alice@example.com, bob, at, example.com). Vide : l'envoi échoue (No recipient addresses).
Recipients, separated by , or ; (changed into ,). The address is read without strict checking: a space also separates two addresses, and "alice@example.com, bob at example.com" gave four recipients (alice@example.com, bob, at, example.com). Empty: sending fails (No recipient addresses).
|
| DeFromFROM | "send@example.com" |
ToujoursAlways |
Adresse de l'expéditeur : en-tête From et commande MAIL FROM, où reviennent les avis de non-remise. Beaucoup de serveurs n'acceptent que l'adresse du compte authentifié.
Sender address: From header and MAIL FROM command, where non-delivery reports come back. Many servers only accept the address of the authenticated account.
|
| Afficher le nom de l'expéditeur ?Show sender's name?NEED_PERSONAL_NAME | NonNo | ToujoursAlways |
Cochée, le nom accompagne l'adresse : From: Talaxie ETL <etl@example.com>.
Checked, the name comes with the address: From: Talaxie ETL <etl@example.com>.
|
| Nom de l'expéditeurSendernamePERSONAL_NAME | "sender" |
Afficher le nom cochéShow sender's name checked | Nom affiché. Avec des accents, il est encodé comme l'objet. Displayed name. With accented letters, it is encoded like the subject. |
| CcCC | "carbon@example.com" |
ToujoursAlways |
Copie, adresses comme pour À, en-tête Cc. "" : pas de copie. Laissée à sa valeur par défaut, une copie part vers carbon@example.com.
Copy, addresses as for To, Cc header. "": no copy. Left at its default value, a copy goes to carbon@example.com.
|
| BccBCC | "blindcarbon@example.com" |
ToujoursAlways |
Copie cachée : destinataires donnés au serveur (RCPT TO) mais absents des en-têtes du message. Même remarque que Cc pour la valeur par défaut.
Blind copy: recipients given to the server (RCPT TO) but absent from the message headers. Same remark as Cc for the default value.
|
| ObjetSubjectSUBJECT | "Talaxie Open Studio notification" |
ToujoursAlways |
Objet du message. Avec des caractères non ASCII, il est encodé en UTF-8 (=?UTF-8?Q?…?=), le jeu de caractères de Java dans les jobs Talaxie, quel que soit l'Ensemble de caractères des paramètres avancés.
Subject of the message. With non-ASCII characters, it is encoded in UTF-8 (=?UTF-8?Q?…?=), the Java character set in Talaxie jobs, whatever the charset of the advanced settings.
|
| MessageMESSAGE | "Hello" |
ToujoursAlways |
Corps du message, une expression Java ; les retours à la ligne tapés entre les guillemets deviennent des \n. L'expression est évaluée trois fois par message (test du vide, puis valeur). Vide ou null : le message envoyé contient deux guillemets "" (voir Pièges).
Body of the message, a Java expression; line breaks typed between the quotes become \n. The expression is evaluated three times per message (empty test, then value). Empty or null: the sent message holds two quotes "" (see Pitfalls).
|
| Arrêter le Job si les pièces jointes n'existent pas.Die if the attachment file doesn't exist.CHECK_ATTACHMENT | OuiYes | ToujoursAlways |
Cochée : un fichier absent fait échouer l'envoi (IOException while sending message), en pleine transmission (voir Pièges). Décochée : le fichier absent est sauté sans message, les autres partent.
Checked: a missing file makes sending fail (IOException while sending message), in the middle of the transmission (see Pitfalls). Unchecked: the missing file is skipped without a message, the others go.
|
| Pièces jointesAttachmentsATTACHMENTS | videempty | ToujoursAlways |
Une ligne par fichier. Fichier : expression du chemin, sur la machine du job ; un dossier joint tous ses fichiers, sans ses sous-dossiers. Encodage du transfert de contenu : Par défaut (choisi par Jakarta Mail, 7bit pour un texte ASCII) ou Base64 (toujours). Un nom de fichier accentué est encodé (=?UTF-8?Q?r=C3=A9sum=C3=A9…?=).
One row per file. File: expression of the path, on the machine of the job; a folder attaches all its files, without its subfolders. Content Transfer Encoding: Default (chosen by Jakarta Mail, 7bit for an ASCII text) or Base64 (always). An accented file name is encoded (=?UTF-8?Q?r=C3=A9sum=C3=A9…?=).
|
| Autres en-têtesOther headersHEADERS | videempty | ToujoursAlways |
Clé et Valeur, deux expressions : en-têtes posés sur le message (X-Job, Reply-To…). Un en-tête déjà présent est remplacé.
Key and Value, two expressions: headers set on the message (X-Job, Reply-To…). A header already present is replaced.
|
| Hôte SMTPSMTP hostSMTP_HOST | "smtp.provider.com" |
ToujoursAlways | Nom ou adresse du serveur SMTP. Name or address of the SMTP server. |
| Port SMTPSMTP portSMTP_PORT | 25 |
ToujoursAlways |
Un nombre, ou une expression de type String : le code généré range le port dans une variable String, une expression d'un autre type (variable de contexte int) ne compile pas.
A number, or an expression of type String: the generated code stores the port in a String variable, an expression of another type (int context variable) does not compile.
|
| Support de SSLSSL SupportSSL | NonNo | ToujoursAlways | Connexion chiffrée dès l'ouverture (SMTPS, port 465 en général). Voir Sécurité. Connection encrypted from the start (SMTPS, port 465 usually). See Security. |
| Support de STARTTLSSTARTTLS SupportSTARTTLS | NonNo | ToujoursAlways | Passe au chiffrement après la connexion, si le serveur le propose (port 587, ou 25). Un serveur qui ne le propose pas reçoit le message en clair, sans erreur (voir Sécurité). Switches to encryption after the connection, if the server offers it (port 587, or 25). A server that does not offer it receives the message in clear, without an error (see Security). |
| ImportanceIMPORTANCE | Normal | ToujoursAlways |
Haute, Normal ou Basse : en-tête X-Priority à 1, 3 ou 5.
High, Normal or Low: X-Priority header set to 1, 3 or 5.
|
| Mode d'authentificationAuthentication modeAUTH_MODE | SimpleBasic | Toujours (groupe Authentification)Always (Authentication group) | Aucune authentification, Simple (utilisateur et mot de passe) ou OAuth2 (utilisateur et jeton). Voir L'authentification. No Auth, Basic (user and password) or OAuth2 (user and token). See Authentication. |
| UtilisateurUsernameAUTH_USERNAME | "username" |
Simple ou OAuth2Basic or OAuth2 | Compte sur le serveur SMTP, souvent l'adresse e-mail. Account on the SMTP server, often the email address. |
| Mot de passePasswordAUTH_PASSWORD | "password" |
SimpleBasic |
Mot de passe du compte. Une valeur entre guillemets est chiffrée dans le code généré ; une expression (context.smtpPassword) est reprise telle quelle.
Password of the account. A value in quotes is encrypted in the generated code; an expression (context.smtpPassword) is used as is.
|
| Jeton d'accès OAuthOAuth Access TokenTOKEN | "password" |
OAuth2OAuth2 |
Jeton d'accès déjà obtenu auprès du fournisseur : le composant ne le demande ni ne le renouvelle. Il est envoyé tel quel par le mécanisme XOAUTH2.
Access token already obtained from the provider: the component neither requests nor renews it. It is sent as is through the XOAUTH2 mechanism.
|
| Arrêter en cas d'erreurDie on errorDIE_ON_ERROR | OuiYes | ToujoursAlways | Cochée : une erreur arrête le job (sauf lien d'erreur). Décochée : elle est écrite sur la sortie d'erreur du job, le message n'est pas envoyé et le job continue (voir les erreurs). Checked: an error stops the job (unless an error link). Unchecked: it is written to the error output of the job, the message is not sent and the job goes on (see Errors). |
| ParamètreSetting | DéfautDefault | VisibleShown | Description |
|---|---|---|---|
| Sous-type MIME provenant du type MIME texteMIME subtype from the 'text' MIME typeTEXT_SUBTYPE | Plein textePlain Text | ToujoursAlways |
Plein texte (text/plain) ou HTML (text/html). En HTML, le message ne contient que cette version, sans texte brut de secours.
Plain Text (text/plain) or HTML (text/html). In HTML, the message only holds this version, with no fallback plain text.
|
| Ensemble de caractères utilisé pour encoder le messagecharset used for encoding messageENCODING | "ISO-8859-15" |
ToujoursAlways |
Jeu de caractères du corps seulement. Un caractère qui n'existe pas en ISO-8859-15 devient ? : l'apostrophe typographique ’ et le tiret – l'ont été lors de nos essais (€ et œ passent). Choisissez "UTF-8".
Character set of the body only. A character that does not exist in ISO-8859-15 becomes ?: the typographic apostrophe ’ and the dash – did in our runs (€ and œ go through). Choose "UTF-8".
|
| Définir l'hôte localSet localhostSET_LOCALHOST | NonNo | ToujoursAlways |
Cochée : Localhost est le nom que le client donne au serveur dans la commande EHLO. Décochée, Jakarta Mail donne celui du poste ; lors de nos essais, son adresse IP. Certains serveurs refusent un nom qui ne se résout pas.
Checked: Localhost is the name that the client gives to the server in the EHLO command. Unchecked, Jakarta Mail gives the one of the machine; in our runs, its IP address. Some servers reject a name that does not resolve.
|
| LocalhostLOCALHOST | "localhost" |
Définir l'hôte local cochéSet localhost checked |
Nom envoyé après EHLO, par exemple celui de la machine du job ("etl01.example.com").
Name sent after EHLO, for example the one of the job machine ("etl01.example.com").
|
| Utiliser l'authentification sur deux lignes pour OAuth2Use two line authentication for OAuth2USE_TWO_LINE_TOKEN | NonNo | OAuth2OAuth2 |
Pose la propriété mail.smtp.auth.xoauth2.two.line.authentication.format, que Jakarta Mail 1.6.7 ne connaît que pour POP3 : sans effet, le jeton est parti sur la ligne AUTH XOAUTH2 case cochée ou non.
Sets the mail.smtp.auth.xoauth2.two.line.authentication.format property, which Jakarta Mail 1.6.7 only knows for POP3: no effect, the token went on the AUTH XOAUTH2 line whether checked or not.
|
| Propriétés personnaliséesCustom propertiesCONFIGS | videempty | ToujoursAlways |
Clé et Valeur, deux expressions : propriétés de Jakarta Mail, comme "mail.smtp.timeout", "mail.smtp.connectiontimeout" (en millisecondes), "mail.smtp.starttls.required", "mail.smtp.ssl.checkserveridentity" ou "mail.debug". Elles sont posées dans les propriétés système de la JVM et jamais retirées (voir Pièges).
Key and Value, two expressions: Jakarta Mail properties, such as "mail.smtp.timeout", "mail.smtp.connectiontimeout" (in milliseconds), "mail.smtp.starttls.required", "mail.smtp.ssl.checkserveridentity" or "mail.debug". They are set in the system properties of the JVM and never removed (see Pitfalls).
|
Le composant ne publie aucune variable propre. Comme pour tout composant, le message d'une erreur est rangé dans ERROR_MESSAGE (String), y compris quand Arrêter en cas d'erreur est décochée :
The component publishes no variable of its own. As for any component, the message of an error is stored in ERROR_MESSAGE (String), also when Die on error is unchecked:
((String) globalMap.get("tSendMail_1_ERROR_MESSAGE"))
C'est la première ligne de l'exception, sans sa cause : Could not connect to SMTP host: smtp.example.com, port: 465 sans le PKIX path building failed qui suit dans la console.
It is the first line of the exception, without its cause: Could not connect to SMTP host: smtp.example.com, port: 465 without the PKIX path building failed that follows in the console.
Ce que fait chaque mode, lu dans le modèle du composant, et ce qu'a reçu notre serveur SMTP d'essai (utilisateur demo, mot de passe demo, jeton demo-token, tous fictifs).
What each mode does, read in the template of the component, and what our test SMTP server received (user demo, password demo, token demo-token, all fictitious).
| ModeMode | Ce que fait le composantWhat the component does | Lors de nos essaisIn our runs |
|---|---|---|
| Aucune authentificationNo Auth | mail.smtp.auth à false : aucune commande AUTH.mail.smtp.auth set to false: no AUTH command. |
Un serveur qui exige l'authentification refuse à la commande MAIL FROM : 530 5.7.0 Authentication required.A server that requires authentication rejects at the MAIL FROM command: 530 5.7.0 Authentication required. |
| SimpleBasic | Donne l'utilisateur et le mot de passe à Jakarta Mail, qui choisit parmi les méthodes que le serveur annonce (avec un serveur qui annonçait LOGIN et PLAIN : LOGIN).Gives the user and the password to Jakarta Mail, which chooses among the methods that the server announces (with a server that announced LOGIN and PLAIN: LOGIN). |
AUTH LOGIN, puis l'utilisateur et le mot de passe encodés en base64 (ZGVtbw== pour demo), lisibles par quiconque voit passer la connexion si elle n'est pas chiffrée. Un serveur qui n'annonce pas AUTH a reçu le message sans authentification, sans erreur.AUTH LOGIN, then the user and the password encoded in base64 (ZGVtbw== for demo), readable by anyone who sees the connection pass if it is not encrypted. A server that does not announce AUTH received the message without authentication, without an error. |
| OAuth2OAuth2 | Seul le mécanisme XOAUTH2 (mail.smtp.auth.mechanisms), avec l'utilisateur et le Jeton d'accès OAuth.Only the XOAUTH2 mechanism (mail.smtp.auth.mechanisms), with the user and the OAuth Access Token. |
AUTH XOAUTH2 dXNlcj1kZW1vAWF1dGg9QmVhcmVyIGRlbW8tdG9rZW4BAQ==, soit user=demo, auth=Bearer demo-token en base64. Un jeton refusé donne une AuthenticationFailedException dont le message est la réponse codée du serveur.AUTH XOAUTH2 dXNlcj1kZW1vAWF1dGg9QmVhcmVyIGRlbW8tdG9rZW4BAQ==, that is user=demo, auth=Bearer demo-token in base64. A rejected token gives an AuthenticationFailedException whose message is the encoded answer of the server. |
Un jeton OAuth2 expire vite, souvent au bout d'une heure : obtenez-le juste avant l'envoi (par exemple avec un tRESTClient vers le service de jetons du fournisseur) et passez-le par une variable de contexte ou globale. An OAuth2 token expires quickly, often after one hour: obtain it just before sending (for example with a tRESTClient to the token service of the provider) and pass it through a context or global variable.
Jobs lancés depuis Talaxie (Java 21) contre un serveur SMTP d'essai installé sur le poste, qui journalise la conversation (lignes S: envoyées par le serveur, C: reçues du client) et enregistre chaque message reçu. Les journaux et les messages sont copiés tels quels, à quelques remplacements près : nom du job par MyJob, adresse du poste par 192.0.2.10, hôte, port et chemins d'essai par smtp.example.com, le port usuel et C:\data. Sauf mention contraire : Hôte SMTP du serveur d'essai, De "etl@example.com", À "demo@example.com", Cc et Bcc vides, Définir l'hôte local coché avec "client.example.com".
Jobs started from Talaxie (Java 21) against a test SMTP server installed on the machine, which logs the conversation (S: lines sent by the server, C: received from the client) and saves each received message. Logs and messages are copied as they are, with a few replacements: job name with MyJob, machine address with 192.0.2.10, test host, port and paths with smtp.example.com, the usual port and C:\data. Unless stated otherwise: SMTP host of the test server, From "etl@example.com", To "demo@example.com", Cc and Bcc empty, Set localhost checked with "client.example.com".
À "alice@example.com;bob@example.com", Cc "ops@example.com", Bcc "archive@example.com", nom de l'expéditeur "Talaxie ETL", Objet "Chargement terminé : 1 204 lignes", Importance Haute, en-tête "X-Job" = "MyJob", aucune authentification, jeu de caractères par défaut. Message, saisi sur plusieurs lignes :
To "alice@example.com;bob@example.com", Cc "ops@example.com", Bcc "archive@example.com", sender name "Talaxie ETL", Subject "Chargement terminé : 1 204 lignes", Importance High, header "X-Job" = "MyJob", no authentication, default charset. Message, typed over several lines:
"Bonjour,
Le chargement du " + TalendDate.formatDate("dd/MM/yyyy", TalendDate.parseDate("yyyy-MM-dd", "2026-11-21")) + " est terminé.
1 204 lignes, 3 rejets."
Journal du serveur, sans les lignes du message (données après DATA), montrées ensuite :
Server log, without the lines of the message (data after DATA), shown next:
S: 220 mail.example.com ESMTP demo server C: EHLO client.example.com S: 250-mail.example.com Hello client.example.com S: 250-SIZE 10485760 S: 250-8BITMIME S: 250 HELP C: MAIL FROM:<etl@example.com> S: 250 2.1.0 Ok C: RCPT TO:<alice@example.com> S: 250 2.1.5 Ok C: RCPT TO:<bob@example.com> S: 250 2.1.5 Ok C: RCPT TO:<ops@example.com> S: 250 2.1.5 Ok C: RCPT TO:<archive@example.com> S: 250 2.1.5 Ok C: DATA S: 354 End data with <CR><LF>.<CR><LF> C: . S: 250 2.0.0 Ok: queued as DEMO0022 C: QUIT S: 221 2.0.0 Bye
Message reçu par le serveur : Message received by the server:
Date: Sat, 21 Nov 2026 15:41:49 +0100 (CET) From: Talaxie ETL <etl@example.com> To: alice@example.com, bob@example.com Cc: ops@example.com Message-ID: <1157740463.1.1795272109139@[192.0.2.10]> Subject: =?UTF-8?Q?Chargement_termin=C3=A9_:_1_204_lignes?= MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="----=_Part_0_1622006612.1795272109114" X-Job: MyJob X-Priority: 1 ------=_Part_0_1622006612.1795272109114 Content-Type: text/plain; charset=ISO-8859-15 Content-Transfer-Encoding: quoted-printable Bonjour, Le chargement du 21/11/2026 est termin=E9. 1 204 lignes, 3 rejets. ------=_Part_0_1622006612.1795272109114--
Les quatre adresses sont données au serveur (RCPT TO), mais archive@example.com (Bcc) n'apparaît pas dans le message. Le message est toujours en plusieurs parties (multipart/mixed), même sans pièce jointe. L'objet est encodé en UTF-8, le corps en ISO-8859-15 (=E9 pour é). Le tJava relié par On Subjob Ok s'est exécuté, job terminé avec le code 0.
The four addresses are given to the server (RCPT TO), but archive@example.com (Bcc) does not appear in the message. The message is always multipart (multipart/mixed), even without an attachment. The subject is encoded in UTF-8, the body in ISO-8859-15 (=E9 for é). The tJava connected with On Subjob Ok ran, job ended with code 0.
Pièces jointes : "C:/data/rapport.csv" (Par défaut), "C:/data/résumé été.txt" (Base64), le dossier "C:/data/pj" (Par défaut), qui contient a.txt, b.txt et un sous-dossier. Parties du message reçu, après le texte :
Attachments: "C:/data/rapport.csv" (Default), "C:/data/résumé été.txt" (Base64), the "C:/data/pj" folder (Default), which holds a.txt, b.txt and a subfolder. Parts of the received message, after the text:
------=_Part_0_745160567.1795272140336 Content-Type: application/octet-stream; name=rapport.csv Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=rapport.csv id;client;montant 1;Durand;120,50 2;Martin;89,90 ------=_Part_0_745160567.1795272140336 Content-Type: text/plain; charset=UTF-8; name="=?UTF-8?Q?r=C3=A9sum=C3=A9_=C3=A9t=C3=A9.txt?=" Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="=?UTF-8?Q?r=C3=A9sum=C3=A9_=C3=A9t=C3=A9.txt?=" UsOpc3Vtw6kgZGUgbCfDqXTDqSA6IDMgcmVqZXRzLgo= ------=_Part_0_745160567.1795272140336 Content-Type: text/plain; charset=us-ascii; name=a.txt Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=a.txt fichier a ------=_Part_0_745160567.1795272140336 Content-Type: text/plain; charset=us-ascii; name=b.txt Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=b.txt fichier b ------=_Part_0_745160567.1795272140336--
Le type vient de l'extension : .csv est inconnu de la bibliothèque et part en application/octet-stream, .txt en text/plain. Le fichier du sous-dossier n'est pas joint.
The type comes from the extension: .csv is unknown to the library and goes as application/octet-stream, .txt as text/plain. The file of the subfolder is not attached.
Support de STARTTLS coché, mode Simple, serveur qui n'annonce l'authentification qu'après le passage au chiffrement ; certificat du serveur reconnu par la JVM du job (argument -Djavax.net.ssl.trustStore). Journal du serveur jusqu'à MAIL FROM :
STARTTLS Support checked, Basic mode, server that only announces authentication after switching to encryption; server certificate trusted by the JVM of the job (-Djavax.net.ssl.trustStore argument). Server log up to MAIL FROM:
S: 220 mail.example.com ESMTP demo server C: EHLO client.example.com S: 250-mail.example.com Hello client.example.com S: 250-SIZE 10485760 S: 250-8BITMIME S: 250-STARTTLS S: 250 HELP C: STARTTLS S: 220 2.0.0 Ready to start TLS --- TLS TLSv1.3 TLS_AES_256_GCM_SHA384 C: EHLO client.example.com S: 250-mail.example.com Hello client.example.com S: 250-SIZE 10485760 S: 250-8BITMIME S: 250-AUTH LOGIN PLAIN S: 250 HELP C: AUTH LOGIN S: 334 VXNlcm5hbWU6 C: ZGVtbw== S: 334 UGFzc3dvcmQ6 C: ZGVtbw== S: 235 2.7.0 Authentication successful C: MAIL FROM:<etl@example.com>
La ligne --- TLS est notée par le serveur : la suite passe chiffrée. Avec Support de SSL sur le port SMTPS, la même conversation commence directement chiffrée, sans STARTTLS.
The --- TLS line is written by the server: what follows goes encrypted. With SSL Support on the SMTPS port, the same conversation starts encrypted straight away, without STARTTLS.
Sous-type MIME HTML, Ensemble de caractères "UTF-8", Message "<h1>Rapport</h1><p>1 204 lignes <b>chargées</b>.</p>". Partie texte du message reçu :
MIME subtype HTML, charset "UTF-8", Message "<h1>Rapport</h1><p>1 204 lignes <b>chargées</b>.</p>". Text part of the received message:
------=_Part_0_403424356.1795272120906 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable <h1>Rapport</h1><p>1 204 lignes <b>charg=C3=A9es</b>.</p> ------=_Part_0_403424356.1795272120906--
Mode OAuth2, Utilisateur "demo", Jeton d'accès OAuth "demo-token". Journal du serveur jusqu'à MAIL FROM :
OAuth2 mode, Username "demo", OAuth Access Token "demo-token". Server log up to MAIL FROM:
S: 220 mail.example.com ESMTP demo server C: EHLO client.example.com S: 250-mail.example.com Hello client.example.com S: 250-SIZE 10485760 S: 250-8BITMIME S: 250-AUTH LOGIN PLAIN XOAUTH2 S: 250 HELP C: AUTH XOAUTH2 dXNlcj1kZW1vAWF1dGg9QmVhcmVyIGRlbW8tdG9rZW4BAQ== S: 235 2.7.0 Authentication successful C: MAIL FROM:<etl@example.com>
Le serveur annonce aussi LOGIN et PLAIN : seul XOAUTH2 est essayé. Même conversation avec Utiliser l'authentification sur deux lignes cochée.
The server also announces LOGIN and PLAIN: only XOAUTH2 is tried. Same conversation with Use two line authentication checked.
Deux lignes (email, name) : alice@example.com, Alice et bob@example.com, Bob. À row1.email, Objet "Bonjour " + row1.name, Message "Votre rapport est prêt, " + row1.name + ".". Lignes du journal propres à chaque message :
Two rows (email, name): alice@example.com, Alice and bob@example.com, Bob. To row1.email, Subject "Bonjour " + row1.name, Message "Votre rapport est prêt, " + row1.name + ".". Log lines specific to each message:
--- session 55 (15:44:22) C: RCPT TO:<alice@example.com> C| Subject: Bonjour Alice C| Votre rapport est pr=EAt, Alice. --- session 56 (15:44:22) C: RCPT TO:<bob@example.com> C| Subject: Bonjour Bob C| Votre rapport est pr=EAt, Bob.
Une connexion par ligne (deux sessions). Le tJava a affiché tFixedFlowInput_1_NB_LINE = 2. Relié par Main à un tLogRow, le tSendMail lui a passé les deux lignes inchangées (alice@example.com|Alice, bob@example.com|Bob).
One connection per row (two sessions). The tJava printed tFixedFlowInput_1_NB_LINE = 2. Connected with Main to a tLogRow, the tSendMail passed the two rows on unchanged (alice@example.com|Alice, bob@example.com|Bob).
mail.debugSeeing the conversation: mail.debug
Propriétés personnalisées : "mail.debug" = "true". Jakarta Mail écrit alors la conversation dans la console du job (extrait, début de l'envoi) :
Custom properties: "mail.debug" = "true". Jakarta Mail then writes the conversation into the job console (excerpt, start of the sending):
DEBUG: Jakarta Mail version 1.6.7 … DEBUG SMTP: useEhlo true, useAuth false DEBUG SMTP: trying to connect to host "smtp.example.com", port 25, isSSL false 220 mail.example.com ESMTP demo server DEBUG SMTP: connected to host "smtp.example.com", port: 25 EHLO client.example.com 250-mail.example.com Hello client.example.com 250-SIZE 10485760 250-8BITMIME 250 HELP DEBUG SMTP: Found extension "SIZE", arg "10485760" DEBUG SMTP: Found extension "8BITMIME", arg "" DEBUG SMTP: Found extension "HELP", arg "" DEBUG SMTP: use8bit false MAIL FROM:<etl@example.com> 250 2.1.0 Ok
Le contenu du message suit, en entier. Pratique pour un essai, à retirer ensuite : la propriété reste posée pour tous les tSendMail suivants du job (voir Pièges). The content of the message follows, in full. Handy for a test, to remove afterwards: the property stays set for all the following tSendMail of the job (see Pitfalls).
Messages relevés dans la console (première ligne de l'exception et, en retrait, sa cause ; hôte, port et chemins remplacés). Avec Arrêter en cas d'erreur coché, l'exception arrête le job avec le code 1, sauf si un lien On Component Error ou On Subjob Error la reprend. Messages seen in the console (first line of the exception and, indented, its cause; host, port and paths replaced). With Die on error checked, the exception stops the job with code 1, unless an On Component Error or On Subjob Error link takes it over.
| CasCase | Message |
|---|---|
| Rien n'écoute sur le portNothing listens on the port | com.sun.mail.util.MailConnectException: Couldn't connect to host, port: smtp.example.com, 25; timeout -1;java.net.ConnectException: Connection refused: connect |
| À videEmpty To | javax.mail.SendFailedException: No recipient addresses |
| Mot de passe refuséPassword rejected | javax.mail.AuthenticationFailedException: 535 5.7.8 Error: authentication failed (réponse du serveur)javax.mail.AuthenticationFailedException: 535 5.7.8 Error: authentication failed (answer of the server) |
| Jeton OAuth2 refuséOAuth2 token rejected | javax.mail.AuthenticationFailedException: 334 eyJzdGF0dXMiOiI0MDEiLCJzY2hlbWVzIjoiYmVhcmVyIiwic2NvcGUiOiJtYWlsIn0= (l'erreur du serveur, en base64), cause OAUTH2 asked for morejavax.mail.AuthenticationFailedException: 334 eyJzdGF0dXMiOiI0MDEiLCJzY2hlbWVzIjoiYmVhcmVyIiwic2NvcGUiOiJtYWlsIn0= (the error of the server, in base64), cause OAUTH2 asked for more |
| Serveur qui exige l'authentification, Aucune authentificationServer that requires authentication, No Auth | com.sun.mail.smtp.SMTPSendFailedException: 530 5.7.0 Authentication required |
| Serveur qui exige STARTTLS, case décochéeServer that requires STARTTLS, box unchecked | com.sun.mail.smtp.SMTPSendFailedException: 530 5.7.0 Must issue a STARTTLS command first |
| Certificat non reconnu, STARTTLSCertificate not trusted, STARTTLS | javax.mail.MessagingException: Could not convert socket to TLS;javax.net.ssl.SSLHandshakeException: (certificate_unknown) PKIX path building failed: … |
| Certificat non reconnu, SSLCertificate not trusted, SSL | javax.mail.MessagingException: Could not connect to SMTP host: smtp.example.com, port: 465;javax.net.ssl.SSLHandshakeException: (certificate_unknown) PKIX path building failed: … |
| Support de SSL vers un port non chiffréSSL Support to a plain port | javax.mail.MessagingException: Could not connect to SMTP host: smtp.example.com, port: 25;javax.net.ssl.SSLException: Unsupported or unrecognized SSL message |
| Support de STARTTLS vers le port SSLSTARTTLS Support to the SSL port | aucun : le job attend sans fin (arrêté au bout de 20 s lors de nos essais). Avec "mail.smtp.timeout" = "5000" : javax.mail.MessagingException: Exception reading response; puis java.net.SocketTimeoutException: Read timed out au bout de 5 s.none: the job waits forever (stopped after 20 s in our runs). With "mail.smtp.timeout" = "5000": javax.mail.MessagingException: Exception reading response; then java.net.SocketTimeoutException: Read timed out after 5 s. |
| Pièce jointe absente, Arrêter le Job… cochéMissing attachment, Die if… checked | javax.mail.MessagingException: IOException while sending message;java.io.FileNotFoundException: C:\data\absent.csv (Le fichier spécifié est introuvable) |
tSendMail_1 suivi d'un tJava par On Subjob Ok seulement, rien n'écoute sur le port. Pile abrégée : tSendMail_1 followed by a tJava through On Subjob Ok only, nothing listens on the port. Shortened stack:
Exception in component tSendMail_1 (MyJob) com.sun.mail.util.MailConnectException: Couldn't connect to host, port: smtp.example.com, 25; timeout -1; nested exception is: java.net.ConnectException: Connection refused: connect at com.sun.mail.smtp.SMTPTransport.openServer(SMTPTransport.java:2210) …
Le tJava n'est pas exécuté ; le job se termine avec le code 1. timeout -1 : aucun délai de connexion n'est fixé par défaut.
The tJava is not run; the job ends with code 1. timeout -1: no connection timeout is set by default.
Même job, case décochée ; le tJava relié par On Subjob Ok affiche tSendMail_1_ERROR_MESSAGE :
Same job, box unchecked; the tJava connected with On Subjob Ok prints tSendMail_1_ERROR_MESSAGE:
com.sun.mail.util.MailConnectException: Couldn't connect to host, port: smtp.example.com, 25; timeout -1; nested exception is: java.net.ConnectException: Connection refused: connect tJava_1 (On Subjob Ok): ERROR_MESSAGE = Couldn't connect to host, port: smtp.example.com, 25; timeout -1
Les trois premières lignes partent sur la sortie d'erreur du job ; le job continue et se termine avec le code 0. Seul ERROR_MESSAGE garde la trace de l'échec : testez-le si l'envoi compte.
The first three lines go to the error output of the job; the job goes on and ends with code 0. Only ERROR_MESSAGE keeps a trace of the failure: test it if the sending matters.
Support de STARTTLS demande le chiffrement seulement si le serveur l'annonce. Contre un serveur qui ne l'annonce pas, le message est parti en clair, sans erreur : STARTTLS Support asks for encryption only if the server announces it. Against a server that does not announce it, the message went in clear, without an error:
S: 220 mail.example.com ESMTP demo server C: EHLO client.example.com S: 250-mail.example.com Hello client.example.com S: 250-SIZE 10485760 S: 250-8BITMIME S: 250 HELP C: MAIL FROM:<etl@example.com>
Un intermédiaire qui retire STARTTLS de la réponse lirait donc le message, et l'authentification Simple si le serveur l'annonçait. Ajoutez la propriété personnalisée "mail.smtp.starttls.required" = "true" : le même envoi a alors échoué avec javax.mail.MessagingException: STARTTLS is required but host does not support STARTTLS, avant MAIL FROM.
A middleman that removes STARTTLS from the answer would thus read the message, and the Basic authentication if the server announced it. Add the custom property "mail.smtp.starttls.required" = "true": the same sending then failed with javax.mail.MessagingException: STARTTLS is required but host does not support STARTTLS, before MAIL FROM.
En SSL comme en STARTTLS, le certificat doit être signé par une autorité que la JVM reconnaît, mais Jakarta Mail 1.6.7 ne compare pas son nom à l'Hôte SMTP par défaut : un certificat reconnu mais établi pour mail.other.example.com a été accepté, l'authentification et le message envoyés.
With SSL as with STARTTLS, the certificate must be signed by an authority that the JVM trusts, but by default Jakarta Mail 1.6.7 does not compare its name with the SMTP host: a trusted certificate issued for mail.other.example.com was accepted, the authentication and the message sent.
La propriété personnalisée "mail.smtp.ssl.checkserveridentity" = "true" active le contrôle : la même connexion a échoué (java.io.IOException: Can't verify identity of server: …). Ce contrôle compare l'Hôte SMTP aux noms DNS du certificat : donnez un nom, pas une adresse IP, qui a échoué même avec un certificat valable pour cette adresse.
The custom property "mail.smtp.ssl.checkserveridentity" = "true" turns the check on: the same connection failed (java.io.IOException: Can't verify identity of server: …). This check compares the SMTP host with the DNS names of the certificate: give a name, not an IP address, which failed even with a certificate valid for that address.
Le composant chiffre avec la fabrique SSL par défaut de Java : le certificat doit être reconnu par le magasin de la JVM (cacerts), sinon PKIX path building failed. Pour un serveur interne ou un certificat autosigné, donnez au job un magasin de confiance : un tSetKeystore placé avant, ou les arguments de JVM -Djavax.net.ssl.trustStore=… et -Djavax.net.ssl.trustStorePassword=….
The component encrypts with the default SSL factory of Java: the certificate must be trusted by the store of the JVM (cacerts), otherwise PKIX path building failed. For an internal server or a self-signed certificate, give the job a trust store: a tSetKeystore placed before, or the JVM arguments -Djavax.net.ssl.trustStore=… and -Djavax.net.ssl.trustStorePassword=….
Un Mot de passe ou un Jeton écrit entre guillemets est chiffré dans le code généré, mais la clé qui le déchiffre est livrée avec le job : quiconque a le job peut le retrouver. Passez-les par des variables de contexte chargées au lancement (tContextLoad). Sans chiffrement de la connexion, le mot de passe Simple passe en base64, lisible. A Password or a Token written in quotes is encrypted in the generated code, but the key that decrypts it ships with the job: anyone who has the job can recover it. Pass them through context variables loaded at start (tContextLoad). Without an encrypted connection, the Basic password goes in base64, readable.
Composant déposé tel quel, seuls l'hôte et le port changés. Journal du serveur : Component dropped as it is, only the host and the port changed. Server log:
C: EHLO 192.0.2.10 S: 250-mail.example.com Hello 192.0.2.10 S: 250-SIZE 10485760 S: 250-8BITMIME S: 250 HELP C: MAIL FROM:<send@example.com> S: 250 2.1.0 Ok C: RCPT TO:<receiver@example.com> S: 250 2.1.5 Ok C: RCPT TO:<carbon@example.com> S: 250 2.1.5 Ok C: RCPT TO:<blindcarbon@example.com> S: 250 2.1.5 Ok
Cc et Bcc ont des valeurs par défaut : changer seulement À laisse partir deux copies vers ces adresses. Videz-les (""). Le mode Simple par défaut n'a rien envoyé : ce serveur n'annonçait pas l'authentification.
Cc and Bcc have default values: changing only To lets two copies go to these addresses. Empty them (""). The default Basic mode sent nothing: this server did not announce authentication.
Le composant pose ses réglages dans les propriétés système de la JVM. Il retire l'hôte, le port, SSL et STARTTLS à la fin, mais pas les Propriétés personnalisées ni le mécanisme OAuth2. tSendMail_1 en OAuth2, puis un tJava, puis tSendMail_2 en Simple vers le même serveur : The component sets its settings in the system properties of the JVM. It removes the host, the port, SSL and STARTTLS at the end, but not the Custom properties nor the OAuth2 mechanism. tSendMail_1 in OAuth2, then a tJava, then tSendMail_2 in Basic to the same server:
tJava_1: mail.smtp.auth.mechanisms = XOAUTH2 Exception in component tSendMail_2 (MyJob) javax.mail.AuthenticationFailedException: 334 eyJzdGF0dXMiOiI0MDEiLCJzY2hlbWVzIjoiYmVhcmVyIiwic2NvcGUiOiJtYWlsIn0= …
Le serveur a reçu de tSendMail_2 AUTH XOAUTH2 dXNlcj1kZW1vAWF1dGg9QmVhcmVyIGRlbW8BAQ== : son mot de passe, envoyé comme jeton. De même, "mail.debug" posé sur tSendMail_1 a fait afficher la conversation de tSendMail_2. Défaut du modèle (tSendMail_main.javajet : propriétés personnalisées posées lignes 107 à 111, mécanisme OAuth2 lignes 129 à 139, retrait des autres lignes 244 à 270). Évitez de mêler les modes dans un job, ou reposez la propriété vous-même dans un tJava : System.clearProperty("mail.smtp.auth.mechanisms");. Les propriétés système valent pour toute la JVM : un job enfant lancé par tRunJob sans processus séparé les voit aussi.
The server received from tSendMail_2 AUTH XOAUTH2 dXNlcj1kZW1vAWF1dGg9QmVhcmVyIGRlbW8BAQ==: its password, sent as a token. Likewise, "mail.debug" set on tSendMail_1 made the conversation of tSendMail_2 print. Template defect (tSendMail_main.javajet: custom properties set at lines 107 to 111, OAuth2 mechanism at lines 129 to 139, the others removed at lines 244 to 270). Avoid mixing the modes in a job, or reset the property yourself in a tJava: System.clearProperty("mail.smtp.auth.mechanisms");. System properties apply to the whole JVM: a child job started by tRunJob without a separate process sees them too.
""An empty message holds ""
Message "" (ou (String) null). Partie texte du message reçu :
Message "" (or (String) null). Text part of the received message:
Content-Type: text/plain; charset=ISO-8859-15 Content-Transfer-Encoding: 7bit ""
Défaut du modèle (tSendMail_main.javajet, ligne 102) : un message vide est remplacé par le texte "\"\"", deux guillemets, au lieu d'un texte vide. Pour un message sans corps, mettez au moins une espace : " ".
Template defect (tSendMail_main.javajet, line 102): an empty message is replaced with the text "\"\"", two quotes, instead of an empty text. For a message without a body, put at least a space: " ".
Une pièce jointe absente, Arrêter le Job… coché. Le fichier n'est ouvert qu'au moment d'écrire le message : la conversation est déjà engagée. Journal du serveur : One missing attachment, Die if… checked. The file is only opened when the message is written: the conversation is already under way. Server log:
C: RCPT TO:<demo@example.com> S: 250 2.1.5 Ok C: DATA S: 354 End data with <CR><LF>.<CR><LF> C: . S: 250 2.0.0 Ok: queued as DEMO0030
Le job échoue (IOException while sending message), mais le client a terminé les données sans rien envoyer et notre serveur a accepté un message vide, qu'un vrai serveur pourrait distribuer. Vérifiez les fichiers avant l'envoi (tFileExist et un lien Run if).
The job fails (IOException while sending message), but the client ended the data without sending anything and our server accepted an empty message, which a real server could deliver. Check the files before sending (tFileExist and a Run if link).
Sans délai, un serveur qui ne répond pas bloque le job : Support de STARTTLS vers le port SSL a attendu sans fin. Posez "mail.smtp.connectiontimeout" et "mail.smtp.timeout" (millisecondes) dans les Propriétés personnalisées. Les mêmes propriétés passées en arguments de JVM (-Dmail.smtp.timeout=5000) sont lues aussi : le composant travaille sur les propriétés système.
Without a timeout, a server that does not answer blocks the job: STARTTLS Support to the SSL port waited forever. Set "mail.smtp.connectiontimeout" and "mail.smtp.timeout" (milliseconds) in the Custom properties. The same properties given as JVM arguments (-Dmail.smtp.timeout=5000) are read too: the component works on the system properties.
Message "L’été – 3 € – œuvre", jeu de caractères par défaut. Corps reçu :
Message "L’été – 3 € – œuvre", default charset. Received body:
L?=E9t=E9 ? 3 =A4 ? =BDuvre
L'apostrophe et les tirets sont devenus ?. L'objet, lui, est parti intact (UTF-8). Passez l'Ensemble de caractères à "UTF-8".
The apostrophe and the dashes became ?. The subject itself went intact (UTF-8). Set the charset to "UTF-8".
Les adresses ne sont pas contrôlées : "bob at example.com" est devenu trois destinataires (RCPT TO:<bob>, <at>, <example.com>), que notre serveur a acceptés. Un vrai serveur les refuse en général, et l'envoi échoue alors pour tous les destinataires. Contrôlez les adresses en amont (tSchemaComplianceCheck, tFilterRow).
Addresses are not checked: "bob at example.com" became three recipients (RCPT TO:<bob>, <at>, <example.com>), which our server accepted. A real server usually rejects them, and sending then fails for all recipients. Check the addresses upstream (tSchemaComplianceCheck, tFilterRow).
Sans Définir l'hôte local, la commande EHLO a porté l'adresse IP du poste, et l'en-tête Message-ID la contient dans tous les cas (…@[192.0.2.10]) : le message révèle l'adresse de la machine du job. Certains serveurs refusent un EHLO sans nom valable ; donnez-en un.
Without Set localhost, the EHLO command carried the IP address of the machine, and the Message-ID header holds it in all cases (…@[192.0.2.10]): the message reveals the address of the job machine. Some servers reject an EHLO without a valid name; give one.
Les composants qui servent avec le tSendMail : The components used with the tSendMail:
tPOP · relève une boîte aux lettres (POP3, IMAP)fetches a mailbox (POP3, IMAP)tFileInputMail · lit un message enregistréreads a saved messagetSetKeystore · donne au job le magasin qui reconnaît le serveurgives the job the store that trusts the servertFileExist · vérifie une pièce jointe avant l'envoichecks an attachment before sendingtFixedFlowInput · fournit une ligne par messageprovides one row per messagetContextLoad · charge le mot de passe hors du jobloads the password outside the job