HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials

HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials (
-   ISPConfig 3 Priority Support (
-   -   PHPMailer Authentication Problem Possibly Caused by ISPConfig 3 Configuration? (

darinpeterson 9th May 2013 06:23

PHPMailer Authentication Problem Possibly Caused by ISPConfig 3 Configuration?
OS: Debian Squeeze, Dovecot
ISPConfig: v3.0.5.2

I am trying to use PHPMailer to connect to my mail server, and I keep getting the following authentication error:


SMTP -> ERROR: Password not accepted from server: 535 5.7.8 Error: authentication failed: UGFzc3dvcmQ6
Initially I thought this was cause because openssl was not enabled for PHP, but I checked php -i, and it is enabled.

I changed the password several times, and it still will not authenticate. Here's my code, and I have enabled smtpd:


$mail = new PHPMailer();
        $mail->SMTPDebug = 1;
        $mail->Host = 'mail.server.tld';
        $mail->Port = 587;
        $mail->Username = 'client@anotherdomain.tld';
        $mail->Password = 'zzzzzz';
        $mail->SMTPAuth = true;
        $mail->SMTPSecure = 'tls';
        $mail->FromName = 'Name';
        $mail->From = 'client@anotherdomain.tld';
        $mail->Subject = $subject;
        $mail->Body = $mail_message;
        if (!$mail->Send()) {
            echo "Could not deliver message to: $to.<br/>";

My mail clients use the same information as I placed in the configuration above, and have no problems connecting.

Is there something in ISPConfig 3 that might be preventing me from connecting to the mail server via PHPMailer?

till 9th May 2013 16:24

The autentication mechanism is the same for all mail clients, if the mail account works in your normal email client with same settings (tls) then the problem is not related to ispconfig.

If you run this php script on the sever, you dont need to authenticate, just use localhost as mailserver host.

darinpeterson 9th May 2013 17:23

Thank you for the prompt reply. It's a multi-server setup, so I need to be able to authenticate. I'll keep digging and post when I find a solution.

till 9th May 2013 21:18

Please check if your mail server node has smtps enabled in file.

darinpeterson 10th May 2013 17:41



smtps    inet  n      -      -      -      -      smtpd
  -o smtpd_tls_wrappermode=yes
  -o smtpd_sasl_auth_enable=yes
  -o smtpd_client_restrictions=permit_sasl_authenticated,reject
#  -o milter_macro_daemon_name=ORIGINATING

I believe the problem is with my PHPMailer install. Thanks for checking on the smtps.

till 11th May 2013 19:01

If scripts that run on the web node shoul slways be able to send trough the mail node, then you can add the ip address of the web node in the mynetworks line in on the mail node. This will allow scripts from web node to send trough the mail node without needinf smtp authentication.

darinpeterson 5th June 2013 16:53

I tried a couple of different ways of adding my server IP to, and the only impact has been that email has stopped working.


mynetworks = [::1]/128
I tried


mynetworks = IP/CIDR [::1]/128

mynetworks = [::1]/128 IP/CIDR
Neither worked, and I haven't been able to find good documentation to help me understand what is possible.

Can you please explain how to add the IP correctly?

till 6th June 2013 14:48

Just add the IP. If your IP is e.g.-, then the new line in the config file is:

mynetworks = [::1]/128

darinpeterson 11th June 2013 21:18

Worked perfectly... Thank you!

All times are GMT +2. The time now is 19:26.

Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.