Linux - ServerThis forum is for the discussion of Linux Software used in a server related context.
Notices
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.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Am in need to setup my mail server (ie sendmail/dovcot). My understanding is to do the following for sendmail:
1) Edit sendmail.mc
2) "make"
3) service sendmail restart
The sendmail server will then be listening in for localling executed "mailx" commands, in addition to port 25 for MUA such as Outlook to connect to. However, is it true that my hosting company must provide me with their SMTP server for me to configure in the sendmail.mc file? If not, how would my sendmail knows which address to relay the outgoing mails to?
If you're just looking for outgoing mail, sendmail handles that. No need for a relay. Or you can set up the "smart relay" feature which will relay all outgoing (ie, not local) mail to that relay. It depends on how you want to set it up and also whether your ISP allows port 25 traffic to internet servers (many don't to thwart spammers).
In order to get incoming mail, you either need an MX DNS record pointing to the public IP address of the machine running sendmail, or a means of getting the mail from whatever machine is designated as the mail server for your domain (eg your ISP's smtp server) such as fetchmail.
Basically I'll have a standalone server acting as the SMTP/Dovcot server. The SMTP part will accept mail from other servers issuing "mailx" commands, and MUA such as Outlook. Is the following true:
1) The line "DS" in sendmail.mc is for setting the next SMTP server to relay mail to, after receiving mails from the other servers' mailx commands and MUA clients. In this case, if the mail server is the last MTA in our domain, we don't need to specify any SMTP servers on the "DS" line in sendmail.mc.
2) The file /etc/resolv.conf needs to have an entry for the DNS server. This name server is then used by sendmail, acting as the last MTA in the domain, to query for IPs of the next MTA to send the e-mails to.
Basically I'll have a standalone server acting as the SMTP/Dovcot server. The SMTP part will accept mail from other servers issuing "mailx" commands, and MUA such as Outlook. Is the following true:
1) The line "DS" in sendmail.mc is for setting the next SMTP server to relay mail to, after receiving mails from the other servers' mailx commands and MUA clients. In this case, if the mail server is the last MTA in our domain, we don't need to specify any SMTP servers on the "DS" line in sendmail.mc.
If this server is going to be responsible for sending the outgoing mail on to the recipients smtp server, then you don't need to set DS.
Quote:
2) The file /etc/resolv.conf needs to have an entry for the DNS server. This name server is then used by sendmail, acting as the last MTA in the domain, to query for IPs of the next MTA to send the e-mails to.
Um... it's not working. Did the following:
1) Ensure the line "nameserver 192.168.10.1" is in my "etc/resolv.conf"
2) Ensure "host www.yahoo.com 192.168.10.1" is resolving an IP
3) Execute "echo "body" | mailx -s "subject" root <address>@hotmail.com
While I can see the mail sent at step 3 in /var/spool/mail/root, I can't see it in the hotmail account. In fact, it's stuck in the mailq. If I "ls /var/spool/mqueue", I can see two files created. One file contains the body and the other contains the header.
Also tried the following but noticed no difference:
1) Add the hostname returned by "hostname" command to /etc/mail/access
2) Execute "makemap hash access < access"
3) Execute "service sendmail restart"
What else am I missing? I simply want to use the "mailx" command to send mail to a normal e-mail address.
In fact it keeps logging a line like the following.
Code:
Jul 3 03:04:31 test sendmail[5130]: o638SVkc005129: to=<addr@hotmail.com>, ctladdr=<root@test.home.com> (0/0), delay=01:36:00, xdelay=01:36:00, mailer=esmtp, pri=60531, relay=mx2.hotmail.com. [65.55.37.88], dsn=4.0.0, stat=Deferred: Connection timed out with mx2.hotmail.com.
So it can connect to hotmail mailserver. Most likely you need to use a smarthost because your ISP blocks port 25.
Add ISP mailserver after the DS in sendmail.cf (like DSmail.isp.com), restart sendmail and check again. Could be that you have to authenticate first in your ISP's mailserver.
OMG! That's it! The ISP does require setting a password on our broadband router to access Internet and I bet you the same for e-mail. Currently I use smtp.spamarrest.com so my Outlook doesn't have the same problem.
However, my attempt to send via smtp.spamarrest.com also failed previously as they don't use the standard port 25 and I'm not sure whether I did set it correctly. You can see my attempt at doing this here. That was on a FC11.
I've since wiped the FC11 with a new CentOS 5.5. I'm actually doing this to test the sendmail setup for my webserver. I guess it'd be no problem on the actual webserver as the hosting company shouldn't have blocked outgoing port 25?
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.