Go Back   HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials > ISPConfig 3 > ISPConfig 3 Priority Support

Do you like HowtoForge? Please consider supporting us by becoming a subscriber.
Reply
 
Thread Tools Display Modes
  #1  
Old 9th May 2013, 05:23
darinpeterson darinpeterson is offline
HowtoForge Supporter
 
Join Date: Nov 2011
Posts: 153
Thanks: 35
Thanked 13 Times in 13 Posts
Question 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:

Code:
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:

Code:
$mail = new PHPMailer();
        $mail->SMTPDebug = 1;
        $mail->IsSMTP();
        $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->IsHTML(false);
        $mail->Body = $mail_message;
        $mail->AddAddress($to);
        $mail->AddReplyTo($email);
        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?
Reply With Quote
Sponsored Links
  #2  
Old 9th May 2013, 15:24
till till is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 35,777
Thanks: 821
Thanked 5,332 Times in 4,184 Posts
Default

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.
__________________
Till Brehm
--
Get ISPConfig support and the ISPConfig 3 manual from ispconfig.org.
Reply With Quote
The Following User Says Thank You to till For This Useful Post:
darinpeterson (9th May 2013)
  #3  
Old 9th May 2013, 16:23
darinpeterson darinpeterson is offline
HowtoForge Supporter
 
Join Date: Nov 2011
Posts: 153
Thanks: 35
Thanked 13 Times in 13 Posts
Default

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.
Reply With Quote
  #4  
Old 9th May 2013, 20:18
till till is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 35,777
Thanks: 821
Thanked 5,332 Times in 4,184 Posts
Default

Please check if your mail server node has smtps enabled in master.cf file.
__________________
Till Brehm
--
Get ISPConfig support and the ISPConfig 3 manual from ispconfig.org.
Reply With Quote
The Following User Says Thank You to till For This Useful Post:
darinpeterson (10th May 2013)
  #5  
Old 10th May 2013, 16:41
darinpeterson darinpeterson is offline
HowtoForge Supporter
 
Join Date: Nov 2011
Posts: 153
Thanks: 35
Thanked 13 Times in 13 Posts
Default

Yes.

Code:
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.
Reply With Quote
  #6  
Old 11th May 2013, 18:01
till till is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 35,777
Thanks: 821
Thanked 5,332 Times in 4,184 Posts
Default

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 main.cf on the mail node. This will allow scripts from web node to send trough the mail node without needinf smtp authentication.
__________________
Till Brehm
--
Get ISPConfig support and the ISPConfig 3 manual from ispconfig.org.
Reply With Quote
The Following User Says Thank You to till For This Useful Post:
darinpeterson (4th June 2013)
  #7  
Old 5th June 2013, 15:53
darinpeterson darinpeterson is offline
HowtoForge Supporter
 
Join Date: Nov 2011
Posts: 153
Thanks: 35
Thanked 13 Times in 13 Posts
Default

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

Code:
mynetworks = 127.0.0.0/8 [::1]/128
I tried

Code:
mynetworks = 127.0.0.0/8 IP/CIDR [::1]/128
Code:
mynetworks = 127.0.0.0/8 [::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?
Reply With Quote
  #8  
Old 6th June 2013, 13:48
till till is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 35,777
Thanks: 821
Thanked 5,332 Times in 4,184 Posts
Default

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

mynetworks = 127.0.0.0/8 [::1]/128 192.168.0.1
__________________
Till Brehm
--
Get ISPConfig support and the ISPConfig 3 manual from ispconfig.org.
Reply With Quote
The Following User Says Thank You to till For This Useful Post:
darinpeterson (11th June 2013)
  #9  
Old 11th June 2013, 20:18
darinpeterson darinpeterson is offline
HowtoForge Supporter
 
Join Date: Nov 2011
Posts: 153
Thanks: 35
Thanked 13 Times in 13 Posts
 
Default

Worked perfectly... Thank you!
Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Sending mails: fine > recive: bad Moundy General 1 19th June 2012 23:40
Need help with ISPConfig Mail and Squirrelmail m.xander Installation/Configuration 109 3rd February 2012 00:15
Fail2ban + sasl problem and Solution pititis General 1 2nd March 2011 07:02
Email problem 'Cannot set my user or group id.' (using ISPConfig 3 + OpenSuSE 11.2) urosm Installation/Configuration 5 19th June 2010 22:41
Ftp problems timeout reny2000 General 6 23rd December 2009 11:09


All times are GMT +2. The time now is 04:55.


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