Email validation (and therefore sending) silently fails if iconv extension is missing

PumpinIron

Well-known member
I upgraded my dedicated server from PHP 5.6 to PHP 7.1. Everything seems to work great, except members (and myself) no longer receive emails from XenForo when a new conversation is started (or replied to), or any other emails for that matter.

Any idea what this could be? I'm a bit perplexed at the moment.

I'm going to be upgrading to 2.0 soon, but I'm waiting for @ThemeHouse to make a classic UIX theme, since I don't like their UIX 2 theme at all.
 
If there are no errors in your XF error log then it usually indicates that the message was sent successfully from our end or mail has been switched off in config.php.

After checking config.php it’s worth asking your host for help with troubleshooting as there may well be logs on their end indicating the failure.
 
Whoa... I was wrong. I just checked out my error log and there is 10 pages of errors, almost all of which look like this:

Code:
#0 /home/tjforum/public_html/library/Zend/Validate/EmailAddress.php(487): Zend_Validate_Hostname->isValid('wranglertjforum...')
#1 /home/tjforum/public_html/library/Zend/Validate/EmailAddress.php(546): Zend_Validate_EmailAddress->_validateHostnamePart()
#2 /home/tjforum/public_html/library/XenForo/Helper/Email.php(72): Zend_Validate_EmailAddress->isValid('noreply@wrangle...')
#3 /home/tjforum/public_html/library/XenForo/Mail.php(605): XenForo_Helper_Email::isEmailValid('noreply@wrangle...')
#4 /home/tjforum/public_html/library/XenForo/Mail.php(549): XenForo_Mail::_getDefaultSendmailTransport(Array)
#5 /home/tjforum/public_html/library/XenForo/Mail.php(509): XenForo_Mail::getDefaultTransport()
#6 /home/tjforum/public_html/library/XenForo/Mail.php(527): XenForo_Mail::setupTransport()
#7 /home/tjforum/public_html/library/XenForo/Model/MailQueue.php(54): XenForo_Mail::getTransport()
#8 /home/tjforum/public_html/library/XenForo/Deferred/MailQueue.php(10): XenForo_Model_MailQueue->runMailQueue(7.9999978542328)
#9 /home/tjforum/public_html/library/XenForo/Model/Deferred.php(295): XenForo_Deferred_MailQueue->execute(Array, Array, 7.9999978542328, '')
#10 /home/tjforum/public_html/library/XenForo/Model/Deferred.php(429): XenForo_Model_Deferred->runDeferred(Array, 7.9999978542328, '', false)
#11 /home/tjforum/public_html/library/XenForo/Model/Deferred.php(374): XenForo_Model_Deferred->_runInternal(Array, 8, '', false)
#12 /home/tjforum/public_html/deferred.php(23): XenForo_Model_Deferred->run(false)
#13 {main}
 
I'm not certain that this would have been caused by the upgrade to PHP 7.1 to be fair.

It seems to be falling over when validating your bounceEmailAddress or defaultEmailAddress option.

The only part of the email we can see is:
noreply@wranglertjforum

Can you check what the full email address is for both of these options?
 
I'm not certain that this would have been caused by the upgrade to PHP 7.1 to be fair.

It seems to be falling over when validating your bounceEmailAddress or defaultEmailAddress option.

The only part of the email we can see is:
noreply@wranglertjforum

Can you check what the full email address is for both of these options?

It's listed as noreply@wranglertjforum.com.

You're right, I'm not 100% certain this has to do with the PHP 7.1 upgrade, it could be just coincidental that it happened around the same time.
 
I'm not certain that this would have been caused by the upgrade to PHP 7.1 to be fair.

It seems to be falling over when validating your bounceEmailAddress or defaultEmailAddress option.

The only part of the email we can see is:
noreply@wranglertjforum

Can you check what the full email address is for both of these options?

I figured it out. PHP 7.1 was missing the iconv extension. I installed it via the command line and now I'm getting emails fine.
 
Hmm, that's annoying that the error was totally suppressed. I think we should explore that as being a bug and look to return a better error there, as otherwise that would be difficult to troubleshoot.
 
Hmm, that's annoying that the error was totally suppressed. I think we should explore that as being a bug and look to return a better error there, as otherwise that would be difficult to troubleshoot.

I agree. I managed to find the answer by copying and pasting the error in Google. Another thread came up from this forum in which someone had the same error. It was @Brogan who pointed out that they needed the iconv extension enabled.

I guess this makes sense. PHP 5.6 must have had it, and then when I upgraded to PHP 7.1, it obviously wasn't installed with that version.
 
Back
Top Bottom