Package home | Report new bug | New search | Development Roadmap Status: Open | Feedback | All | Closed Since Version 1.4.1

Request #16067 need to propogate the greeting sent by the server as retrieved by Net_SMTP
Submitted: 2009-04-03 22:07 UTC
From: kguest Assigned: kguest
Status: Closed Package: Mail (version 1.2.0b1)
PHP Version: 5.2.5 OS:
Roadmaps: (Not assigned)    

Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know! Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
Solve the problem : 47 - 37 = ?

 [2009-04-03 22:07 UTC] kguest (Ken Guest)
Description: ------------ similar to - and requiring the patch supplied for that request ; there is a requirement to retrieve the greeting sent by the server - from this you can determine which actual mail server you have interacted with; very useful for tracking if you're connecting through a round-robin of mail servers!


 [2009-04-03 22:08 UTC] kguest (Ken Guest)
The following patch has been added/updated: Patch Name: Mail-smtp.php.greeting.diff Revision: 1238778497 URL:$bug&patch=$patch_name&revision=$e&display=1
 [2009-04-03 22:18 UTC] kguest (Ken Guest)
-Summary: need to retrieve the greeting sent by the server +Summary: need to propogate the greeting sent by the server as retrieved by Net_SMTP
 [2009-04-07 04:39 UTC] chagenbu (Chuck Hagenbuch)
-Status: Open +Status: Feedback
The patch doesn't apply against current CVS
 [2009-04-07 23:06 UTC] kguest (Ken Guest)
cleaner/new patch won't upload - this is it - obviously I can email it to you directly. Index: smtp.php =================================================================== RCS file: /repository/pear/Mail/Mail/smtp.php,v retrieving revision 1.33 diff -u -b -B -r1.33 smtp.php --- smtp.php 25 Apr 2008 05:13:23 -0000 1.33 +++ smtp.php 7 Apr 2009 16:55:13 -0000 @@ -278,6 +278,16 @@ /* Send the message's headers and the body as SMTP data. */ $res = $this->_smtp->data($textHeaders . "\r\n\r\n" . $body); + list(,$args) = $this->_smtp->getResponse(); + + if (preg_match("/Ok: queued as (.*)/", $args, $queued)) { + $this->queued_as = $queued[1]; + } + + /* we need the greeting; from it we can extract the authorative name of the mail server we've really connected to. + * ideal if we're connecting to a round-robin of relay servers and need to track which exact one took the email */ + $this->greeting = $this->_smtp->getGreeting(); + if (is_a($res, 'PEAR_Error')) { $error = $this->_error('Failed to send data', $res); $this->_smtp->rset();
 [2009-10-04 06:05 UTC] kguest (Ken Guest)
-Status: Feedback +Status: Assigned -Assigned To: +Assigned To: kguest
Spoke with Chuch H. about this some time ago on IRC. QA may roll a release with this patch included.
 [2009-10-04 06:05 UTC] kguest (Ken Guest)
-Status: Assigned +Status: Closed
This bug has been fixed in SVN. If this was a documentation problem, the fix will appear on by the end of next Sunday (CET). If this was a problem with the website, the change should be live shortly. Otherwise, the fix will appear in the package's next release. Thank you for the report and for helping us make PEAR better.