1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

XF 1.1 Xenforo mailing via SMTP doesn't work

Discussion in 'Troubleshooting and Problems' started by zenforoo, Aug 1, 2013.

  1. zenforoo

    zenforoo Member

    Have tried various ports, etc. SSH'd into server and manually sent mail with telnet using desired server and user/pass. Have tried alternative SMTP servers. I just can't seem to get SMTP to work with Xenforo.

    From Server Error Logs:

    Server Error Log
    Error Info
    Zend_Mail_Protocol_Exception: Incorrect authentication data - library/Zend/Mail/Protocol/Abstract.php:431
    Generated By: Unknown Account, Today at 2:59 AM
    Stack Trace
    #0 /home/XXXXX/public_html/library/Zend/Mail/Protocol/Smtp/Auth/Login.php(95): Zend_Mail_Protocol_Abstract->_expect(235)
    #1 /home/XXXXX/public_html/library/Zend/Mail/Protocol/Smtp.php(217): Zend_Mail_Protocol_Smtp_Auth_Login->auth()
    #2 /home/XXXXX/public_html/library/Zend/Mail/Transport/Smtp.php(200): Zend_Mail_Protocol_Smtp->helo('localhost')
    #3 /home/XXXXX/public_html/library/Zend/Mail/Transport/Abstract.php(348): Zend_Mail_Transport_Smtp->_sendMail()
    #4 /home/XXXXX/public_html/library/Zend/Mail.php(1194): Zend_Mail_Transport_Abstract->send(Object(Zend_Mail))
    #5 /home/XXXXX/public_html/library/XenForo/Mail.php(177): Zend_Mail->send()
    #6 /home/XXXXX/public_html/library/XenForo/Mail.php(152): XenForo_Mail->sendMail(Object(Zend_Mail))
    #7 /home/XXXXX/public_html/library/XenForo/Model/UserConfirmation.php(136): XenForo_Mail->send('XXXXX...', 'testaccount')
    #8 /home/XXXXX/public_html/library/XenForo/ControllerPublic/Register.php(328): XenForo_Model_UserConfirmation->sendEmailConfirmation(Array)
    #9 /home/XXXXX/public_html/library/Tac/CustomImgCaptcha/ControllerPublic/Register.php(51): XenForo_ControllerPublic_Register->actionRegister()
    #10 /home/XXXXX/public_html/library/XenForo/FrontController.php(313): Tac_CustomImgCaptcha_ControllerPublic_Register->actionRegister()
    #11 /home/XXXXX/public_html/library/XenForo/FrontController.php(132): XenForo_FrontController->dispatch(Object(XenForo_RouteMatch))
    #12 /home/XXXXX/public_html/index.php(13): XenForo_FrontController->run()
    #13 {main}
    Request State
    array(3) {
      ["url"] => string(41) "http://XXXXX.com/register/register"
      ["_GET"] => array(0) {
      ["_POST"] => array(10) {
      ["username"] => string(11) "testaccount"
      ["email"] => string(28) "XXXXXX@XXXXXX.com"
      ["password"] => string(8) "********"
      ["password_confirm"] => string(8) "********"
      ["timezone"] => string(16) "America/New_York"
      ["public_uuid"] => string(25) "4d974114cff451fa074502f88"
      ["agree"] => string(1) "1"
      ["_xfToken"] => string(8) "********"
      ["reg_key"] => string(32) "636e45718149cfdce806c46bf2f8a22e"
  2. Mike

    Mike XenForo Developer Staff Member

    You can see the error is:
    Check the username and password.
  3. zenforoo

    zenforoo Member

    That would be my first guess as well, but I've copied and pasted to no avail. Neither PostmarkApp nor SendGrid work, provided with the correct username and password (triple-checked).

    VPS is able to send SMTP mail using my name and password. Just not through Xenforo....

    root@server2 [~]# telnet smtp.sendgrid.net 25
    Connected to smtp.sendgrid.net.
    Escape character is '^]'.
    220 mi21 ESMTP service ready
    250-SIZE 20480000
    250 STARTTLS
    auth login
    334 VXNlcm5hbWU6
    334 UGFzc3dvcmQ6
    235 Authentication successful.
    mail from: XXXXX@XXXXX.com
    250 Sender address accepted
    rcpt to: XXXXX@XXXXX.com
    250 Recipient address accepted
    354 Continue
    To:To Name
    From: From Name
    This is the body of the message you would like to send.
    250 Delivery in progress
    221 See you later
    Connection closed by foreign host.
    So if SendGrid works, my VPS is able to connect and send mail through it, that would to me indicate that Xenforo is the issue.
  4. Mike

    Mike XenForo Developer Staff Member

    It's worth noting that the error message itself is actually coming from the SMTP server. So it's connecting to something.

    Can you screenshot your SMTP setup details? You can blur out the username (and password) if you want.
  5. zenforoo

    zenforoo Member

    Screen Shot 2013-08-01 at 5.54.55 PM.png

    It may or may not be worth nothing that I've used this setup successfully with other applications on the same server.
  6. p4guru

    p4guru Well-Known Member

    FYI i had a client who had prompts with sendgrid for another forum platform, make sure to set the correct ports and encryption method and to check if firewall on server has allowed such ports through see http://sendgrid.com/docs/User_Guide/smtp_ports.html

    SSL 465 or TLS on ports 25, 2525, and 587
  7. Mike

    Mike XenForo Developer Staff Member

  8. zenforoo

    zenforoo Member

    Sendgrid supports plain connections on ports 25, 2525, and 587. They support TLS on 25, 2525, and 587. They support SSL over 465.

    I have tried all 7 of these combinations. None successfully.

    It's not a Sendgrid specific issue, either. As I mentioned previously I have tried alternatives - PostmarkApp, Gmail, etc. No SMTP server works. Any port, any provider.
  9. Mike

    Mike XenForo Developer Staff Member

    I'm not totally sure what to suggest then. We have plenty of people using Gmail, for example, without issue. Mail sending is actually handled by Zend Framework, and Sendgrid has an example using that so I don't think that's the issue, but I don't see why it would fail if the direct telnet worked as they should be using the same network stack. It's acting like all SMTP is being forced through a particular SMTP server but that's usually only done on consumer connections (and telnet should show it).

    I suppose they could be using a different network stack if there were outgoing iptables filters based on the UID of the process or something similar?
  10. zenforoo

    zenforoo Member

    I doubt that's the case. Other applications on the server (Wordpress, vBulletin, IPB) have all been successfully set up to use an external SMTP to send mail. And it's always been as easy as inputting the server, port and credentials.
  11. thewebco

    thewebco New Member

    I know this is very old, but I thought I would help anyone else landing here. Most panels (like WHM / Cpanel) have in depth configs.

    WHM has a setting that restricts SMTP mailing to certain accounts. (root, MTA, mailman)

    "This feature prevents users from bypassing the mail server to send mail, a common practice used by spammers.
    It will allow only the MTA, mailman, and root to connect to remote SMTP servers."

    Disabling this works in cases where you are getting this error and are on Cpanel.
  12. RandomMC

    RandomMC Member

    I'm getting this error too. I have tried many SMTPs and none work.
  13. thewebco

    thewebco New Member

    I posted in the other thread you started. Take a look there or if you have access to WHM : Go to Tweak Settings -->

    Tungsten likes this.
  14. Tungsten

    Tungsten Member

    @thewebco -- I just wanted to thank you. Your recommendation of disabling SMTP Restrictions within WHM solved this problem for me on not only XenForo but also IPBoard, both of which I host and had been routing email to SparkPost from.

    I'd gladly buy you a beer should our paths ever cross. Your post solved a week's worth of beating my head against the desk.


Share This Page