MyBB Community Forums

Full Version: [B] X-MyBB-Script header sometimes shows incorrect value
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
The mentioned header in mails sent from the board sometimes shows strange values. Searching my mailbox I've found:
  • Sent from KDE forums:
    • css.php (should have been newreply.php)
    • showthread.php (could be quick-reply)
  • Sent from MyBB Community forums:
    • member.php (should have been newreply.php)
    • moderation.php (should have been newreply.php)
    • showthread.php (could be quick-reply)

I may be off with some, but at least css.php sounds strange to me. I don't know how to reproduce this, but searching your mailbox will probably show a few.

Also, sometimes there is a CRLF missing between the X-MyBB-Script and MIME-Version headers (simplest solution is probably to create an array of headers and join() it with CRLF).
$this->headers .= "X-MyBB-Script: {$http_host}{$_SERVER['PHP_SELF']}{$this->delimiter}";

I don't know what to say other then it must be an apache or php problem.
I know, I found that line. But still...
Didn't you find any strange occurences in your mailbox?

Anyway, if I find time, I will investigate further, because if this is an Apache or PHP bug, it's quite a bit more serious than having trouble filtering my mail...
I don't think it's a bug. It shows the different files simply because that's where it was sent from. Not sure though why it's showing css.php.
Okay, so I know where it is coming from.

It's from the mail queue. We have this line in inc/init.php to run it at the end:

// Set up any shutdown functions we need to run globally
add_shutdown('send_mail_queue');

So, it's quite possible that there was an email in the queue, and when css.php was called it was sent off at the end of the css.php call.

So not sure if this is even a bug? That header is only there for debugging purposes. It does what it is designed to do - show the location from which the email was sent.
I see it now: the headers are not created until the mail is sent (my_mail() calls $mail->build_message()).

Seems my bug report was bogus; I apologize.

So I'd like to make it a feature request: an extra header telling me where the mail actually came from, for simpler mail filtering.