LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Server (https://www.linuxquestions.org/questions/linux-server-73/)
-   -   Sendmail not sending mail (https://www.linuxquestions.org/questions/linux-server-73/sendmail-not-sending-mail-494991/)

tarheel92x 10-23-2006 09:11 PM

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

billymayday 10-24-2006 05:04 AM

I don't know sendmail well, but what does the maillog say?

trickykid 10-24-2006 12:24 PM

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.

billymayday 10-24-2006 03:05 PM

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.

Pete M 10-24-2006 04:07 PM

tarheel92x

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

Pete

trickykid 10-24-2006 04:43 PM

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.

tarheel92x 10-27-2006 01:29 AM

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?

tarheel92x 10-27-2006 01:30 AM

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".

billymayday 10-27-2006 04:44 AM

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?


All times are GMT -5. The time now is 05:56 PM.