Montego Scripts: Forums
 

 

View next topic
View previous topic
Post new topic   Reply to topic
Author Message
Slackervaara
Newbie
Newbie



Joined: Nov 03, 2007
Posts: 126

PostPosted: Sat Sep 13, 2008 12:30 am Reply with quote

I sent yesterday a newsletter to my 1000 members with valid email address. But approx 2 persons did not receive the newsletter, due to bad header. I got this error report from a mail server:

The message WAS NOT relayed to:
<v-01010@mail.com>:
554 5.6.0 Reject, id=20719-13 - BAD_HEADER: Non-encoded 8-bit data (char E5 hex): Subject: Nyhetsbrev fr\345n [...]

This nondelivery report was generated by the program amavisd-new at host
mail.com. Our internal reference code for your message is
20719-13/5oNblCLlp4hX

INVALID HEADER

Non-encoded 8-bit data (char E5 hex): Subject: Nyhetsbrev fr\345n [...]

The offending character was the Swedish national character å, but two other also exists äö. Other languages can also have similar problems like Nowegian, Danish and German.
 
View user's profile Send private message
montego
Site Admin/Owner
Site Admin/Owner



Joined: Feb 12, 2005
Posts: 1399

PostPosted: Sat Sep 13, 2008 11:57 am Reply with quote

Unfortunately, multi-language is not my strong suite. But, see if this thread helps:

http://montegoscripts.com/ftopict-81.html

Maybe UTF-8 can help?

If not, you may want to try using the TegoNuke(tm) Mailer with SMTP option and see if SwiftMailer (which handles the email header creation in the Mailer) handles this better.

_________________
“To err is human, but when the eraser wears out ahead of the pencil, you’re overdoing it.”
-- Josh Jenkins 
View user's profile Send private message Visit poster's website
Slackervaara
Newbie
Newbie



Joined: Nov 03, 2007
Posts: 126

PostPosted: Sat Sep 13, 2008 3:12 pm Reply with quote

I solved the problem by omitting Swedish national characters in the subject line and translated Newletter from to The newsletter -
This worked without any problems.
 
View user's profile Send private message
montego
Site Admin/Owner
Site Admin/Owner



Joined: Feb 12, 2005
Posts: 1399

PostPosted: Sat Sep 13, 2008 3:32 pm Reply with quote

Most excellent. Thanks for letting me know.

_________________
“To err is human, but when the eraser wears out ahead of the pencil, you’re overdoing it.”
-- Josh Jenkins 
View user's profile Send private message Visit poster's website
Slackervaara
Newbie
Newbie



Joined: Nov 03, 2007
Posts: 126

PostPosted: Tue Sep 16, 2008 1:23 am Reply with quote

I now discovered that identical error message occurs in the notifications emails from phpbb forum. The error message is made by the antivirus program Amavis of the web hotel. In another post I have read that the subject line of the program have to be changed and here is the code suggested for phpbb.

Code:

 function encode_iso88591($string)
   {
      $text = '=?iso-8859-1?q?';
   
      for( $i = 0 ; $i < strlen($string) ; $i++ )
      {
         $val = ord($string[$i]);
         if($val > 127 or $val == 63)
         {
            $val = dechex($val);
            $text .= '='.$val;
         }
         else
         {
            $text .= $string[$i];
         }
      }
      $text .= '?=';
 
      return $text;
   }


http://www.phpbb2.de/dload.php/archive/ftopic42416.html
 
View user's profile Send private message
montego
Site Admin/Owner
Site Admin/Owner



Joined: Feb 12, 2005
Posts: 1399

PostPosted: Tue Sep 16, 2008 7:20 am Reply with quote

Thank you for sharing this as others may find this useful. BTW, I am pretty sure that TegoNuke(tm) Mailer, which uses SwiftMailer, will handle this given that its claim is full RFC support in all areas of mailing.

My intent is to incorporate the Mailer into future versions of the Newsletter if I can ever get to them. Sad

_________________
“To err is human, but when the eraser wears out ahead of the pencil, you’re overdoing it.”
-- Josh Jenkins 
View user's profile Send private message Visit poster's website
Slackervaara
Newbie
Newbie



Joined: Nov 03, 2007
Posts: 126

PostPosted: Tue Sep 16, 2008 7:37 am Reply with quote

Will TegoNuke(tm) Mailer also take care of the mailing from the forum or is it just the newsletter? I have 7.6 with patch 3.3.
 
View user's profile Send private message
montego
Site Admin/Owner
Site Admin/Owner



Joined: Feb 12, 2005
Posts: 1399

PostPosted: Tue Sep 16, 2008 7:43 am Reply with quote

Ah, you are right, it does NOT. However, that is a planned upgrade. Glad you asked as I had forgotten. Sorry.

The reason is that the primary reason I had for creating the Mailer was just to get around the issue of hosts turning off PHP mail() function, therefore, requiring folks to use SMTP. Since phpBB already could do this, I didn't integrate.

