Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Introduction to Linux - A Hands on Guide
This guide was created as an overview of the Linux Operating System, geared toward new users as an exploration tour and getting started guide, with exercises at the end of each chapter.
For more advanced trainees it can be a desktop reference, and a collection of the base knowledge needed to proceed with system and network administration. This book contains many real life examples derived from the author's experience as a Linux system and network administrator, trainer and consultant. They hope these examples will help you to get a better understanding of the Linux system and that you feel encouraged to try out things on your own.
Click Here to receive this Complete Guide absolutely free.
Right now your using your machine as a mail server to mail out. Their mail servers, most of them in fact., check to see if the sender's address is legitmate before accepting the mail.
If you do not have a cononical domain name such as bobshouse.com or something, this will always happen, regardless of your mailserver. If you do have a domain name, and a static IP, this is easy to configure, just add the domain name and IP that sendmail should be associated with to /etc/hosts. Do not remove the localhost entry. Then just kill and re-start sendmail. The easies way to do this is to reboot the machine.
If you wanted to try and spoof the other machine, by say, calling yourself yahoo.com, well the other machine will do an nslookup to make sure that your IP matches the IP yahoo.com should be... and it will bounce. Bummer eh?
If your ISP will provide you with a static, its a breeze, and cheap, to run your own domain. A gaggle of people could help you with that on this forum.
Oh, and yes... Sendmail is a beast to try and fix, but luckily it almost never breaks.
Have a look at your sendmail.cf file (/etc/sendmail.cf file or /etc/mail/sendmail.cf is your sendmail version is a newer one). The hostname can be hard-coded into it which would override any entries you have in /etc/hosts. I can't remeber by head which directive to look at (it's been ages since I last serviced Sendmail. Once I became a sendmail admin I gave up on sendmail and i'm a postfix advocate now. It's easier to manage, therefore making it a lot more scalable in my eyes and it's as good as sendmail if not better. It's been running 200+ days now on my server sending about 80,000 (eighty thousand) emails a day, and I've never noticed it in system performance, load avg. never goes above 0.02).
Anyways, my advice is clear I guess from this. Let's have a look at your sendmail.cf file but if you are in the position and willing, give postfix a try. I'm pretty sure you won't be sorry.
PS: one reason to keep sendmail is if you like playing with the Rulesets. They truely are a fun pass time if you have the time to kill.
it may complain about no input. If that's the case, try sendmail -d0.1 -bt < /dev/null
it should give you some info like the hostname and other aliases it has found. Is it listing a canonical name (ie: the fully qualified domain name)?
Look especially at the value for $j. Output should be something like:
(canonical domain name) $j = my.domain.org
(i'm doing this by head, so exact phrase may be different).
If $j isn't what you expect it to be (instead it's a short name like an alias) it's because your 'hostname' output isn't proper, or /etc/hosts isn't setup right. This is a common problem on many distributions. I'm not going into how to fix it for every distribution, so instead of fixing the distro I'll just tell you to fix this problem in sendmail.cf (so it's a workaround).
In sendmail.cf find a line that begins with Dj.
If it doesn't exist, insert it yourself. Syntax is:
no spaces between Dj and the Fully Qualified Domain Name (FQDN).
nocanonify isn't a great thing to do. It'll look like emails you send come from youruser@yourshortname (in my case it would be gerard@shadowfax) and remote systems will have a very hard time bouncing such a message later on since it has no idea what machine is gerard@shadowfax
Also you'll see that a lot of sites will not allow mail to be sent if the sender envelope doesn't contain an FQDN. Better to just have a yourdomain.org there and be done with it.
I see what you mean. Adding my domain doesn't seem to be 100% effective. I rune a mail script (perl cgi) and w/o the nocanonfy I can't use the switch -oi which tells me it's having problems with the address. To clarify adding my domain:
Does it have to be referenced elsewhere on my machine?
the "my" in my.domain.org , is the "www" or a username?
What exactly is the error message you get when using the -oi switch?
Either way, the best thing to do for email is that your sendmail is configured with the same hostname as the IP address of your machine resolves back into.
note that this isn't always identical to the contents of /etc/hosts - this isn't used by remote servers, just DNS is used. So the output of the 'hostname -f' command isn't always what you should enter in sendmail.
You should run "dig -x yourboxipaddress" and whatever it returns, that is what you give to Sendmail.
;; QUESTION SECTION:
;126.96.36.199.in-addr.arpa. IN PTR
;; ANSWER SECTION:
188.8.131.52.in-addr.arpa. 86400 IN PTR w001.z208177250.bos-ma.dsl.cnc.net.
;; AUTHORITY SECTION:
250.177.208.in-addr.arpa. 86400 IN NS nameserver1.concentric.net.
250.177.208.in-addr.arpa. 86400 IN NS nameserver2.concentric.net.
250.177.208.in-addr.arpa. 86400 IN NS nameserver3.concentric.net.
250.177.208.in-addr.arpa. 86400 IN NS nameserver.concentric.net.
;; ADDITIONAL SECTION:
nameserver.concentric.net. 7200 IN A 184.108.40.206
nameserver1.concentric.net. 7200 IN A 220.127.116.11
nameserver2.concentric.net. 7200 IN A 18.104.22.168
nameserver3.concentric.net. 7200 IN A 22.214.171.124
;; Query time: 64 msec
;; SERVER: 192.168.0.1#53(192.168.0.1)
;; WHEN: Sat Jan 19 10:24:43 2002
;; MSG SIZE rcvd: 270
Originally posted by te_conway ;; ANSWER SECTION:
126.96.36.199.in-addr.arpa. 86400 IN PTR w001.z208177250.bos-ma.dsl.cnc.net.
Okay, the IP address resolves back into w001.z208177250.bos-ma.dsl.cnc.net
Is this a dynamic IP address? It's best to tell sendmail to return that exact hostname when it's sending mail.
Now if this is a dynamic address it's kind of a pain to keep it in sync (you could create a script that will update the sendmail.cf file everytime you make an Internet connection). A better alternative would be using the smarthost feature (DS option I believe) and have your sendmail installation use your ISP's smtp server. This'll make sure email does arive at the place of destination without having to worry about your IP address and current hostname.
Originally posted by te_conway I have a Static IP, DSL 24x7
My domain points to a netgear router which directs traffic to my server.
Where do I put that cyptic string, in the Dj directive of sendmail.cf?
PS: Really appreaciate this help
Yes, put it there.
PS: it may not work properly after you make that change. The router who's directing your traffic may be a problem causer along the way too, but we'll deal with that later. First try it, it may work (as I don't know anything about your network setup, who has what IP address, what the router does, ip_masq or not, etc, etc).
If sendmail won't work after having made this change, I'll ask some questions regarding your network setup.
PS, email to firstname.lastname@example.org when you go test something. I can then check the mail.log at the linuxfromscratch.org server and see if there are some additonal clues.