Imap_mail() security warning, mail() blacklisted

software development

#1

I’ve set up a “catch-all” e-mail address on one of my subdomains for testing, and I’m trying to follow the instructions at http://wiki.dreamhost.com/PHP_IMAP to manage the mailbox via PHP.

At the top of the php file is:

$srv="{mail.sub.domain.com:143/notls}INBOX"; $mbox=imap_open($srv, "catch-all@sub.domain.com", "password");

and then I’ve replicated the sample code from the wiki:

[code]$to = "myrealaddress@domain.com";
$subject = “Test Email”;
$body = “This is only a test.”;
$headers = “From: catch-all@sub.domain.com\r\n”.
“Reply-To: catch-all@sub.domain.com\r\n”;
$cc = null;
$bcc = null;
$return_path = "catch-all@sub.domain.com";

imap_mail($to, $subject, $body, $headers, $cc, $bcc, $return_path);[/code]

and added echo(imap_last_error()); below that. It gives the following error:

I suspect this is because DH instructs us to connect without TLS. But I’ve changed the ports and methods (/tls, /ssh, etc) as http://wiki.dreamhost.com/E-mail_Client_Configuration would seem to indicate (yes, I see that starttls doesn’t work- shouldn’t ssh on the correct port though?), all to no avail- any other settings renders the script unable to make the IMAP connection.

So, is there a way to establish this connection securely or else disable this block? I did check to make sure my PHP is compiled --with-imap

As additional information, I was trying to troubleshoot these issues by using mail() instead, and likewise kept getting no messages come through, and no bounces, even though the function always returned true (message accepted). In desperation I logged into the control panel of my site’s CMS and sent a test message from there, since it also uses php’s mail() function. Still no message was received, but this time I got a bounce report at my sending address saying that the outlook.com servers (where the external address I was testing sending the message to is hosted) was blocked - it said messages from 64.90.63.134 weren’t sent - please contact your ISP since part of their network is on the block list.

When I used mail() to send to a gmail address, that one went through. Still no dice on the imap_mail() function however, as expected, since it’s a connection issue, not a blacklist issue.

So, I guess part of the question is whether the blacklist issue can be resolved with Microsoft. And the other part is how can I make imap_mail() work, which is what I really want to use and the wiki indicates we should be able to.

Thank you


#2

Correction:

I must not have tried this, but apparently it works. Even though imap_mail returns the security error, I guess it’s actually more of a warning because if I try to send a message to the gmail address, it goes through.

So maybe the entirety of the issue is the blacklisting after all.