_________________
“To err is human, but when the eraser wears out ahead of the pencil, you’re overdoing it.”
-- Josh Jenkins 
View user's profile Send private message Visit poster's website
Slackervaara
Newbie
Newbie



Joined: Nov 03, 2007
Posts: 126

PostPosted: Sat Sep 20, 2008 12:01 am Reply with quote

I have found an patch for emailer.php for the forum thats works:

Code:
--- includes/emailer.php.orig   2004-11-18 15:02:11.000000000 -0500
+++ includes/emailer.php        2005-04-23 23:03:12.000000000 -0400
@@ -194,6 +194,14 @@
                // Build header
                $this->extra_headers = (($this->reply_to != '') ? "Reply-to: $this->reply_to\n" : '') . (($this->from != '') ? "From: $this->from\n" : "From: " . $board_config['board_email'] . "\n") . "Return-Path: " . $board_config['board_email'] . "\nMessage-ID: <" . md5(uniqid(time())) . "@" . $board_config['server_name'] . ">\nMIME-Version: 1.0\nContent-type: text/plain; charset=" . $this->encoding . "\nContent-transfer-encoding: 8bit\nDate: " . date('r', time()) . "\nX-Priority: 3\nX-MSMail-Priority: Normal\nX-Mailer: PHP\nX-MimeOLE: Produced By phpBB2\n" . $this->extra_headers . (($cc != '') ? "Cc: $cc\n" : '')  . (($bcc != '') ? "Bcc: $bcc\n" : '');

+               $res = array();
+               foreach (explode("\n", $this->extra_headers) as $hdr)
+                   array_push($res, $this->encode_nonascii($hdr));
+               $this->extra_headers = implode("\n", $res);
+
+               $to            = $this->encode_nonascii($to);
+               $this->subject = $this->encode_nonascii($this->subject);
+
                // Send message ... removed $this->encode() from subject for time being
                if ( $this->use_smtp )
                {
@@ -237,6 +245,18 @@
                return true;
        }

+       function encode_nonascii($str)
+       {
+               $res = array();
+               foreach (explode(' ', $str) as $blk)
+               {
+                   if (!preg_match("/^[\x21-\x7f]*$/", $blk))
+                       $blk = $this->encode($blk);
+                   array_push($res, $blk);
+               }
+               return implode(' ', $res);
+       }
+
        // Encodes the given string for proper display for this encoding ... nabbed
        // from php.net and modified. There is an alternative encoding method which
        // may produce lesd output but it's questionable as to its worth in this
-------------------------------------------------------------------------------

There is a small bug though. If the subject line contains two adjacent words with Swedish national characters like sömn här they are written sömnhär without space between the words. I found the patch here:

http://www.phpbb.com/community/viewtopic.php?f=1&t=284361&p=1542972&hilit=8bit+header#p1542972
 
View user's profile Send private message
montego
Site Admin/Owner
Site Admin/Owner



Joined: Feb 12, 2005
Posts: 1399

PostPosted: Sat Sep 20, 2008 9:00 am Reply with quote

Once again, thank you so much for sharing your findings. This may help someone else someday.

_________________
“To err is human, but when the eraser wears out ahead of the pencil, you’re overdoing it.”
-- Josh Jenkins 
View user's profile Send private message Visit poster's website
Atifraza
Newbie
Newbie



Joined: Jan 16, 2015
Posts: 1

PostPosted: Fri Jan 16, 2015 5:29 am Reply with quote

It is not designed that way as the purpose of it is for SEO purposes. To be honest, I would highly recommend kguske's nukeSEO DH as it is a far superior product.

If you still want to use mine, you will need to modify the code yourself. Take a look at each of the assignments:

$newpagetitle =

Just remove the concatenations that you do not wan
_____________________
Unlock the key of your success by ccna 200-120 study material, you can easily pass security+ exam and ccnp study guide - pass-4-sure exam.


Last edited by Atifraza on Fri Jan 30, 2015 6:46 am; edited 1 time in total 
View user's profile Send private message
montego
Site Admin/Owner
Site Admin/Owner



Joined: Feb 12, 2005
Posts: 1399

PostPosted: Thu Jan 22, 2015 9:32 pm Reply with quote

This thread has nothing to do with dynamic titles or SEO... at first I thought you might be spamming my forums and so removed your URL. After thinking about it more, I realized you may not be that at all and this was just misplaced... wrong forum.

_________________
“To err is human, but when the eraser wears out ahead of the pencil, you’re overdoing it.”
-- Josh Jenkins 
View user's profile Send private message Visit poster's website
Display posts from previous:       
Post new topic   Reply to topic

View next topic
View previous topic
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001-2007 phpBB Group
All times are GMT - 4 Hours
 
Forums ©
linear-bunch
linear-bunch