Some registration emails bouncing due to missing email message ID

Started by engr_dood, April 26, 2011, 04:14:46 PM

Previous topic - Next topic

engr_dood

Hi,

I'm presently using SMF 2.0 RC5.  My forum has manual registration of new members by admin only, which I do using the Admin, Members, Registration, Register New Member menu.  I just sent a registration email using this method, and it bounced with this message:

Quote[email protected]
(generated from [email protected])
SMTP error from remote mailer after end of data:
host xxxx.xyz [zzz.zzz.zzz.zzz]: 550-RFC2822 says that all mail SHOULD have a Message-ID header.
550 Most messages without it are spam, so your mail has been rejected.

I wasn't sure whether this was an SMF thing or a hosting provider thing, so I did a couple of experiments.  First I used my host's email server to send an email to myself using Thunderbird.  The message ID was present in the received email.  Second, I used the "News" feature of SMF to send an email to myself using my host's email server (same server as the first experiment).  The message ID was not present in the received email.

So it looks like the lack of a message ID in registration emails is causing some of them to be rejected as spam by some servers.  I've had some problems with members not receiving their emails in the past, or them showing up in their spam folder, so I wonder if this might be more common than previously thought.  It's the first time I've actually gotten an explicit bounce message informing me what the exact problem was.

Illori


emanuele

Looking at the code it seems that the Message-ID is sent only for a couple of specific actions (PMs and notifications).

What about using the action if available and nothing else is specified?


Take a peek at what I'm doing! ;D




Hai bisogno di supporto in Italiano?

Aiutateci ad aiutarvi: spiegate bene il vostro problema: no, "non funziona" non è una spiegazione!!
1) Cosa fai,
2) cosa ti aspetti,
3) cosa ottieni.

Arantor


Black Tiger

Sorry to bump an old thread. But this is still an issue. For example it also happens when a birthday email is send out.
QuoteX-ACL-Warn: Adding Message-ID header because it is missing!
So a message-id is not send in 2.0.15.

Since this is known and fixed in 2.1, is this fixable by myself by doing some easy edits somewhere? Or is this a lot of code change? I presume the last since this is not fixed in the complete 2.0 branche and it was already known since the RC5?
Greetings, Black Tiger

vbgamer45

Two options update sub-post.php and set a value for messageid that code wasn't really change in 2.1
What changed was for instance birthday emails was changed in sources/schedulded tasks
"function scheduled_birthdayemails()"


sendmail($recp['email'], $emaildata['subject'], $emaildata['body'], null, null, false, 4);

To

sendmail($recp['email'], $emaildata['subject'], $emaildata['body'], null, 'birthday', false, 4);
Community Suite for SMF - Take your forum to the next level built for SMF, Gallery,Store,Classifieds,Downloads,more!

SMFHacks.com -  Paid Modifications for SMF

Mods:
EzPortal - Portal System for SMF
SMF Gallery Pro
SMF Store SMF Classifieds Ad Seller Pro

Black Tiger

Thank you.
I changed the second null to 'birthday' as you suggested in the sources/scheduledtasks.php.

But what needs to be updated in Subs-Post.php? Because there is no string 'birthday' in there anywhere.

I also see these double null statements in other e-mail lines, like this:
                $emaildata = loadEmailTemplate('scheduled_approval', $replacements, $current_language);

                // Send the actual email.
                sendmail($member['email'], $emaildata['subject'], $emaildata['body'], null, null, false, 2);

Looks like this is send after an approval. Can this second null simply be changed to 'approval'?

Which also makes me wonder if this issue is also occuring on a pm notification and thread notification.
If yes, does those need change to and do you know where I can find them?
Greetings, Black Tiger

vbgamer45

Yup yes change the second null on all those and that will fix the message-id issue.
There were no changes made to subs-post.php

You can put any word or phrase there for the second null in quotes.
Community Suite for SMF - Take your forum to the next level built for SMF, Gallery,Store,Classifieds,Downloads,more!

SMFHacks.com -  Paid Modifications for SMF

Mods:
EzPortal - Portal System for SMF
SMF Gallery Pro
SMF Store SMF Classifieds Ad Seller Pro

Black Tiger

Oke, thank you for the quick reply.

Problem is I can't find those for pm and thread notification in the scheduledtask.php file.

But since you also mentioned the Subs-Post.php, what do I have to do in there?
Greetings, Black Tiger

vbgamer45

They would be in other files in the sources folder.

To ensure all.
Add like a line in that function sendmail
If (empty($message_id))
$message_id = 'email';

That will just set a messagid no matter what if it is empty


Community Suite for SMF - Take your forum to the next level built for SMF, Gallery,Store,Classifieds,Downloads,more!

SMFHacks.com -  Paid Modifications for SMF

Mods:
EzPortal - Portal System for SMF
SMF Gallery Pro
SMF Store SMF Classifieds Ad Seller Pro

Black Tiger

Oh that's even better.
Thank you very much!!

But I'm no coder.
Where exactly do I have to put that line?
Or can I put it anywhere I want? In the ScheduledTaks.php?
Greetings, Black Tiger

vbgamer45

Community Suite for SMF - Take your forum to the next level built for SMF, Gallery,Store,Classifieds,Downloads,more!

SMFHacks.com -  Paid Modifications for SMF

Mods:
EzPortal - Portal System for SMF
SMF Gallery Pro
SMF Store SMF Classifieds Ad Seller Pro

Black Tiger

Ah I think I found some existing stuff in Subs-post.php I could use when searching for mail in those files:

// Send off an email.
function sendmail($to, $subject, $message, $from = null, $message_id = null, $send_html = false, $priority = 3, $hotmail_fix = null$
{
        global $webmaster_email, $context, $modSettings, $txt, $scripturl;
        global $smcFunc;


I presume this would be the same you suggested? Could you confirm this is correct?

Change:
// Send off an email.
function sendmail($to, $subject, $message, $from = null, $message_id = null, $send_html = false, $priority = 3, $hotmail_fix = null$

to
// Send off an email.
function sendmail($to, $subject, $message, $from = null, $message_id = 'email', $send_html = false, $priority = 3, $hotmail_fix = null$


Or is it better to put your solution above, or below this line?
Greetings, Black Tiger

vbgamer45

Better solution before since those calls are passing Null to it already and we want to override it putting in the function declaration won't make any changes.
Add code after

global $webmaster_email, $context, $modSettings, $txt, $scripturl;
        global $smcFunc;

Community Suite for SMF - Take your forum to the next level built for SMF, Gallery,Store,Classifieds,Downloads,more!

SMFHacks.com -  Paid Modifications for SMF

Mods:
EzPortal - Portal System for SMF
SMF Gallery Pro
SMF Store SMF Classifieds Ad Seller Pro

Black Tiger

Great, I put it there.

Thank you very much for your support and patience with me.
Greetings, Black Tiger

vbgamer45

Community Suite for SMF - Take your forum to the next level built for SMF, Gallery,Store,Classifieds,Downloads,more!

SMFHacks.com -  Paid Modifications for SMF

Mods:
EzPortal - Portal System for SMF
SMF Gallery Pro
SMF Store SMF Classifieds Ad Seller Pro

Advertisement: