LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices



Reply
 
Search this Thread
Old 10-23-2006, 10:11 PM   #1
tarheel92x
Member
 
Registered: Sep 2003
Location: Southeast USA
Distribution: CentOS
Posts: 111

Rep: Reputation: 15
Sendmail not sending mail


Redhat 9.0
Sendmail 8.12.8-4

I want to send root messages to an external email address. I have edited my /etc/aliases file and set:

root: myemail@domain.net

I then run newaliases.

Without changes to any files in /etc/mail, other than adding root to trusted-users, I can type the following at the command line (as root) and mail is delivered:

mail myemail@domain.net
(subject)test
(body) test
Ctrl+d
Ctrl+d

The message is sent with no errors in my /var/log/maillog.

My system messages are still going to root on the host rather than being forwarded to the external address. I want to send messages related to cron and at to that external account. Is there additional set up in the /etc/aliases file that I am missing?

TIA
 
Old 10-24-2006, 06:04 AM   #2
billymayday
Guru
 
Registered: Mar 2006
Location: Sydney, Australia
Distribution: Fedora, CentOS, OpenSuse, Slack, Gentoo, Debian, Arch, PCBSD
Posts: 6,678

Rep: Reputation: 122Reputation: 122
I don't know sendmail well, but what does the maillog say?
 
Old 10-24-2006, 01:24 PM   #3
trickykid
Guru
 
Registered: Jan 2001
Posts: 24,133

Rep: Reputation: 199Reputation: 199
Quote:
Originally Posted by billmayday
I don't know sendmail well, but what does the maillog say?
Stated that nothing was logging to /var/log/maillog

Quote:
The message is sent with no errors in my /var/log/maillog.
What happens if you check the mail queue?

mailq

Shouldn't you be sending to root instead of your email address to test the forwarding to your ISP account? Also, is this server setup on a DHCP connection? If so, it could possibly be your ISP blocking this email.

And why are you running ctrl-d at the end.. doing something like this should email without problems:

Code:
mail -s "My Subject" root@localhost
<body text here>
.
You can also attach the body using EOF, etc.
 
Old 10-24-2006, 04:05 PM   #4
billymayday
Guru
 
Registered: Mar 2006
Location: Sydney, Australia
Distribution: Fedora, CentOS, OpenSuse, Slack, Gentoo, Debian, Arch, PCBSD
Posts: 6,678

Rep: Reputation: 122Reputation: 122
Actually, I interpret what he says as:

Sending email to external user - no errors

Sending email to root, just goes to root not the alias.
 
Old 10-24-2006, 05:07 PM   #5
Pete M
Member
 
Registered: Aug 2003
Location: UK
Distribution: Redhat 9 FC 3 SUSE 9.2 SUSE 9.3 Gentoo 2005.0 Debian Sid
Posts: 657

Rep: Reputation: 31
tarheel92x

I know this might sound really basic but you did restart sendmail after you made the changes ?

Pete
 
Old 10-24-2006, 05:43 PM   #6
trickykid
Guru
 
Registered: Jan 2001
Posts: 24,133

Rep: Reputation: 199Reputation: 199
Quote:
Originally Posted by Pete M
tarheel92x

I know this might sound really basic but you did restart sendmail after you made the changes ?

Pete
Shouldn't make a difference when dealing with aliases locally to forward or point to a different address.
 
Old 10-27-2006, 02:29 AM   #7
tarheel92x
Member
 
Registered: Sep 2003
Location: Southeast USA
Distribution: CentOS
Posts: 111

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by billymayday
Actually, I interpret what he says as:

Sending email to external user - no errors

Sending email to root, just goes to root not the alias.
Well, sending externally from root works okay, however system messages (ssh logs, etc.) are not being forwarded to my external mail but still going to root's mailbox.

Do I need to edit my alias?
 
Old 10-27-2006, 02:30 AM   #8
tarheel92x
Member
 
Registered: Sep 2003
Location: Southeast USA
Distribution: CentOS
Posts: 111

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by trickykid
Stated that nothing was logging to /var/log/maillog



What happens if you check the mail queue?

mailq
It says "Total requests: 0".

Last edited by tarheel92x; 10-27-2006 at 02:33 AM.
 
Old 10-27-2006, 05:44 AM   #9
billymayday
Guru
 
Registered: Mar 2006
Location: Sydney, Australia
Distribution: Fedora, CentOS, OpenSuse, Slack, Gentoo, Debian, Arch, PCBSD
Posts: 6,678

Rep: Reputation: 122Reputation: 122
A couple of thoughts.

1. Is there another alias for root perhaps?

2. Try setting an alias for another name to your external account and see if sending a message to that get sent on.

3. If you send an email to root from another source (ie not cron) does it work?
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Sendmail - not sending mail movitto Linux - Software 9 09-19-2014 04:23 AM
sendmail not sending mail dtra Linux - Software 1 06-09-2005 08:47 PM
sending picture with mail/sendmail ziox Linux - Networking 1 01-17-2005 12:56 PM
Sending mail without sendmail geomonap Linux - Security 2 12-21-2004 02:32 AM
sendmail not sending mail clinger Linux - Software 8 07-30-2004 03:29 AM


All times are GMT -5. The time now is 02:33 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration