On 2008 Jun 20 (Fri) at 13:00:47 -0400 (-0400), Nick Guenther wrote:
:On Fri, Jun 20, 2008 at 11:47 AM,  <[EMAIL PROTECTED]> wrote:
:> Greetings:
:>
:> Using OpenBSD 4.2, PHP 5.23.
:>
:> Yesterday I got a complaint from a user that she couldn't send email
:> using the php mail program.  I traced the problem down to a problem
:> with PHP's fsockopen function.  Here's the script I used to test it:
:>
:> http://visca.com/php/fsockopen.php
:> <?php
:> $fp = fsockopen("localhost", 25, $errno, $errstr);
:> if (!$fp) {
:>     echo "ERROR: $errno - $errstr<br />\n";
:> } else {
:>     $response = fgets($fp);
:>     echo "Response is \"$response\"";
:> }
:> ?>
:>
:> As you'll see if you follow the link, the script hangs for 60 seconds
:> then prints ?Response is ""?.  Port 25 is open and working.
:>
:> Can anyone suggest where I might go from here to debug this?
:
:Are you sure it's fsockopen? You have to do some configuration to make
:PHP's mail() call work.
:Anyway, your code makes perfect sense and is doing exactly what you
:tell it to: you're connecting to sendmail, then waiting for a response
:that's not going to come because you haven't said "HELO" to sendmail.
:I think OpenBSD's sendmail is configured to not send a banner until
:you do, to mitigate port scanning.

MTAs are required to send a banner upon connections.  Clients aren't 
allowed to send data until they see the full welcome banner.  spamd(8)
uses that fact as part of its technique.

-- 
A classic is something that everybody wants to have read and nobody
wants to read.
                -- Mark Twain, "The Disappearance of Literature"
_______________________________________________
Openbsd-newbies mailing list
[email protected]
http://mailman.theapt.org/listinfo/openbsd-newbies

Reply via email to