(linux_command_line)-> Sendmail route
submited by Russell Sun 30 Jan 05|
Edited Mon 18 Apr 05
So I had this really annoying problem with my ISP. For year, I had the computer in my house sending logs and other event emails to my work Email so that I would get notice if there was some problem. |
Well, probably as an anti spam measure ( for which I can't totally blame them) they stop allowing outbound connections to anybodys port 25 (stmp send mail ) so suddenly no mail gets though. Including the efax mail
It took me awhile to figure it out, because both the sendmail configuration file and documentation suck. But the trick was to add the line:
This tells sendmail to send outbound mail through this mail server instead of just sending mail directly to the recipient
But sadly this didn't solve the problem, They also required that the from address, be a real domain (not localhost.localdomain which was the default ). One solution to this would have been to assign a domain ( or a subdomain ) to that computer but it really just didn't seem right to have to assign a real domain name to a box that is behind a firewall in my house
I go it to work by changing my scripts to use.
open (OUT,"|/usr/sbin/sendmail -femail@a_real_domain_name -t");
The -f option tells sendmail to claim to be from a different address than the current email@example.com when talking to my ISPs mail server. And ofcourse my script puts in the real address on the "from:" line as well. The -t option tells sendmail to read the mail to figure out where it is to be sent. Sendmail will use that information in the stmp conversation with my ISPs mail server.
This seemed to solve the problem.
Add comment or question...: