LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (http://www.linuxquestions.org/questions/linux-software-2/)
-   -   Unable to send email from Sendmail (http://www.linuxquestions.org/questions/linux-software-2/unable-to-send-email-from-sendmail-454440/)

rridler 06-13-2006 02:34 PM

Unable to send email from Sendmail
 
I am using Sendmail 8.13.6 on an FC4 machine. I can receive mail, but I am not able to send. Any ideas of what can be causing this and a fix for it?

jeelliso 06-13-2006 02:39 PM

It could be one of a million things. Post the contents of your sendmail.mc file (please remove the dnl commented lines so it won't be so long). I'd be happy to take a look at it.

~Justin

rridler 06-14-2006 11:45 AM

divert(-1)dnl

include(`/usr/share/sendmail-cf/m4/cf.m4')dnl
VERSIONID(`setup for Red Hat Linux')dnl
OSTYPE(`linux')dnl

define(`confDEF_USER_ID',``8:12'')dnl

define(`confTO_CONNECT', `1m')dnl
define(`confTRY_NULL_MX_LIST',true)dnl
define(`confDONT_PROBE_INTERFACES',true)dnl
define(`PROCMAIL_MAILER_PATH',`/usr/bin/procmail')dnl
define(`ALIAS_FILE', `/etc/aliases')dnl
define(`STATUS_FILE', `/var/log/mail/statistics')dnl
define(`UUCP_MAILER_MAX', `2000000')dnl
define(`confUSERDB_SPEC', `/etc/mail/userdb.db')dnl
define(`confPRIVACY_FLAGS', `authwarnings,novrfy,noexpn,restrictqrun')dnl
define(`confAUTH_OPTIONS', `A')dnl

define(`confTO_IDENT', `0')dnl

FEATURE(`no_default_msa',`dnl')dnl
FEATURE(`smrsh',`/usr/sbin/smrsh')dnl
FEATURE(`mailertable',`hash -o /etc/mail/mailertable.db')dnl
FEATURE(`virtusertable',`hash -o /etc/mail/virtusertable.db')dnl
FEATURE(redirect)dnl
FEATURE(always_add_domain)dnl
FEATURE(use_cw_file)dnl
FEATURE(use_ct_file)dnl

FEATURE(local_procmail,`',`procmail -t -Y -a $h -d $u')dnl
FEATURE(`access_db',`hash -T<TMPF> -o /etc/mail/access.db')dnl
FEATURE(`blacklist_recipients')dnl
EXPOSED_USER(`root')dnl

DAEMON_OPTIONS(`Port=smtp,Addr=my.homedns.org, Name=MTA')dnl

FEATURE(`accept_unresolvable_domains')dnl

LOCAL_DOMAIN(`localhost.localdomain')dnl

MAILER(smtp)dnl
MAILER(procmail)dnl

pdeman2 06-14-2006 11:49 AM

I'm not familiar with sendmail, but a couple other things to consider, if it is not your configuration, check your firewall and ISP. Your firewall, or your ISP might be blocking the required ports without you knowing it. This is a common practice for ISPs. Also, make sure DNS is working properly. Sendmail needs to be able to resolve the domains to send the mail.

jeelliso 06-14-2006 12:00 PM

It looks like you've used the exact default sendmail.mc file except you changed Addr=127.0.0.1 to Addr=my.homedns.org. Try changing this part back to the default. I reverted mine to the default and it worked. Now take a look at /var/log/maillog after you try to send a message. Try
Code:

tail /var/logmaillog
to see the end of the file. If you're getting some kind of error similar to this:
Code:

dsn=5.6.0, stat=Data format error
here is the fix that worked for me.

In /etc/mail/sendmail.cf there is a section that reads
Code:

# my official domain name
# … define this only if Sendmail cannot automatically determine your domain
Dj$w.foo.COM

by default. The last line should be changed to
Code:

Dj{myDomain}
where {myDomain} is the qualified domain name of the machine.

If this doesn't work, then we'll try something else.

Good Luck,
~Justin

rridler 06-15-2006 09:34 AM

this is what I get when I run tail /var/maillog
dsn=4.0.0, stat=Deferred: mail2.pomeroy.com.: No route to host

jeelliso 06-15-2006 01:00 PM

Sorry, but could you post the entire messge starting with the date. Here was my error message, for example:
Code:

Jun  1 16:03:25 mailman sendmail[17394]: k51K3Po9017392: to=<jeellison@tva.gov>, ctladdr=<nobody@localhost.localdomain> (99/99), delay=00:00:00, xdelay=00:00:00, mailer=relay, pri=122110, relay=marvin.cha.tva.gov. [152.85.50.106], dsn=5.6.0, stat=Data format error
The key part of your error is "dsn=4.0.0" The dsn error code refers to RFC 1893. This code corresponds to a "Persistent Transient Failure." This could mean a lot of different things, so post the rest of your error and I'll try to troubleshoot some more.

Just remember to be patient with Sendmail and it will be good to you in the future.

~Justin

rridler 06-15-2006 01:13 PM

Jun 15 13:46:40 sendmail[2890]: k5FHkODr002888: to=<*@pomeroy.com>, ctladdr=<*@*.HomeDNS.org> (500/0), delay=00:00:15, xdelay=00:00:15, mailer=esmtp, pri=120521, relay=mail2.pomeroy.com. [216.68.84.101], dsn=4.0.0, stat=Deferred: mail2.pomeroy.com.: No route to host

jeelliso 06-15-2006 01:26 PM

I looks like you've got Sendmail set up correctly. Since your dsn error is not a 5.x.x error, then the error is not permenant. The "No route to host" means exactly what it sounds like; it can't access the remote location, which is in this case mail2.pomeroy.com. Make sure your computer (i.e. firewall, router) are correctly configured for port 25, which Sendmail uses to send mail. You need port 25 open and that port also needs to be forwarded to your PC if you're behind a router.

An easy way to see if your Sendmail connection is working is to
Code:

telnet 127.0.0.1 25
If it lets you connect then you're probably configured correctly. If you get an error that says
Code:

Unable to connect to remote host:  Connection refused
this means that the remote host you are trying to connect to does not receive connections. I tested mail2.pomeroy.com and received this error. Try sending mail to me: jeelliso@gmail.com and see if it will work.

~Justin

rridler 06-15-2006 01:51 PM

Jun 15 14:41:24 Ridler sendmail[3258]: k5FIfObr003258: to=*@fuse.net,*@gmail.com, ctladdr=*@Ridler.HomeDNS.org (500/0), delay=00:00:00, xdelay=00:00:00, mailer=relay, pri=60536, relay=[127.0.0.1] [127.0.0.1], dsn=2.0.0, stat=Sent (k5FIfO3w003260 Message accepted for delivery)
Jun 15 14:41:39 Ridler sendmail[3262]: k5FIfO3w003260: to=<*@fuse.net>, ctladdr=<*@Ridler.HomeDNS.org> (500/0), delay=00:00:15, xdelay=00:00:15, mailer=esmtp, pri=150712, relay=mx1.fuse.net. [216.68.8.211], dsn=4.0.0, stat=Deferred: mx1.fuse.net.: No route to host
Jun 15 14:42:28 Ridler sendmail[3262]: k5FIfO3w003260: to=<*@gmail.com>, ctladdr=<*@Ridler.HomeDNS.org> (500/0), delay=00:01:04, xdelay=00:00:49, mailer=esmtp, pri=150712, relay=gsmtp163.google.com. [64.233.163.27], dsn=4.0.0, stat=Deferred: gsmtp163.google.com.: No route to host
Jun 15 14:46:23 Ridler sendmail[3234]: k5FIcw46003234: *.HomeDNS.org [127.0.0.1] did not issue MAIL/EXPN/VRFY/ETRN during connection to MTA

jeelliso 06-15-2006 02:00 PM

So can you or can you not telnet to your local host on port 25?

rridler 06-15-2006 02:03 PM

I can telnet to my localhost

jeelliso 06-15-2006 02:07 PM

The only thing I *think* it could be is some kind of problem with your network; are you behind a router or some other wierd configuration?

What client are you using to try to send the email? If you're not using "mail" then try that.

If you've tried to send a bunch of messages that have failed, you might want to clean out your mqueue (/var/spool/mqueue) so all those back messages don't get send WHEN you get sendmail working.

~Justin

rridler 06-15-2006 02:13 PM

This machine is my router/firewall, it is connected directly to my broadband modem, everything else is behind it.
I am using Webmin for sending the messages, and I keep the mqueue clear.

jeelliso 06-15-2006 02:26 PM

I'm all out sane of ideas except blaming it on your ISP. Who is your internet provider? If you can receive mail, but cannot send it, pdeman2 may have been right when he said your ISP may be blocking certain ports coming out of your machine. Try
Code:

traceroute -p 25 googe.com
and post your results. Sorry I was not able to help much more than I am. Just when you think you understand sendmail, it gets the best of you.

~Justin


All times are GMT -5. The time now is 09:38 PM.