PHP Pear Mail use with mail.nfoservers.com

Connect with other users about what to run on your webhosting (and how to run it) here.
Post Reply
akincer
New to forums
New to forums
Posts: 1
https://www.youtube.com/channel/UC40BgXanDqOYoVCYFDSTfHA
Joined: Tue Sep 21, 2010 6:38 am

PHP Pear Mail use with mail.nfoservers.com

Post by akincer »

Hopefully someone out there can tell me what, if anything, I'm doing wrong. I'm attempting to use PHP Pear Mail to send email using an email account hosted on NFO servers.

The short short version is that setting auth to true causes a TLS error. Turning it off allows me to send email, but only to OUR domain. As soon as I set a recipient to an external domain (GMail for example), it gives a relay denied error. Here is a snippet of my code (sanitized):

Code: Select all

$emailbody = "email message here";
$emailfrom = 'account username hosted on NFO servers here';
$emailsubject = "email subject here";
$emailto = 'recipient addresses here';
$recipients = $emailto;
$emailpassword = "email password here";
$emailhost = "mail.nfoservers.com";
$emailheaders['From'] = $emailfrom;
$emailheaders['To'] = $emailto;
$emailheaders['Subject'] = $emailsubject;

$smtpinfo["host"] = $emailhost;
$smtpinfo["port"] = "25";
$smtpinfo["auth"] = true;
$smtpinfo["debug"] = true;
$smtpinfo["username"] = $emailfrom;
$smtpinfo["password"] = $emailpassword;

$smtp =& Mail::factory('smtp', $smtpinfo);
$mailresponse = $smtp->send($recipients, $emailheaders, $emailbody);
Here is the response with auth set to true (recipient makes no difference):

Code: Select all

DEBUG: Recv: 220 mail.nuclearfallout.net ESMTP Postfix
DEBUG: Send: EHLO localhost

DEBUG: Recv: 250-mail.nuclearfallout.net
DEBUG: Recv: 250-PIPELINING
DEBUG: Recv: 250-SIZE 100000000
DEBUG: Recv: 250-VRFY
DEBUG: Recv: 250-ETRN
DEBUG: Recv: 250-STARTTLS
DEBUG: Recv: 250-AUTH LOGIN PLAIN
DEBUG: Recv: 250-AUTH=LOGIN PLAIN
DEBUG: Recv: 250-ENHANCEDSTATUSCODES
DEBUG: Recv: 250-8BITMIME
DEBUG: Recv: 250 DSN
DEBUG: Send: STARTTLS

DEBUG: Recv: 454 4.7.0 TLS not available due to local problem
DEBUG: Send: RSET

DEBUG: Recv: 250 2.0.0 Ok
Here is the response with auth set to false and the recipient is a gmail address:

Code: Select all

DEBUG: Recv: 220 mail.nuclearfallout.net ESMTP Postfix
DEBUG: Send: EHLO localhost

DEBUG: Recv: 250-mail.nuclearfallout.net
DEBUG: Recv: 250-PIPELINING
DEBUG: Recv: 250-SIZE 100000000
DEBUG: Recv: 250-VRFY
DEBUG: Recv: 250-ETRN
DEBUG: Recv: 250-STARTTLS
DEBUG: Recv: 250-AUTH LOGIN PLAIN
DEBUG: Recv: 250-AUTH=LOGIN PLAIN
DEBUG: Recv: 250-ENHANCEDSTATUSCODES
DEBUG: Recv: 250-8BITMIME
DEBUG: Recv: 250 DSN
DEBUG: Send: MAIL FROM:<mynfoaccount@mydomain.com>

DEBUG: Recv: 250 2.1.0 Ok
DEBUG: Send: RCPT TO:<myemailaddress@gmail.com>

DEBUG: Recv: 554 5.7.1 <myemailaddress@gmail.com>: Relay access denied
DEBUG: Send: RSET

DEBUG: Recv: 250 2.0.0 Ok
Here is the output with auth set to false and the recipient is the same as the sending account:

Code: Select all

DEBUG: Recv: 220 mail.nuclearfallout.net ESMTP Postfix
DEBUG: Send: EHLO localhost

DEBUG: Recv: 250-mail.nuclearfallout.net
DEBUG: Recv: 250-PIPELINING
DEBUG: Recv: 250-SIZE 100000000
DEBUG: Recv: 250-VRFY
DEBUG: Recv: 250-ETRN
DEBUG: Recv: 250-STARTTLS
DEBUG: Recv: 250-AUTH LOGIN PLAIN
DEBUG: Recv: 250-AUTH=LOGIN PLAIN
DEBUG: Recv: 250-ENHANCEDSTATUSCODES
DEBUG: Recv: 250-8BITMIME
DEBUG: Recv: 250 DSN
DEBUG: Send: MAIL FROM:<mynfoaccount@mydomain.com>

DEBUG: Recv: 250 2.1.0 Ok
DEBUG: Send: RCPT TO:<mynfoaccount@mydomain.com>

DEBUG: Recv: 250 2.1.5 Ok
DEBUG: Send: DATA

DEBUG: Recv: 354 End data with <CR><LF>.<CR><LF>
DEBUG: Send: From: mynfoaccount@mydomain.com
To: mynfoaccount@mydomain.com
Subject: my email subject

My email message here
.

DEBUG: Recv: 250 2.0.0 Ok: queued as EA8AE5E245
DEBUG: Send: QUIT

DEBUG: Recv: 221 2.0.0 Bye
The message is received just fine in my nfo account inbox but not with the other attempts. Any ideas?
User avatar
Edge100x
Founder
Founder
Posts: 13113
Joined: Thu Apr 18, 2002 11:04 pm
Location: Seattle
Contact:

Re: PHP Pear Mail use with mail.nfoservers.com

Post by Edge100x »

I'm not very familiar with your SMTP client library, but from the looks of it, it is trying to use TLS during the SMTP AUTH process, and that isn't supported. In the short term, if you wish to relay messages through our mail server, you'd need to find a way to specify for it to use plain, unencrypted SMTP AUTH.

I will also see about getting TLS setup on my end.
Post Reply