From 1d1d06c025be8b16a3535ecceffc26fe303977db Mon Sep 17 00:00:00 2001 From: Gab <24553253+gabrix73@users.noreply.github.com> Date: Mon, 29 Jun 2026 00:13:23 +0200 Subject: Update m2usenet UI and backend; add identicon renderer and nacl libs - index.php, send.php: updated client UI - m2usenet.go: backend changes - identicon.php: new identicon renderer - nacl.min.js, nacl-util.min.js: vendored client crypto libs --- send.php | 24 ++++++++++++++++++++++-- 1 file changed, 22 insertions(+), 2 deletions(-) (limited to 'send.php') diff --git a/send.php b/send.php index 05e6b21..36e93b0 100644 --- a/send.php +++ b/send.php @@ -19,10 +19,10 @@ ini_set('max_execution_time', 180); // SMTP Relay Configuration define('PRIMARY_RELAY', [ - 'host' => '4uwpi53u524xdphjw2dv5kywsxmyjxtk4facb76jgl3sc3nda3sz4fqd.onion', + 'host' => 'qee4i7sags6phsvb2yodwecfj7noimfhhalsjktsvikrwotxzis3raad.onion', 'port' => 25, 'mail2news' => 'mail2news@xilb7y4kj6u6qfo45o3yk2kilfv54ffukzei3puonuqlncy7cn2afwyd.onion', - 'name' => 'fog-primary' + 'name' => 'qee4-primary' ]); define('FALLBACK_RELAY', [ @@ -746,6 +746,26 @@ function sendViaNativePHPSMTP($data, $smtpRelay, $smtpPort, $mail2newsAddress) { if (!empty($data['x-ed25519-sig'])) { $headers[] = sprintf("X-Ed25519-Sig: %s", $data['x-ed25519-sig']); } + + // VFACE: regenerate the identicon Face: header with the ORIGINAL identicons-cli + // engine (same backend as identicons.virebent.art), from username|email|pubkey. + if (!empty($data['x-ed25519-pub']) && is_executable('/usr/local/bin/identicons-cli')) { + $vfName = trim(preg_replace('/\s*<[^>]*>\s*$/', '', $data['from'])); + $vfEmail = $matches[1] ?? ''; + $vfPub = trim($data['x-ed25519-pub']); + if ($vfName !== '' && $vfEmail !== '' && preg_match('#^[A-Za-z0-9+/=]+$#', $vfPub) + && strpos($vfName, '|') === false && strpos($vfEmail, '|') === false) { + $vfInput = $vfName . '|' . $vfEmail . '|' . $vfPub; + $vfCmd = '/usr/local/bin/identicons-cli -input ' . escapeshellarg($vfInput) . + ' -size 48 -transparent -format base64 2>/dev/null'; + $vfB64 = trim(shell_exec($vfCmd) ?? ''); + if ($vfB64 !== '' && preg_match('#^[A-Za-z0-9+/=]+$#', $vfB64)) { + // Single-line Face: header (216-char b64 ~222 octets, < RFC 5322 998 limit); + // avoids whitespace ending up inside the base64 after unfolding downstream. + $headers[] = 'Face: ' . $vfB64; + } + } + } if (!empty($data['references'])) { $refs = trim($data['references']); if (strpos($refs, '<') === false) $refs = '<' . $refs; -- cgit v1.2.3