LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (http://www.linuxquestions.org/questions/linux-software-2/)
-   -   configure RHEL4 server to send mail ? (http://www.linuxquestions.org/questions/linux-software-2/configure-rhel4-server-to-send-mail-373927/)

gosh 10-17-2005 10:25 AM

configure RHEL4 server to send mail ?
 
I am running RHEL 4.
All I need to do is set the machine up so that it can send mail. It does not need to receive mail or forward on mail from anywhere else.

I have searched and searched on the net and I cannot work out how to do this, the one billion hits I get about configuring sendmail for some fancy mail server set up get in the way of the very basic thing I need to acheive.

I just need our linux server set up so that when it generates a notification email it can send it. EG send all mail it normally sends to the root account to another email address.

We have an IP address for an relay that is on our private network ( 97.0.0.47 ) so we just need to set that up as our outgoing email server.

Please help ! Our root email address is filling up - we just want to have the machine send this mail on to another email address that we actually read on a daily basis.

blkcamarozr28 10-17-2005 09:01 PM

Here's the quickie:

/etc/mail/local-host-names
your.domain.net ***Add your domain in here

edit sendmail.mc
define(`SMART_HOST',`[smtp-server.MyISP.com]') ***Brackets stops sendmail from doing MX Lookup***

/etc/mail
make -C /etc/mail ***Use this command to compile .mc to .cf***

blkcamarozr28 10-17-2005 09:20 PM

Whoops read that too fast.

Here's what you can do to forward all root email to another account:

echo someEmail@my.email.com > $HOME/.forward


Or you can do it via the Aliases file. <BETTER WAY>

/etc/aliases and set:

root: <dest_mailaddress>

The run "newaliases"

gosh 10-18-2005 06:36 AM

thankyou everso much, that worked :)

If I send a mail from that machine to another address
(eg I use
Code:

mail evilc@evilc.com
from the command-line) it won't deliver.
Is it easy to set it to forward all outbound mail to the email server specified in (`SMART_HOST',`[smtp-server.MyISP.com]') ?

Also, when mail arrives at the destination, it is from "Root <root@osiris.gosh.nhs.uk>" - which just shows up in the address column of my MUA as "root". Can I change this to "Root@Osiris" easily ?

TIA

blkcamarozr28 10-18-2005 01:48 PM

If you setup the SMART_HOST this will forward all your email to that SMTP server. Which is what you want right? As for your Root@Osiris account check the sendmail doc's. There is a way to send your email as someone else but i havent done this before. Give it a google. :)


All times are GMT -5. The time now is 03:43 AM.