How much should I know to send simple email
I am using CentOS 5.3 to learn linux.
Objective: I am writing a script that when my IP is changed, an email will be sent to inform me the new IP. So, sending a short text thru internet by a command line is all I need. I have do some reading that cover MUA MTA MDA, warnings about open relay, using of m4 and makemap, ... and I still have no idea where to find the answer I need, not even close. I'm not setting mail server, and I intend not receiving email. Please suggest me some areas/keywords to focus. Many thanks for your help. |
you don't need to know anything about mail really. just run "echo this is a message | mail dave@dave.com" and off it should go. If you're doing any more than bash, the php, perl, ruby etc... have their own mail() routines.
|
I tried but failed.
I was thinking about 2 issues, and not sure if anything else is missed. The 1st thing is about the default tight setup on "relay" by CentOS. The 2nd is from my experience in setup Outlook Express that I should input something like smpt.my_isp.com, and maybe corresponding id and password as well. For what I have tried, I received an error message from email. Unfortunately, I am too green to decode it. Then, I add one more line to the file /etc/mail/access Connect:192.168.1.1 RELAY and run the following line makemap hash access.db < access This time, when I tried echo "message" | mail myname@myisp.com , I still receive no email, while error message (internal email) changed from 550 & 503 to 501 Data format error. The error message: Quote:
Quote:
|
You do know there's a free service that does this http://www.dyndns.com/services/dns/dyndns/ or are you keen to learn for academic reasons?
|
Quote:
I want to learn more so that I can have more alternatives when need. |
I have edited the sendmail.mc file, input the smtp server of my isp so that the following line is there.
define(`SMART_HOST', `smtp.myisp.com')dnl I run make -C /etc/mail to make the above line effective. I tried echo "message" | mail myname@myisp.com , and get the same error 553 domain does not exist. I then tried Evolution in gui. The setup is as simple as Outlook Express. I only input the smtp server name, with no user authentication. Email sent and received (on another PC thru internet) instantly. This step confirms me that the smtp server of my isp do not need authentication. But Evolution is still not my answer cause command line can only create an email at OutBox. User must press the send button to send the email. I start to wonder if this kind of "trouble" is made intentionally in linux world in order to discourage spam mail? I do find some names of other smtp clients but query if this is the right direction to go (if I am intentionally discouraged to do so)? |
You're on the right track with "define(`SMART_HOST', `smtp.myisp.com')dnl"
The problem looks like your ISP mail server doesn't recognize who it's getting mail from. If you have a domain name try adding: dnl MASQUERADE_DOMAIN(mydomain.com)dnl or at the very least put your ISP's domain there. |
Quote:
I have tried host.home/home/myisp.com in the MASQUERADE_DOMAIN line but with no luck. I have not set up DNS so I think I don't have the needed domain name here. Am I correct? Must I set up a DNS server, or I can merely "declare" it somewhere? The latest error message is Quote:
|
Hello iwonder :)
In postfix, I had to:
If you don't have a real domain name to use you could ask your mail service provider what their requirements are; for security, most check that the domain name is valid. Mine does not check that the sending IP is associated with the domain name. That does suggest that you can use any valid domain name but it would be very rude to use one without permission! Best Charles |
Quote:
Code:
echo message | /usr/sbin/sendmail -f root@host.home myname@myisp.com |
Quote:
|
Quote:
I change it a little bit to Code:
echo message | /uer/sbin/sendmail -f myname@myisp.com myname@hotmail.com A note for other readers is to beware that the 1st email will be grouped under "JUNK" by Hotmail. Don't miss it. |
All times are GMT -5. The time now is 05:45 AM. |