Impossible de rétablir l'envoie des emails pour un utilisateur

Espace asso “cvn.frama.space”

  1. Je me connecte en tant qu’admin
  2. Je vais dans utilisateurs et j’ouvre la fiche utilisateur d’un membre
  3. le status e-mail indique que cet utilisateur ne souhaite plus recevoir d’email
  4. je clique sur le bouton “rétablir les envois à cette adresse”
  5. Dans la fenêtre de confirmation je clique sur “Envoyer un message de vérification”
  6. Je reçois le message d’erreur suivant :

Erreur interne

Désolé mais le serveur a rencontré une erreur interne et ne peut répondre à votre requête. Merci de ré-essayer plus tard.

Si vous suspectez un bug dans Paheko, vous pouvez suivre ces instructions pour le rapporter.

Un-e responsable a été notifié-e et cette erreur sera corrigée dès que possible.

L'erreur a été enregistrée dans les journaux système (error.log) sous la référence : 4mbcyb59

← Retour à la page d’accueil

Bonjour,

Pouvez-vous réessayer ?
Le souci semble être avec le logiciel Paheko, qui semble avoir mal géré la connexion au serveur mail (cc @bohwaz, je sais pas s’il pourrait y avoir un réessai ou bien une erreur plus appropriée).

[27-Apr-2026 11:46:50 Europe/Paris] =========== Error ref. d16xzhfi ===========

KD2\SMTP_Exception: SMTP error on HELO: 501 Syntactically invalid HELO argument(s) in /var/www/paheko/production/src/include/lib/KD2/SMTP.php:194
Stack trace:
#0 /var/www/paheko/production/src/include/lib/KD2/SMTP.php(252): KD2\SMTP->authenticate()
#1 /var/www/paheko/production/src/include/lib/KD2/SMTP.php(423): KD2\SMTP->rawSend(‹ … ›, Array, ‹ … ›)
#2 /var/www/paheko/production/src/include/lib/Paheko/Email/Emails.php(698): KD2\SMTP->send(Object(KD2\Mail_Message))
#3 /var/www/paheko/production/src/include/lib/Paheko/Email/Emails.php(671): Paheko\Email\Emails::sendMessage(0, Object(KD2\Mail_Message), true)
#4 /var/www/paheko/production/src/include/lib/Paheko/Email/Emails.php(385): Paheko\Email\Emails::send(0, ‹ … ›, Array, ‹ … ›, NULL, NULL, Array, true)
#5 /var/www/paheko/production/src/include/lib/Paheko/Email/Emails.php(245): Paheko\Email\Emails::runQueue(0)
#6 /var/www/paheko/production/src/include/lib/Paheko/Email/Templates.php(27): Paheko\Email\Emails::queue(0, Array, NULL, ‹ … ›, ‹ … ›)
#7 /var/www/paheko/production/src/include/lib/Paheko/Email/Templates.php(51): Paheko\Email\Templates::send(‹ … ›, ‹ … ›, Array)
#8 /var/www/paheko/production/src/include/lib/Paheko/Entities/Email/Email.php(78): Paheko\Email\Templates::verifyAddress(‹ … ›, ‹ … ›)
#9 /var/www/paheko/production/src/www/admin/users/mailing/verify.php(27): Paheko\Entities\Email\Email->sendVerification(‹ … ›)
#10 [internal function]: Paheko{closure}()
#11 /var/www/paheko/production/src/include/lib/Paheko/Form.php(29): call_user_func(Object(Closure))
#12 /var/www/paheko/production/src/include/lib/Paheko/Form.php(80): Paheko\Form->run(Object(Closure), ‹ … ›, ‹ … ›, true)
#13 /var/www/paheko/production/src/www/admin/users/mailing/verify.php(26): Paheko\Form->runIf(‹ … ›, Object(Closure), ‹ … ›, ‹ … ›, true)
#14 {main}

{ "errors": [ { "message": "SMTP error on HELO: 501 Syntactically invalid HELO argument(s)", "errorCode": 501, "type": "KD2\\SMTP_Exception", "backtrace": [ { "file": "...\/include\/lib\/KD2\/SMTP.php", "line": 194, "code": { "190": "", "191": "\t\t\t$code = $this->_writeAndGetCode('HELO');", "192": "", "193": "\t\t\tif ($code !== self::SUCCESS_CODE) {", "194": "\t\t\t\tthrow new SMTP_Exception('SMTP error on HELO: ' . $this->last_line, $code);", "195": "\t\t\t}", "196": "\t\t}", "197": "", "198": "\t\tif ($this->secure === self::STARTTLS) {" } }, { "function": "KD2\\SMTP->authenticate", "file": "...\/include\/lib\/KD2\/SMTP.php", "line": 252, "code": { "248": "\t\t}", "249": "", "250": "\t\tif (is_null($this->conn)) {", "251": "\t\t\t$this->connect();", "252": "\t\t\t$this->authenticate();", "253": "\t\t}", "254": "", "255": "\t\t$code = $this->_writeAndGetCode('RSET');", "256": "" } }, { "function": "KD2\\SMTP->rawSend", "file": "...\/include\/lib\/KD2\/SMTP.php", "line": 423, "args": { "$from": "string(41) \"XXX\"", "$to": "array(1) {\n [0]=> string(30) \"XXX\"\n }", "$data": "string(702) \"From: \"XXX\" \r\nTo: XXX\r\nSubject: Confirmez votre adresse e-mail\r\nReply-To: XXX\r\nMessage-Id: <69ef308a9bf1c.ks4acesjyu@~.*\\.paheko\\.frama.space>\r\nReturn-Path: XXX\r\nX-Auto-Response-Suppress: All\r\nDate: Mon, 27 Apr 2026 11:46:50 +0200\r\nContent-Type: text\/plain; charset=utf-8\r\nContent-Transfer-Encoding: quoted-printable\r\n\r\nPour v=C3=A9rifier votre adresse e-mail pour notre association,=0Amerci de =\r\nbien vouloir cliquer sur le lien ci-dessous :=0A=0Ahttps:\/\/XXX.paheko.frama=\r\n.space\/?un=XXXv=XXX\"" }, "code": { "419": "\t\t\textract($msg);", "420": "\t\t}", "421": "", "422": "\t\t\/\/ Send email", "423": "\t\treturn $this->rawSend($from, $to, $message);", "424": "\t}", "425": "", "426": "\t\/**", "427": "\t * Takes a string like a From, Cc, To or Bcc header and gets out all the email" } }, { "function": "KD2\\SMTP->send", "file": "...\/include\/lib\/Paheko\/Email\/Emails.php", "line": 698, "args": { "$r": "object(KD2\\Mail_Message) (5) {\n [\"\u0000*\u0000headers\"]=> array(7) {\n [\"from\"]=> string(78) \"\"XXX\" \"\n [\"to\"]=> string(30) \"XXX\"\n [\"subject\"]=> string(30) \"Confirmez votre adresse e-mail\"\n [\"reply-to\"]=> string(37) \"XXX\"\n [\"message-id\"]=> string(51) \"<69ef308a9bf1c.ks4acesjyu@~.*\\.paheko\\.frama.space>\"\n [\"return-path\"]=> string(41) \"XXX\"\n [\"x-auto-response-suppress\"]=> string(3) \"All\"\n }\n [\"\u0000*\u0000raw\"]=> string(0) \"\"\n [\"\u0000*\u0000parts\"]=> array(1) {\n [0]=> array(5) {\n [\"type\"]=> string(10) \"text\/plain\"\n [\"content\"]=> string(191) \"Pour v\u00e9rifier votre adresse e-mail pour notre association,\nmerci de bien vouloir cliquer sur le lien ci-dessous :\n\nhttps:\/\/XXX.paheko.frama.space\/?un=XXX&v=XXX\"\n [\"name\"]=> NULL\n [\"cid\"]=> NULL\n [\"encoding\"]=> NULL\n }\n }\n [\"\u0000*\u0000boundaries\"]=> array(0) {\n }\n [\"\u0000*\u0000output_boundary\"]=> string(29) \"==_=_69ef308a9be94-5311c30cc7\"\n }" }, "code": { "694": "\t\t\t\t$smtp = new SMTP(SMTP_HOST, SMTP_PORT, SMTP_USER, SMTP_PASSWORD, $secure, SMTP_HELO_HOSTNAME);", "695": "\t\t\t}", "696": "", "697": "\t\t\ttry {", "698": "\t\t\t\t$return = $smtp->send($message);", "699": "\t\t\t\t\/\/ TODO: store return message from SMTP server", "700": "\t\t\t}", "701": "\t\t\tcatch (SMTP_Exception $e) {", "702": "\t\t\t\t\/\/ Handle invalid recipients addresses" } }, { "function": "Paheko\\Email\\Emails::sendMessage", "file": "...\/include\/lib\/Paheko\/Email\/Emails.php", "line": 671, "args": { "$context": "int(0)", "$message": "object(KD2\\Mail_Message) (5) {\n [\"\u0000*\u0000headers\"]=> array(7) {\n [\"from\"]=> string(78) \"\"XXX\" \"\n [\"to\"]=> string(30) \"XXX\"\n [\"subject\"]=> string(30) \"Confirmez votre adresse e-mail\"\n [\"reply-to\"]=> string(37) \"XXX\"\n [\"message-id\"]=> string(51) \"<69ef308a9bf1c.ks4acesjyu@~.*\\.paheko\\.frama.space>\"\n [\"return-path\"]=> string(41) \"XXX\"\n [\"x-auto-response-suppress\"]=> string(3) \"All\"\n }\n [\"\u0000*\u0000raw\"]=> string(0) \"\"\n [\"\u0000*\u0000parts\"]=> array(1) {\n [0]=> array(5) {\n [\"type\"]=> string(10) \"text\/plain\"\n [\"content\"]=> string(191) \"Pour v\u00e9rifier votre adresse e-mail pour notre association,\nmerci de bien vouloir cliquer sur le lien ci-dessous :\n\nhttps:\/\/XXX.paheko.frama.space\/?un=XXX&v=XXX\"\n [\"name\"]=> NULL\n [\"cid\"]=> NULL\n [\"encoding\"]=> NULL\n }\n }\n [\"\u0000*\u0000boundaries\"]=> array(0) {\n }\n [\"\u0000*\u0000output_boundary\"]=> string(29) \"==_=_69ef308a9be94-5311c30cc7\"\n }", "$in_queue": "bool(true)" }, "code": { "667": "\t\tif ($pgp_key && $can_use_encryption) {", "668": "\t\t\t$message->encrypt($pgp_key);", "669": "\t\t}", "670": "", "671": "\t\treturn self::sendMessage($context, $message, $in_queue);", "672": "\t}", "673": "", "674": "\tstatic public function sendMessage(int $context, Mail_Message $message, bool $in_queue = false): bool", "675": "\t{" } }, { "function": "Paheko\\Email\\Emails::send", "file": "...\/include\/lib\/Paheko\/Email\/Emails.php", "line": 385, "args": { "$context": "int(0)", "$recipient_hash": "string(40) \"487e460e59451a3be773825e3791163677ee6e92\"", "$headers": "array(3) {\n [\"From\"]=> NULL\n [\"To\"]=> string(30) \"XXX\"\n [\"Subject\"]=> string(30) \"Confirmez votre adresse e-mail\"\n }", "$content": "string(191) \"Pour v\u00e9rifier votre adresse e-mail pour notre association,\nmerci de bien vouloir cliquer sur le lien ci-dessous :\n\nhttps:\/\/XXX.paheko.frama.space\/?un=XXX&v=XXX\"", "$content_html": "NULL", "$pgp_key": "NULL", "$attachments": "array(0) {\n }", "$in_queue": "bool(true)" }, "code": { "381": "", "382": "\t\t\ttry {", "383": "\t\t\t\t$attachments = $db->getAssoc('SELECT id, path FROM emails_queue_attachments WHERE id_queue = ?;', $row->id);", "384": "\t\t\t\t$all_attachments = array_merge($all_attachments, $attachments);", "385": "\t\t\t\t$sent = self::send($row->context, $row->recipient_hash, $headers, $row->content, $row->content_html, $row->recipient_pgp_key, $attachments, true);", "386": "", "387": "\t\t\t\t\/\/ Keep waiting until email is sent", "388": "\t\t\t\tif (!$sent) {", "389": "\t\t\t\t\tcontinue;" } }, { "function": "Paheko\\Email\\Emails::runQueue", "file": "...\/include\/lib\/Paheko\/Email\/Emails.php", "line": 245, "args": { "$context": "int(0)" }, "code": { "241": "\t\t\tself::runQueue();", "242": "\t\t}", "243": "\t\t\/\/ Always send system emails right away", "244": "\t\telseif ($is_system) {", "245": "\t\t\tself::runQueue(self::CONTEXT_SYSTEM);", "246": "\t\t}", "247": "\t}", "248": "", "249": "\t\/**" } }, { "function": "Paheko\\Email\\Emails::queue", "file": "...\/include\/lib\/Paheko\/Email\/Templates.php", "line": 27, "args": { "$context": "int(0)", "$recipients": "array(1) {\n [\"XXX\"]=> array(3) {\n [\"user\"]=> NULL\n [\"data\"]=> array(0) {\n }\n [\"pgp_key\"]=> NULL\n }\n }", "$sender": "NULL", "$subject": "string(30) \"Confirmez votre adresse e-mail\"", "$content": "string(191) \"Pour v\u00e9rifier votre adresse e-mail pour notre association,\nmerci de bien vouloir cliquer sur le lien ci-dessous :\n\nhttps:\/\/XXX.paheko.frama.space\/?un=XXX&v=XXX\"" }, "code": { "23": "\t\tif (!$subject) {", "24": "\t\t\tthrow new \\LogicException('Template did not define a subject');", "25": "\t\t}", "26": "", "27": "\t\tEmails::queue(Emails::CONTEXT_SYSTEM, (array)$to, null, $subject, $body);", "28": "\t}", "29": "", "30": "\tstatic public function loginChanged(User $user): void", "31": "\t{" } }, { "function": "Paheko\\Email\\Templates::send", "file": "...\/include\/lib\/Paheko\/Email\/Templates.php", "line": 51, "args": { "$to": "string(30) \"XXX\"", "$template": "string(16) \"verify_email.tpl\"", "$variables": "array(1) {\n [\"verify_url\"]=> string(75) \"https:\/\/XXX.paheko.frama.space\/?un=XXX&v=XXX\"\n }" }, "code": { "47": "\t}", "48": "", "49": "\tstatic public function verifyAddress(string $email, string $verify_url): void", "50": "\t{", "51": "\t\tself::send($email, 'verify_email.tpl', compact('verify_url'));", "52": "\t}", "53": "}", "54": "" } }, { "function": "Paheko\\Email\\Templates::verifyAddress", "file": "...\/include\/lib\/Paheko\/Entities\/Email\/Email.php", "line": 78, "args": { "$email": "string(30) \"XXX\"", "$verify_url": "string(75) \"https:\/\/XXX.paheko.frama.space\/?un=XXX&v=XXX\"" }, "code": { "74": "\t\t\tthrow new UserException('Adresse email inconnue');", "75": "\t\t}", "76": "", "77": "\t\t$verify_url = self::getOptoutURL($this->hash) . '&v=' . $this->getVerificationCode();", "78": "\t\tEmailsTemplates::verifyAddress($email, $verify_url);", "79": "\t}", "80": "", "81": "\tpublic function canSendVerificationAfterFail(): bool", "82": "\t{" } }, { "function": "Paheko\\Entities\\Email\\Email->sendVerification", "file": "...\/www\/admin\/users\/mailing\/verify.php", "line": 27, "args": { "$email": "string(30) \"XXX\"" }, "code": { "23": "", "24": "$csrf_key = 'send_verification';", "25": "", "26": "$form->runIf('send', function () use ($email, $address) {", "27": " $email->sendVerification($address);", "28": "}, $csrf_key, '!users\/mailing\/rejected.php?sent', true);", "29": "", "30": "$tpl->assign(compact('csrf_key', 'email'));", "31": "$tpl->display('users\/mailing\/verify.tpl');" } }, { "function": "Paheko\\{closure}" }, { "function": "call_user_func", "file": "...\/include\/lib\/Paheko\/Form.php", "line": 29, "args": { "$callback": "object(Closure) (1) {\n [0]=> *RECURSION*\n }" }, "code": { "25": "\t\t\tif (null !== $csrf_key && !\\KD2\\Form::tokenCheck($csrf_key)) {", "26": "\t\t\t\tthrow new ValidationException('Une erreur est survenue, merci de bien vouloir renvoyer le formulaire.', 401);", "27": "\t\t\t}", "28": "", "29": "\t\t\tcall_user_func($fn);", "30": "", "31": "\t\t\tif (null !== $redirect) {", "32": "\t\t\t\tif ($js) {", "33": "\t\t\t\t\thttp_response_code(204);" } }, { "function": "Paheko\\Form->run", "file": "...\/include\/lib\/Paheko\/Form.php", "line": 80, "args": { "$fn": "object(Closure) (1) {\n [0]=> *RECURSION*\n }", "$csrf_key": "string(17) \"send_verification\"", "$redirect": "string(32) \"!users\/mailing\/rejected.php?sent\"", "$follow_redirect": "bool(true)" }, "code": { "76": "\t\telseif (is_bool($condition) && !$condition) {", "77": "\t\t\treturn null;", "78": "\t\t}", "79": "", "80": "\t\treturn $this->run($fn, $csrf_key, $redirect, $follow_redirect);", "81": "\t}", "82": "", "83": "\tpublic function hasErrors()", "84": "\t{" } }, { "function": "Paheko\\Form->runIf", "file": "...\/www\/admin\/users\/mailing\/verify.php", "line": 26, "args": { "$condition": "string(4) \"send\"", "$fn": "object(Closure) (1) {\n [0]=> *RECURSION*\n }", "$csrf_key": "string(17) \"send_verification\"", "$redirect": "string(32) \"!users\/mailing\/rejected.php?sent\"", "$follow_redirect": "bool(true)" }, "code": { "22": "}", "23": "", "24": "$csrf_key = 'send_verification';", "25": "", "26": "$form->runIf('send', function () use ($email, $address) {", "27": " $email->sendVerification($address);", "28": "}, $csrf_key, '!users\/mailing\/rejected.php?sent', true);", "29": "", "30": "$tpl->assign(compact('csrf_key', 'email'));" } } ] } ], "context": { "date": "2026-04-27T11:46:50+02:00", "duration": 49.928903579711914, "environment": "production:5", "hostname": "~.*\\.paheko\\.frama.space", "http_files": "array(0) {\n }", "http_method": "POST", "http_post": "array(2) {\n [\"ct_bdc9b59c8ea13711e91dcbd6810547ae684f4613\"]=> string(87) \"***HIDDEN***\"\n [\"send\"]=> string(1) \"***HIDDEN***\"\n }", "http_referrer": "https:\/\/XXX.paheko.frama.space\/admin\/users\/mailing\/verify.php?address=XXX&_dialog", "http_user_agent": "Mozilla\/5.0 (X11; Ubuntu; Linux x86_64; rv:150.0) Gecko\/20100101 Firefox\/150.0", "id": "d16xzhfi", "language": "PHP 8.2.30", "memory_peak": 4194304, "memory_used": 4194304, "os": "Linux", "paheko_data_root": "XXX", "paheko_version": "1.3.15", "php_sapi": "fpm-fcgi", "remote_ip": "XXX", "root_directory": "\/var\/www\/paheko\/production\/src", "server_addr": "XXX", "sqlite_journal": "WAL", "user_addr": "XXX", "url": "https:\/\/XXX.paheko.frama.space\/admin\/users\/mailing\/verify.php?address=XXX&_dialog" } }

