LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (http://www.linuxquestions.org/questions/linux-software-2/)
-   -   "mail" command not working (http://www.linuxquestions.org/questions/linux-software-2/mail-command-not-working-672119/)

jonty_11 09-24-2008 02:51 PM

"mail" command not working
 
I am trying to run a mail command from my Linux box and it does not seem to send any emails..

# mail -s Test xxxx@yahoo.com

There are no entried regarding any email attempt from teh box in /var/log messages...

What am I missing?

sendmail process is running ...

Berhanie 09-24-2008 03:06 PM

you need to send something, e.g. the empty file. Try,
Code:

mail -s Test someone@somewhere.com </dev/null

jonty_11 09-24-2008 03:22 PM

Quote:

Originally Posted by Berhanie (Post 3290655)
you need to send something, e.g. the empty file. Try,
Code:

mail -s Test someone@somewhere.com </dev/null

Tried, no luck....

Infact my ealier attempt..I enter and then enter a message body..and then CTRL D to send message..

No luck either way...

Berhanie 09-24-2008 03:28 PM

You can check /var/spool/clientmqueue for the mail and read /var/log/maillog for any problems with sendmail.

jonty_11 09-24-2008 03:37 PM

Message accepted for delivery
 
Quote:

Originally Posted by Berhanie (Post 3290680)
You can check /var/spool/clientmqueue for the mail and read /var/log/maillog for any problems with sendmail.

Interesting as per the maillog...
(m8OKKEEU027018 Message accepted for delivery)

But furthur it says timeouts..
sendmail[26973]: m8OK1rer026971: to=<xxxxx@yahoo.com>, ctladdr=<xxxx> (0/0), delay=00:38:01, xdelay=00:20:01, mailer=esmtp, pri=60342, relay=c.mx.mail.yahoo.com. [xxxxx], dsn=4.0.0, stat=Deferred: Connection timed out with c.mx.mail.yahoo.com.

Does my server need to have a valid email address to be able to send email out?

jonty_11 09-25-2008 01:58 PM

Any ideas?
 
Quote:

Originally Posted by jonty_11 (Post 3290690)
Interesting as per the maillog...
(m8OKKEEU027018 Message accepted for delivery)

But furthur it says timeouts..
sendmail[26973]: m8OK1rer026971: to=<xxxxx@yahoo.com>, ctladdr=<xxxx> (0/0), delay=00:38:01, xdelay=00:20:01, mailer=esmtp, pri=60342, relay=c.mx.mail.yahoo.com. [xxxxx], dsn=4.0.0, stat=Deferred: Connection timed out with c.mx.mail.yahoo.com.

Does my server need to have a valid email address to be able to send email out?

Following up..any ideas anyone?

Thx,

jonty_11 09-29-2008 12:06 PM

Quote:

Originally Posted by jonty_11 (Post 3291687)
Following up..any ideas anyone?

Thx,


Am I not asking the question right or is this group really cold!!!

Berhanie 09-29-2008 02:03 PM

No, we're just tired.

Quote:

Does my server need to have a valid email address to be able to send email out?
Probably. It depends on the kind of validation that's done on the receiving end.
But the error message you got indicates a connection problem. If the problem were
due to an invalid address, you'd get a rejection, instead.

You can try to see if you can connect to the yahoo server via telnet:
Code:

telnet <yahoo-mail-server> 25
Are you able to connect to any other mail servers?

If not, then it's possible that your ISP is blocking outgoing port 25.
If yes, then some filtering (possibly based on IP address) is happening.

Those are some ideas.

jb_get 09-30-2008 01:32 AM

It could very well be that you are being blocked by the ISP as they might not want you to run your own mail server. It happened to me. I eventually switched providers and everything was dandy.

ghostdog74 09-30-2008 02:37 AM

Quote:

Originally Posted by jonty_11 (Post 3290641)
I am trying to run a mail command from my Linux box and it does not seem to send any emails..

# mail -s Test xxxx@yahoo.com

There are no entried regarding any email attempt from teh box in /var/log messages...

What am I missing?

sendmail process is running ...

you need to send your body
Code:


echo "body" | mail -s "test" xxx@yahoo.com


jonty_11 10-01-2008 10:52 AM

Blocking Mail!!!
 
Quote:

Originally Posted by jb_get (Post 3295704)
It could very well be that you are being blocked by the ISP as they might not want you to run your own mail server. It happened to me. I eventually switched providers and everything was dandy.

OK, that makes sense, its comcast, I will call them and find out.

Telnet to yahoo mail server times out too

telnet 216.39.53.3 25
Trying 216.39.53.3...
telnet: connect to address 216.39.53.3: Connection timed out

jonty_11 10-01-2008 11:00 AM

Quote:

Originally Posted by jonty_11 (Post 3297144)
OK, that makes sense, its comcast, I will call them and find out.

Telnet to yahoo mail server times out too

telnet 216.39.53.3 25
Trying 216.39.53.3...
telnet: connect to address 216.39.53.3: Connection timed out

Comcast said "use port 587 for sending mails out....

Do they block based on Dest Port or Source Port - not sure he didnt know...

Is there a way to change sendmail/smtp to use port 587?

Will that work?

Berhanie 10-01-2008 11:04 AM

You can solve this problem by relaying mail through your ISP's mail server.
With Sendmail, just set SMART_HOST to your ISP's outgoing server. You can Google for the proper way to do that.

jonty_11 10-01-2008 11:38 AM

Quote:

Originally Posted by Berhanie (Post 3297156)
You can solve this problem by relaying mail through your ISP's mail server.
With Sendmail, just set SMART_HOST to your ISP's outgoing server. You can Google for the proper way to do that.

Already looked..here is how to do it..
http://www.linuxha.com/other/sendmail/

But I get this error after doing all configs..
Plus I dont get this part?
Now edit the /etc/mail/genericsdomain file and add the entries you want changed, like this:

cookie!cookie!asterisk ncherry@linuxha.com

Now compile it into a db file:

# cd /etc/mail
# makemap -r hash genericstable.db < genericstable

Should I use genericstable or genericsdomain??? I dont have genericstable file and running above command complains about it....

ERROR is here:
Oct 1 10:34:10 fedoracore2uk sendmail[26554]: m91GYAOQ026554: from=<xxxxxxxx>, size=321, class=0, nrcpts=1, msgid=<200810011634.m91GY5KV026553@xxxxxxxx>, proto=ESMTP, daemon=MTA, relay=localhost [127.0.0.1]
Oct 1 10:34:10 fedoracore2uk sendmail[26553]: m91GY5KV026553: to=xxxx@yahoo.com, ctladdr=xxxx(500/500), delay=00:00:05, xdelay=00:00:00, mailer=relay, pri=30014, relay=[127.0.0.1] [127.0.0.1], dsn=2.0.0, stat=Sent (m91GYAOQ026554 Message accepted for delivery)
Oct 1 10:34:10 fedoracore2uk sendmail[26556]: STARTTLS=client: file /etc/mail/certs/cert.pem unsafe: No such file or directory
Oct 1 10:34:10 fedoracore2uk sendmail[26556]: STARTTLS=client: file /etc/mail/certs/key.pem unsafe: No such file or directory
Oct 1 10:34:10 fedoracore2uk sendmail[26556]: STARTTLS=client: file /etc/mail/certs/cacert.pem unsafe: No such file or directory
Oct 1 10:34:10 fedoracore2uk sendmail[26556]: STARTTLS=client, error: load verify locs /etc/mail/certs, /etc/mail/certs/cacert.pem failed: 0
Oct 1 10:34:11 fedoracore2uk sendmail[26556]: STARTTLS=client, relay=smtp.comcast.net, version=TLSv1/SSLv3, verify=FAIL, cipher=DHE-RSA-AES256-SHA, bits=256/256
Oct 1 10:34:12 fedoracore2uk sendmail[26556]: m91GYAOQ026554: to=<xxxx@yahoo.com>, ctladdr=<xxxx> (500/500), delay=00:00:02, xdelay=00:00:02, mailer=relay, pri=30321, relay=smtp.comcast.net [76.96.62.117], dsn=5.0.0, stat=Service unavailable
Oct 1 10:34:12 fedoracore2uk sendmail[26556]: m91GYAOQ026554: m91GYCOQ026556: DSN: Service unavailable

jonty_11 10-08-2008 04:37 PM

Fixed by moving to Postfix
 
Quote:

Originally Posted by jonty_11 (Post 3297188)
Already looked..here is how to do it..
http://www.linuxha.com/other/sendmail/

But I get this error after doing all configs..
Plus I dont get this part?
Now edit the /etc/mail/genericsdomain file and add the entries you want changed, like this:

cookie!cookie!asterisk ncherry@linuxha.com

Now compile it into a db file:

# cd /etc/mail
# makemap -r hash genericstable.db < genericstable

Should I use genericstable or genericsdomain??? I dont have genericstable file and running above command complains about it....

ERROR is here:
Oct 1 10:34:10 fedoracore2uk sendmail[26554]: m91GYAOQ026554: from=<xxxxxxxx>, size=321, class=0, nrcpts=1, msgid=<200810011634.m91GY5KV026553@xxxxxxxx>, proto=ESMTP, daemon=MTA, relay=localhost [127.0.0.1]
Oct 1 10:34:10 fedoracore2uk sendmail[26553]: m91GY5KV026553: to=xxxx@yahoo.com, ctladdr=xxxx(500/500), delay=00:00:05, xdelay=00:00:00, mailer=relay, pri=30014, relay=[127.0.0.1] [127.0.0.1], dsn=2.0.0, stat=Sent (m91GYAOQ026554 Message accepted for delivery)
Oct 1 10:34:10 fedoracore2uk sendmail[26556]: STARTTLS=client: file /etc/mail/certs/cert.pem unsafe: No such file or directory
Oct 1 10:34:10 fedoracore2uk sendmail[26556]: STARTTLS=client: file /etc/mail/certs/key.pem unsafe: No such file or directory
Oct 1 10:34:10 fedoracore2uk sendmail[26556]: STARTTLS=client: file /etc/mail/certs/cacert.pem unsafe: No such file or directory
Oct 1 10:34:10 fedoracore2uk sendmail[26556]: STARTTLS=client, error: load verify locs /etc/mail/certs, /etc/mail/certs/cacert.pem failed: 0
Oct 1 10:34:11 fedoracore2uk sendmail[26556]: STARTTLS=client, relay=smtp.comcast.net, version=TLSv1/SSLv3, verify=FAIL, cipher=DHE-RSA-AES256-SHA, bits=256/256
Oct 1 10:34:12 fedoracore2uk sendmail[26556]: m91GYAOQ026554: to=<xxxx@yahoo.com>, ctladdr=<xxxx> (500/500), delay=00:00:02, xdelay=00:00:02, mailer=relay, pri=30321, relay=smtp.comcast.net [76.96.62.117], dsn=5.0.0, stat=Service unavailable
Oct 1 10:34:12 fedoracore2uk sendmail[26556]: m91GYAOQ026554: m91GYCOQ026556: DSN: Service unavailable


Was able to get it all to work thru gmail instead of comcast and postfix sendmail


All times are GMT -5. The time now is 11:09 AM.