1748201 Members
3062 Online
108759 Solutions
New Discussion юеВ

Re: sendmail on RedHat 8

 
Khalid A. Al-Tayaran
Valued Contributor

sendmail on RedHat 8


Hi,

I'm configuring sendmail on Redhat 8, the /etc/hosts looks like this:

# Do not remove the following line, or various programs
# that require network functionality will fail.
127.0.0.1 redhat localhost.localdomain localhost
129.6.6.48 redhat redhat.localdomain.com
129.6.2.15 exchange.localdomain.com

I think I need to change the first line (localhost.localdomain) to:
127.0.0.1 localhost localhost.localdomain localhost

According to our HP-UX 11.0 /etc/hosts I have (sendmail is working properly here):

127.0.0.1 localhost loopback
129.6.2.39 hpux hpux.localdomain.com
129.6.2.15 exchange.localdomain.com

this is working without DNS and using the file /etc/nsswitch.conf with the entry: "hosts: files [NOTFOUND=continue]"

In Redhat Linux /etc/nsswitch.conf I have:

bootparams: nisplus [NOTFOUND=return] files

ethers: files
netmasks: files
networks: files
protocols: files nisplus
rpc: files
services: files nisplus

netgroup: files nisplus

publickey: nisplus

automount: files nisplus
aliases: files nisplus

1 - Do I need to add: hosts: "files [NOTFOUND=return]" for Linux ?
2 - Do I need to modify the first line in the redhat:/etc/hosts file ?
3 - What other settings I should do to configure sendmail on redhat 8 ?
4 - What is the difference between the two versions ?


Thanks.....

8 REPLIES 8
Stuart Browne
Honored Contributor

Re: sendmail on RedHat 8

Good detailed post, missing one thing though. What's your goal?

1) Nope.
2) Yup. You've got two host entries for the machine 'redhat'. The localhost entry shoudl be enough as:

127.0.0.1 localhost.localdomain localhost

3) see opening satement.
4) of sendmail? Find out what versions of each they are (RH8's is 8.12.5), and check 'changelog' entries at www.sendmail.org.
One long-haired git at your service...
Khalid A. Al-Tayaran
Valued Contributor

Re: sendmail on RedHat 8


Hi,

Thanks...

I'm trying to receive emails from the Linux box. Currently I'm not receiving anything....

What is the problem ??
Khalid A. Al-Tayaran
Valued Contributor

Re: sendmail on RedHat 8


I forgot to add:

I'm emailing to exchange server (relay) and accessing via outlook.

Johan Nielsen
Advisor

Re: sendmail on RedHat 8

Does your Exchange server know about the Linux box? If the Exchange server is the corporate e-mail or smart host, depending on your configuration, you will need to tell your Exchange server about this Linux server.

Johan Nielsen
Advisor

Re: sendmail on RedHat 8

also... you should be able to look at the /var/log/maillog and see if a connection is even being attempted. You can also test sendmail by telneting to port 25 just to make sure that it does answer.
Dave Palica
Advisor

Re: sendmail on RedHat 8

It sounds like you need to set up an MX record in DNS. An MX record is needed when mail is sent to one host, but needs to be forwarded on to a different host. For example, if you want incoming mail to be addressed as user@host1.com but the mail application (such as exchange) is actually located on host2.com, you need to define an MX record as follows:

host1.com IN MX 0 host2.com.

Now mail sent to user@host1.com will be forwarded to user@host2.com.
Khalid A. Al-Tayaran
Valued Contributor

Re: sendmail on RedHat 8


Hi guys:

Out exchange servers don't know anything about UNIX/Linux servers. sendmail on HP-UX is working fine and I'm receiving from unix mail as being sent from root@hostname.company.com

since I wrote in /etc/hosts;

server_IP hostname company.com

Also, the /var/log/mail had these entries:

Jan 9 16:11:04 redhat sendmail[4316]: h074xwd4002346: to=,

ctladdr= (0/0), delay=2+08:11:06, xdelay=00:01:02,
mailer=relay, pri=5160447, relay=129.6.2.15, dsn=4.0.0, stat=Deferred: Name serv
er: 129.6.2.15: host name lookup failure
Steven E. Protter
Exalted Contributor

Re: sendmail on RedHat 8

You still have some issues.

If you want to actually accept outside mail on the Linux box, you need to edit /etc/mail/sendmail.mc and authorize that with the following entry.

DAEMON_OPTIONS(`Port=smtp,Addr=66.92.143.101, Name=MTA')

You also need to make sure the firewall on the Linux box allows traffic on port 25.

Be careful though, you don't want to open youself up for becoming a spam relay site.

Okay, you need to check /etc/access

192.168.0.30 RELAY

This lets my Exchange server relay mail or the Linux to relay it.

I can't be specific on the firewall because ipchains is the default install on Red Hat 7.3 and I upgraded to iptables.

Last, you need my handy dandy little mail configuration builder to make these changes work right.

#!/bin/sh

# A script designed to rebuild all relavent mail databases after a configuration
# change.
#
#

newaliases
cd /etc/mail
makemap -r -v hash access.db < access
makemap -r -v hash domaintable.db < domaintable
makemap -r -v hash genericstable.db < genericstable
makemap -r -v hash mailertable.db < mailertable
makemap -r -v hash virtusertable.db < virtusertable
cp /etc/sendmail.cf /root
m4 /etc/mail/sendmail.mc > /etc/sendmail.cf

vi /etc/sendmail.cf
/etc/init.d/sendmail restart

If by chance your Linux server is sending mail to the internet, it needs a fully qualified domain name to get mail onto aol's and yahoo's mail server. yahoo will accept it but not deliver it. aol will reject it in an kind of in your face manner.


Two ways to do this, make your hostname a real domain name registered with netsol et al.

hostname command will return
servername.mydomain.com

or
in /etc/sendmail.cf
# my official doma
# ... define this
#Dj$w.Foo.COM

uncomment the Dj line, overwrite starting with the $ with your official domain name.

Now, understand, aol can tell if you don't own the domain name. Your ISP needs to give the IP addresses valid names related to your domain or you could still have trouble getting mail into aol.


Now as far as exchange goes, you as noted above need to authorize relay because the default is to NOT accept relay mail.

I also recommend btw cold exchange database backkups. That script is not accessible to me from the net so repost if you want it. I have a good backup/restore procedure that really works. I used it two days ago.


More than you expected or wanted.

Sorry, but sendmail is fun and I need to get a life.

Steve
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com