A general alert for sendmail users
if your emails aren't being delivered
I've had the same sendmail setup for YEARS with no problems, but I recently noticed that some of my generated emails weren't being delivered. I specifically saw that they weren't being delivered to Gmail because I have all of my emails directed to Gmail, but it could have also been affecting other email providers, too.
++++++++++++++
list of top cheapest host http://Listfreetop.pw
Top 200 best traffic exchange sites http://Listfreetop.pw/surf
free link exchange sites list http://Listfreetop.pw/links
list of top ptc sites
list of top ptp sites
Listfreetop.pw
Listfreetop.pw
+++++++++++++++
It took about 4 days of digging to figure out the problem.
When using sendmail, it's required to have an email address in the From: field; eg:
CSDude <example@example.com>
In my scripts I never forced a return email address; I plugged it in if provided by the user, but if not then the system always plugged in my_server_account@my_server_name.com.
But apparently this is no longer acceptable. I stumbled across this error in my server's delivery report:
ECDHE-RSA-AES128-GCM-SHA256:128 CV=yes: SMTP error from remote mail server after end of data: 550-5.7.1 [123.45.67.89 14] Messages missing a valid address in From:\n550 5.7.1 header, or having no From: header, are not accepted. k8si721600qtj.365 - gsmtp
(where 123.45.67.89 represents my server's IP)
The solution was to simply force a From: email address in all of my scripts. I also used the -f flag, like so:
# Perl (not sure if -tif is the same as -ti -f?
open (MAIL,"|$mailprog -ti -f "example\@example.com");
print MAIL <<EOF;
To: to\@example.com
From: CSDude <example\@example.com>
Subject: the subject
blah blah blah
EOF;
close (MAIL);
host 0.0.0.0 angular
pokemon x make money
surf4sun.net
domain king
hosting 40th birthday party
moonbit.co.in
8 ways to make money without working
servicebyart.biz
www.redmansurf.com
# PHP
$to = 'to@example.com';
$subject = 'the subject';
$message = 'hello';
$headers = 'From: CSDude <example@example.com>' . "\r\n" .
'Reply-To: example@example.com' . "\r\n" .
'X-Mailer: PHP/' . phpversion();
mail($to, $subject, $message, $headers, '-f example@example.com');
And since we're talking about it, here are all of the -options for sendmail:
[commandlinux.com...]
But I am curious about one minor issue.
Let's say that the sender's username is (csdude), with the parentheses. And my From: is:
From: $username <example\@example.com>
The ( ) throws it off, so when I get the email it says it's from:
) <example@example.com>
So what do I need to do? Convert them to %28 and %29?
parentheses in the local part of email addresses must be quoted (i.e. preceded by a backslash)
Nice, thanks for sharing, it can be a real headache. I've been using (lucky me) sendmail with to and from for years ago.