MyBB Community Forums

Full Version: Add Custom "HELO" SMTP Setting
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
This is sort of a bug, but it's easily fixed by adding this setting.

In the inc/mailhandlers/smtp.php file, $this->helo is set by first trying gethostname(), then php_uname('n'), and finally setting it to $_SERVER['SERVER_NAME'].

The problem with this is that Google Apps requires the $this->helo value to be set to the domain of the email being used. If the gethostname() or php_uname('n') functions return anything other than that domain (which is entirely likely, especially on shared hosting), then Google Apps won't work.

The only way I was able to get Google Apps working without changing the server hostname was to manually set the value in the file:

$this->helo = 'example.com';

This would be better implemented as a MyBB setting. If the setting is blank, MyBB could fall back to the original method of getting the server hostname.
I agree with this suggestion.
Sounds like a good idea.
I think I'd be up to contributing the patch for this. Perhaps I can come up with an initial version tonight with a setting, and the relevant code to check the setting or use default (if not set). I don't know where the release process is right now after 1.8.8 has been going on forever, but I can always branch off for a 1.8.9 merge and hope no conflicts come up!