1. Please take a little time for this simple survey! Thank you for participating!
    Dismiss Notice
  2. Dear Pleskians, please read this carefully! New attachments and other rules Thank you!
    Dismiss Notice
  3. Dear Pleskians, I really hope that you will share your opinion in this Special topic for chatter about Plesk in the Clouds. Thank you!
    Dismiss Notice

SMTP Authentication Not Working - Does Not Support Authentication

Discussion in 'Plesk for Linux - 8.x and Older' started by Superman859, Oct 23, 2008.

  1. Superman859

    Superman859 Guest

    I'm working on developing my site on Plesk 8.6.0. I am trying to use the PEAR::Mail() function for PHP. However, I am not able to use authentication.

    $smtp = Mail::factory('smtp',
    array ('host' => $host,
    'auth' => true,
    'username' => $smtp_username,
    'password' => $smtp_password));

    $mail = $smtp->send($to, $headers, $body);

    if (PEAR::isError($mail)) {
    //sends me an email using php mail() function instead, includes $mail->getMessage() in the body of mail

    Above is the main idea of what I am doing with PEAR::Mail. It should all be correct, and all variables are filled in appropriately as far as I know.

    The error returned is

    authentication failure [SMTP: SMTP server does not support authentication (code: 250, response: {IP ADDRESS}

    When I use no authentication as follows, PEAR::Mail works.

    $smtp = Mail::factory('smtp',
    array ('host' => $host,
    'auth' => false,
    'username' => $smtp_username,
    'password' => $smtp_password));

    Does anyone have any idea what is going on? Does SMTP Authentication not work in Plesk 8.6.0? This seems like quite an issue.

    A few notes: Yes - under Server - Mail settings for Plesk I have it set to Authentication is required (SMTP is checked, POP3 locktime text field left blank and also unchecked). I have it set to Only use of full POP3/IMAP mail accounts names is allowed as well. The SMTP username used is one of my usernames (including domain name) I use to login to Horde webmail, along with the appropriate password.

    Here are some other results:

    [root@IP]# cat /etc/xinetd.d/smtp_psa

    service smtp
    socket_type = stream
    protocol = tcp
    wait = no
    disable = no
    user = root
    instances = UNLIMITED
    env = SMTPAUTH=1
    server = /var/qmail/bin/tcp-env
    server_args = -Rt0 /var/qmail/bin/relaylock /var/qmail/bin/qmail-smtpd /var/qmail/bin/smtp_auth /var/qmail/bin/true /var/qmail/bin/cmd5checkpw /var/qmail/bin/true
  2. breun

    breun Golden Pleskian

    Jun 28, 2005
    Likes Received:
    Normally you don't need to use SMTP authentication when connecting from localhost. Why do you want to use SMTP and authentication at all? It looks like PEAR::Mail also has a PHP mail() function interface and a Sendmail interface, I think I'd use one of those when sending mail via localhost.
  3. quang nguyen

    quang nguyen Guest

    Solution for your Problem.

    The code found in this example should be fairly straightforward, so I won't elaborate on its contents, although it's worth noting that in this particular case PHP's OpenSSL extension must be enabled, because Gmail requires an SSL connection in addition to SMTP authentication. If your server doesn't require SSL, you should be able to authenticate without necessarily reconfiguring PHP to include this extension.
  4. Faris Raouf

    Faris Raouf Silver Pleskian Plesk Guru

    Mar 15, 2009
    Likes Received:
    I'm guessing that because is whitelisted and allowed to send email by default without authentication, attempting to authenticate is causing the error. But as the others say, why authenticate when you don't need to? I'm not sure I understand?