Welcome to Geeklog, Anonymous Thursday, April 25 2024 @ 07:34 pm EDT

Geeklog Forums

SMTP trouble


Status: offline

oskay

Forum User
Newbie
Registered: 09/14/06
Posts: 13
caffeinated
I've consistently had trouble getting e-mail to users with both 'mail' and 'sendmail'-- most of my potential users never get their registration information. I'd like to switch to using SMTP, but I've run into something of a brick wall.

My hosting is on pair.com, which is-- I believe-- where this site (www.geeklog.net) is hosted, so I have high hopes that a solution exists. When I have my site configured to use SMTP, sending E-mail through my site just produces the following message in the error log (I've removed the IP address):
Text Formatted Code

[pear_error: message="Failed to connect to relay.pair.com:25 [SMTP: Invalid response code received from server (code: 554, response: XXX.XXX.XXX.XXX has not been authenticated to relay mail Connect to your mailbox before sending mail via this relay)]" code=10001 mode=return level=notice prefix="" info=""]

Apparently, this is because the pair.com SMTP server does not allow sending of e-mail unless the account has been checked for new e-mail in the last 90 minutes. Is there any way to provide that check from within Geeklog so that I can send mail via SMTP?

(My apologies if the answer is in plain sight somewhere-- I know that this issue has been raised before, but I haven't seen an answer yet.)

Thanks,
-Windell.
 Quote

ironmax

Anonymous
oskay, Take a look at this article on pair for SMTP problems or call them to get it resolved.
 Quote

Status: offline

oskay

Forum User
Newbie
Registered: 09/14/06
Posts: 13
That page just confirms what I was saying-- I'm afraid that what we're looking at is what they consider to be a feature not a bug. And I seriously doubt that they will change that policy on my behalf.

In any case, I have no trouble receiving and sending mail-- through a traditional e-mail client-- if I do follow their procedure. The problem is how to emulate that behavior through Geeklog.

-Windell.
 Quote

Status: offline

jmucchiello

Forum User
Full Member
Registered: 08/29/05
Posts: 985
It is very common for SMTP servers to be set up with POP before SEND. You could try to importing PEAR/NET_POP3 and create a function something like:

function CUSTOM_quickPop()
{
global $pop_server, $pop_port, $pop_user, $pop_pass; // or just define these vars here.
include_once ( "Net/POP3.php" );

$pop =& new Net_POP3();
$pop->connect($pop_server, $pop_port)
$pop->login($pop_user, $pop_pass)
$pop->getSize()
$pop->disconnect();
}

Then duplicate everything in COM_mail below the if (function_exists("CUSTOM_mail"Wink) inside of a function called CUSTOM_mail and at the top your function call CUSTOM_quickPop().

function CUSTOM_mail( $to, $subject, $message, $from, $html, $priority )
{
CUSTOM_quickPop();

//... rest of COM_mail....
}

If that works (and I have no idea if it will), submit it as a patch where you check $_CONF['mail_settings']['pop_before_send'] and then call quickPop().
 Quote

Status: offline

oskay

Forum User
Newbie
Registered: 09/14/06
Posts: 13
jmucchiello,
Thanks for the great suggestion. I tried this, and with a few little modifications the POP3 routine is up and running happily-- it successfully retrieves e-mail from my mailbox before attempting to send mail via SMTP. (I can see that it's working by redirecting the retrieved E-mail to my error log.)

Unfortunately, the SMTP server still claims that I haven't accessed the mailbox and won't let me send mail-- so I'm wondering what exactly it counts as "connecting" when it says "Connect to your mailbox before sending mail". Do you suppose that there is a specific sequence or command that it's waiting for?
 Quote

Status: offline

jmucchiello

Forum User
Full Member
Registered: 08/29/05
Posts: 985
You'll have to check with your service provider. I can't even guess what they are looking for. I only know I've heard of host providers that have this kind of setup not that I've had to solve this problem.

My advice would be to cut up COM_mail into a standalone php file that only uses smtp. Attempt to send a canned email to yourself. Add the POP3 stuff and then ask for help getting that single php file to work. If you mention you're having trouble sending email from a CMS they'll send you back to us. If your trouble is with a small php file that uses PEAR routines to send a canned message, they should be able to help.
 Quote

All times are EDT. The time is now 07:34 pm.

  • Normal Topic
  • Sticky Topic
  • Locked Topic
  • New Post
  • Sticky Topic W/ New Post
  • Locked Topic W/ New Post
  •  View Anonymous Posts
  •  Able to post
  •  Filtered HTML Allowed
  •  Censored Content