FUDforum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » FUDforum Development » Bug Reports » Invalid email headers
Show: Today's Messages :: Polls :: Message Navigator
Return to the default flat view Create a new topic Submit Reply
Invalid email headers [message #188149] Fri, 16 July 2021 09:11 Go to previous message
JeanAbouSamra is currently offline  JeanAbouSamra   France
Messages: 7
Registered: July 2021
Karma:
Junior Member
Hello,

On a locally hosted instance of FUDforum, I am experiencing issues with mailing list synchronization.

- When I do not configure a custom SMTP server, no emails are sent at all (not just the posts, but also account confirmation emails).

- When I do configure an SMTP server, it sometimes fails, depending on the server and the mailing list address. When the SMTP is auth.smtp.1and1.fr, and the mailing list is on lists.gnu.org, mail delivery fails with replies like the following:

This message was created automatically by mail delivery software.

A message that you sent could not be delivered to one or more of
its recipients. This is a permanent error.

The following address failed:

lilypond-user-fr(at)gnu(dot)org:
SMTP error from remote server for TEXT command, host: eggs.gnu.org (209.51.188.92) reason: 550 Message headers fail syntax check


--- The header of the original message is following. ---

Received: from fudforum.localhost ([90.29.105.171]) by
 mrelayeu.kundenserver.de (mreue012 [212.227.15.168]) with ESMTPA (Nemesis) id
 1M91Tq-1m1abU45Xa-006Agp for <lilypond-user-fr(at)gnu(dot)org>; Fri, 16 Jul 2021
 10:55:07 +0200
Subject: Nouveau test
Date: Fri, 16 Jul 2021 10:55:07 +0200
To: lilypond-user-fr(at)gnu(dot)org
From: Administrator <jean(at)abou-samra(dot)fr>
Errors-To: Administrator <jean(at)abou-samra(dot)fr>
Return-Path: Administrator <jean(at)abou-samra(dot)fr>
X-Mailer: FUDforum v3.1.1
MIME-Version: 1.0
Content-Type: text/plain;
  charset="utf-8"
Content-Transfer-Encoding: 8bit
Organization: My forum, my way!
X-FUDforum: 8c9495fe7974471f9dc0168115731210 <3>
Message-ID: <3(dot)60f14969(at)fudforum(dot)localhost>
X-Provags-ID: V03:K1:5IUNE5rBW50JR/81TCYz9GTY3JGrtugb39n86zLqkbinTWxPotE
 owOWlfK8g3pgNPnzxyaqlpyC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5p8giWoia/UgsEK2XZ6jkNLia5lNitaS3yxZ7XA7R9BLUEosn+FSz+g1+D/5g

I've tried SMTP servers auth.smtp.1and1.fr and smtp.gmail.com, as well as recipients gmail.com, a personal address at 1and1, and gnu.org lists. Only the combination of sender auth.smtp.1and1.fr and recipient gnu.org triggers the failure.


As was suggested to me, I tried the following patch, to no avail:

diff --git a/install/forum_data/src/iemail.inc.t b/install/forum_data/src/iemail.inc.t
index be9d35037..ccff78d51 100644
--- a/install/forum_data/src/iemail.inc.t
+++ b/install/forum_data/src/iemail.inc.t
@@ -63,7 +63,14 @@ function send_email($from, $to, $subj, $body, $header='', $munge_newlines=1)
        if (strpos($header, 'MIME-Version') === false) {
                $extra_header = "\nMIME-Version: 1.0\nContent-Type: text/plain; charset={TEMPLATE: iemail_CHARSET}\nContent-Transfer-Encoding: 8bit". $header;
        }
-       $header = 'From: '. $from ."\nErrors-To: ". $from ."\nReturn-Path: ". $from ."\nX-Mailer: FUDforum v". $GLOBALS['FORUM_VERSION']. $extra_header. $header;
+
+    $addronly = preg_replace(".*<", "<", $from);
+    $header =
+        "From: $from\n" .
+        "Errors-To: $addronly\n" .
+        "Return-Path: $addronly\n" .
+        "X-Mailer: FUDforum v" . $GLOBALS['FORUM_VERSION'] .
+        $extra_header . $header;
 
        $body = str_replace("\r", '', $body);
        if ($munge_newlines) {
diff --git a/install/www_root/adm/admmassemail.php b/install/www_root/adm/admmassemail.php
index 4972fe148..9a96c02bc 100644
--- a/install/www_root/adm/admmassemail.php
+++ b/install/www_root/adm/admmassemail.php
@@ -71,8 +71,15 @@
                        $email_batch_cnt = 0;
                        $to = array();
 
+            $addronly = preg_replace(".*<", "<", $ADMIN_EMAIL);
                        if (!($FUD_OPT_1 & 512)) {      // Not USE_SMTP.
-                               $header = 'From: '. $ADMIN_EMAIL. "\r\nErrors-To: ". $ADMIN_EMAIL. "\r\nReply-To: ". $ADMIN_EMAIL. "\r\nX-Mailer: FUDforum v". $GLOBALS['FORUM_VERSION']. "\r\nMIME-Version: 1.0\r\nContent-Type: text/plain; charset=". $charset. "\r\nContent-Transfer-Encoding: 8bit";
+                               $header =
+                  'From: '. $addronly.
+                  "\r\nErrors-To: ". $addronly.
+                  "\r\nReply-To: ". $addronly.
+                  "\r\nX-Mailer: FUDforum v". $GLOBALS['FORUM_VERSION'].
+                  "\r\nMIME-Version: 1.0\r\nContent-Type: text/plain; charset=". $charset.
+                  "\r\nContent-Transfer-Encoding: 8bit";
                        
                                $_POST['body'] = str_replace("\n.", "\n..", $_POST['body']);
 
@@ -113,7 +120,7 @@
                                        }
                                }
                        } else {
-                               $header = 'Errors-To: '. $ADMIN_EMAIL. "\r\nReply-To: ". $ADMIN_EMAIL. "\r\nMIME-Version: 1.0\r\nContent-Type: text/plain; charset=". $charset. "\r\nContent-Transfer-Encoding: 8bit";
+                               $header = 'Errors-To: '. $addronly. "\r\nReply-To: ". $addronly. "\r\nMIME-Version: 1.0\r\nContent-Type: text/plain; charset=". $charset. "\r\nContent-Transfer-Encoding: 8bit";
 
                                $smtp = new fud_smtp;
                                $smtp->msg = str_replace("\n.", "\n..", $_POST['body']);
This was intended to strip the "Administrator" part from the fields, but they remain in the error message.

Any help would be appreciated.
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: FUDforum only tor-onion hosting
Next Topic: Unlocking then locking files results in wrong permissions
Goto Forum:
  

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ]

Current Time: Sun Dec 22 06:13:32 GMT 2024

Total time taken to generate the page: 0.05451 seconds