|
Posted by jerrygarciuh on 12/18/01 11:50
Gordon,
Thank you for the reply. Your advice is sound practice but in my
opinion it doesn't address my difficulty.
The mail which fails to arrive is being sent under controlled
circumstances and with the exception of the No Headers version all
attempts have included a From: header. And, for this controlled
testing, I do know that there are no carriage returns in the values.
The emails were generated on four seperate severs not owned by the same
parent and hence IP blocks differed. The results however remained the
same even when hard coded values were used in the headers. Each server
could get it through to Gmail et al but none were getting it through to
the vhosted accounts. If it was an IP based block it certainly is very
broad.
Anyway, thanks for considering my problem!
jg
Additionally the address which the
Gordon Burditt wrote:
> >My habitual use of mail() is causing me some grief. I am having
> >slightly different results depending on the server I use but the gist
> >is that mail() is returning 1, and I can send mail to yahoo.com,
> >gmail.com, and hotmail.com no problem. 100% success.
>
> Directly putting values from $_POST[] into email headers without
> checking them for the absence of carriage return or linefeed
> characters WILL get you listed as a spammer because your page WILL
> be abused by spammers. (applies to your FULL HEADERS, FULL HEADERS
> PLUS, and I don't see the 4th way). If you see carriage returns
> or linefields in any fields to be put in headers, you should not
> send mail and tell the spammer to fuck off (but don't be so polite
> about it).
>
> You can expect that some servers will reject your message as SPAM
> because:
> - There is no From: line.
> - The address on the From: line is invalid.
> - The address on the From: line is not allowed to send mail from
> anyplace but specific servers (SPF) and the recipient server is
> enforcing it.
> - You aren't on their whitelist.
> - Some spammer abused a script on another site hosted by the same
> web provider as you did 6 years ago, and you have the same IP address.
>
> Gordon L. Burditt
>
> >Here are four ways I have tried this:
> >
> >// NO HEADERS
> >$to = 'someone@gmail.com';
> >$subject = "Inquiry from some.com";
> >$msg = 'whatever';
> >$result = mail($to, $subject, $msg);
> >
> >// FULL HEADERS
> >$to = 'someone@gmail.com';
> >$subject = "Inquiry from ENLA.com: $_POST[name] $_POST[company]";
> >$headers = "From: $_POST[name] <$_POST[email]>\r\n";
> >$headers .= "Reply-to: $_POST[name] <$_POST[email]>\r\n";
> >$headers .= "Return-Path: $_POST[name] <$_POST[email]>\r\n";
> >$headers .= "Message-ID: <" . date("YdmHis") .
> >".TheSystem@".$_SERVER['SERVER_NAME'].">" . "\r\n";
> >$headers .= "X-Mailer: PHP v". phpversion() . "\r\n";
> >$result = mail($to, $subject, $msg, $headers);
> >
> >// FULL HEADERS PLUS -f FLAG to set the envelope sender address
> >$to = 'someone@gmail.com';
> >$subject = "Inquiry from ENLA.com: $_POST[name] $_POST[company]";
> >$headers = "From: $_POST[name] <$_POST[email]>\r\n";
> >$headers .= "Reply-to: $_POST[name] <$_POST[email]>\r\n";
> >$headers .= "Return-Path: $_POST[name] <$_POST[email]>\r\n";
> >$headers .= "Message-ID: <" . date("YdmHis") .
> >".TheSystem@".$_SERVER['SERVER_NAME'].">" . "\r\n";
> >$headers .= "X-Mailer: PHP v". phpversion() . "\r\n";
> >$result = mail($to, $subject, $msg, $headers,
> >'-fwebmaster@mysite.com');
> >
> >
> >I have also played around with setting all the headers to good
> >addresses at my site to see any bounces from the SMTP server.
[Back to original message]
|