@tcit :

C’est pas un bug de Paheko mais un souci de config de votre côté, c’est visible dans le Message-Id : 69ef308a9bf1c.ks4acesjyu@~.*.paheko.frama.space

La partie host du Message-Id est comme le hostname du HELO créée à partir de $_SERVER['SERVER_NAME'] (si le PHP est exécuté par un serveur web), ou sinon avec gethostname() (si le PHP est exécuté en ligne de commande).

Si besoin, il est possible de configurer le HELO indépendemment avec la constante SMTP_HELO_HOSTNAME dans la config Paheko, c’est documenté :wink:

Edit : et aussi les messages sont placés en queue, et donc l’envoi sera réessayé après 3h si l’envoi a échoué, mais ici c’est une erreur 500 (fatale) donc conformément à la RFC on ne réessaie pas :slight_smile:

1 Like

On va regarder de plus près, mais en dehors de cette erreur le reste des mails est bien envoyé. J’imagine que c’est ligne de commande vs serveur web :thinking:

Merci pour les détails en tout cas !

Il est possible que vu que ici c’est un mail « système » il est envoyé immédiatement (via le serveur web) et pas par la queue. Et donc c’est le SERVER_NAME qui est utilisé et pas gethostname.

1 Like

Ça devrait être résolu avec l’ajout de la configuration pour SMTP_HELO_HOSTNAME.

1 Like

Je ne pourrai réésayer que dans 3 jours d’après Paheko. Merci pour la correction :+1: