diff options
| author | Gab <24553253+gabrix73@users.noreply.github.com> | 2026-06-29 00:13:23 +0200 |
|---|---|---|
| committer | Gab <24553253+gabrix73@users.noreply.github.com> | 2026-06-29 00:13:23 +0200 |
| commit | 1d1d06c025be8b16a3535ecceffc26fe303977db (patch) | |
| tree | cc814b265bcaa2711f092f53349cc66068a6256a /send.php | |
| parent | 322a17dba0d44200f6c241b18a58761220050aba (diff) | |
| download | m2usenet-and-mail2news-1d1d06c025be8b16a3535ecceffc26fe303977db.tar.gz m2usenet-and-mail2news-1d1d06c025be8b16a3535ecceffc26fe303977db.tar.xz m2usenet-and-mail2news-1d1d06c025be8b16a3535ecceffc26fe303977db.zip | |
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
Diffstat (limited to 'send.php')
| -rw-r--r-- | send.php | 24 |
1 files changed, 22 insertions, 2 deletions
@@ -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; |
