A general alert for sendmail users


SUBMITTED BY: Guest

DATE: Nov. 5, 2019, 5:16 p.m.

FORMAT: Text only

SIZE: 3.0 kB

HITS: 358

  1. A general alert for sendmail users
  2. if your emails aren't being delivered
  3. 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.
  4. ++++++++++++++
  5. list of top cheapest host http://Listfreetop.pw
  6. Top 200 best traffic exchange sites http://Listfreetop.pw/surf
  7. free link exchange sites list http://Listfreetop.pw/links
  8. list of top ptc sites
  9. list of top ptp sites
  10. Listfreetop.pw
  11. Listfreetop.pw
  12. +++++++++++++++
  13. It took about 4 days of digging to figure out the problem.
  14. When using sendmail, it's required to have an email address in the From: field; eg:
  15. CSDude <example@example.com>
  16. 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.
  17. But apparently this is no longer acceptable. I stumbled across this error in my server's delivery report:
  18. 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
  19. (where 123.45.67.89 represents my server's IP)
  20. The solution was to simply force a From: email address in all of my scripts. I also used the -f flag, like so:
  21. # Perl (not sure if -tif is the same as -ti -f?
  22. open (MAIL,"|$mailprog -ti -f "example\@example.com");
  23. print MAIL <<EOF;
  24. To: to\@example.com
  25. From: CSDude <example\@example.com>
  26. Subject: the subject
  27. blah blah blah
  28. EOF;
  29. close (MAIL);
  30. host 0.0.0.0 angular
  31. pokemon x make money
  32. surf4sun.net
  33. domain king
  34. hosting 40th birthday party
  35. moonbit.co.in
  36. 8 ways to make money without working
  37. servicebyart.biz
  38. www.redmansurf.com
  39. # PHP
  40. $to = 'to@example.com';
  41. $subject = 'the subject';
  42. $message = 'hello';
  43. $headers = 'From: CSDude <example@example.com>' . "\r\n" .
  44. 'Reply-To: example@example.com' . "\r\n" .
  45. 'X-Mailer: PHP/' . phpversion();
  46. mail($to, $subject, $message, $headers, '-f example@example.com');
  47. And since we're talking about it, here are all of the -options for sendmail:
  48. [commandlinux.com...]
  49. But I am curious about one minor issue.
  50. Let's say that the sender's username is (csdude), with the parentheses. And my From: is:
  51. From: $username <example\@example.com>
  52. The ( ) throws it off, so when I get the email it says it's from:
  53. ) <example@example.com>
  54. So what do I need to do? Convert them to %28 and %29?
  55. parentheses in the local part of email addresses must be quoted (i.e. preceded by a backslash)
  56. Nice, thanks for sharing, it can be a real headache. I've been using (lucky me) sendmail with to and from for years ago.

comments powered by Disqus