Link to home
Create AccountLog in
Linux

Linux

--

Questions

--

Followers

Top Experts

Avatar of alanbk
alanbk

Redhat 8 Sendmail Issues
I'm trying to configure sendmail.  It's basically working but I have some problem.

1. all mail is sent from localhost.localdoman

2. Can't seem to get Relay access file working.


Here is the /etc/hosts:
127.0.0.1       WebServer       localhost.localdomain   localhost
192.168.0.5     WebServer      WebServer.mydomain.com    
www     mail

*********
mydomain.com is used in place of my real domain name for this message
************


The netstat -an|grep 25|grep tcp reports:

[root@WebServer root]# netstat -an|grep 25|grep tcp
tcp        0      0 127.0.0.1:1025          0.0.0.0:*               LISTEN      

tcp        0      0 0.0.0.0:25              0.0.0.0:*               LISTEN


From what i have read, I don't think the 127.0.0.1 line should be there.

I've ran make after editing the access file and m4 after editing the the m4 command.

I've stopped and started sendmail after every change.

My domanin is fully quailified.


hostname on the machine returns:WebServer

domainame returns: mydoman.com


here is my resolv.conf:
nameserver 24.48.44.2
nameserver 24.48.44.3
nameserver 192.168.0.5


Here is my sendmail.mc file:

dnl This is the sendmail macro config file. If you make changes to this file,
dnl you need the sendmail-cf rpm installed and then have to generate a
dnl new /etc/mail/sendmail.cf by running the following command:
dnl
dnl        m4 /etc/mail/sendmail.mc > /etc/mail/sendmail.cf
dnl
include(`/usr/share/sendmail-cf/m4/cf.m4')
VERSIONID(`linux setup for Red Hat Linux')dnl
OSTYPE(`linux')
dnl Uncomment and edit the following line if your mail needs to be sent out
dnl through an external mail server:
dnl define(`SMART_HOST',`smtp.your.provider')
define(`confDEF_USER_ID',``8:12'')dnl
undefine(`UUCP_RELAY')dnl
undefine(`BITNET_RELAY')dnl
dnl define(`confAUTO_REBUILD')dnl
define(`confTO_CONNECT', `1m')dnl
define(`confTRY_NULL_MX_LIST',true)dnl
define(`confDONT_PROBE_INTERFACES',true)dnl
define(`PROCMAIL_MAILER_PATH',`/usr/bin/procmail')dnl
define(`ALIAS_FILE', `/etc/aliases')dnl
dnl define(`STATUS_FILE', `/etc/mail/statistics')dnl
define(`UUCP_MAILER_MAX', `2000000')dnl
define(`confUSERDB_SPEC', `/etc/mail/userdb.db')dnl
define(`confPRIVACY_FLAGS', `authwarnings,novrfy,noexpn,restrictqrun')dnl
define(`confAUTH_OPTIONS', `A')dnl
dnl TRUST_AUTH_MECH(`EXTERNAL DIGEST-MD5 CRAM-MD5 LOGIN PLAIN')dnl
dnl define(`confAUTH_MECHANISMS', `EXTERNAL GSSAPI DIGEST-MD5 CRAM-MD5 LOGIN PLA
IN')dnl
dnl define(`confCACERT_PATH',`/usr/share/ssl/certs')
dnl define(`confCACERT',`/usr/share/ssl/certs/ca-bundle.crt')
dnl define(`confSERVER_CERT',`/usr/share/ssl/certs/sendmail.pem')
dnl define(`confSERVER_KEY',`/usr/share/ssl/certs/sendmail.pem')
dnl define(`confTO_QUEUEWARN', `4h')dnl
dnl define(`confTO_QUEUERETURN', `5d')dnl
dnl define(`confQUEUE_LA', `12')dnl
dnl define(`confREFUSE_LA', `18')dnl
define(`confTO_IDENT', `0')dnl
dnl FEATURE(delay_checks)dnl
FEATURE(`no_default_msa',`dnl')dnl
FEATURE(`smrsh',`/usr/sbin/smrsh')dnl
FEATURE(`mailertable',`hash -o /etc/mail/mailertable.db')dnl
FEATURE(`virtusertable',`hash -o /etc/mail/virtusertable.db')dnl
FEATURE(redirect)dnl
FEATURE(always_add_domain)dnl
FEATURE(use_cw_file)dnl
FEATURE(use_ct_file)dnl
dnl The '-t' option will retry delivery if e.g. the user runs over his quota.
FEATURE(local_procmail,`',`procmail -t -Y -a $h -d $u')dnl
FEATURE(`access_db',`hash -T<TMPF> -o /etc/mail/access.db')dnl
FEATURE(`blacklist_recipients')dnl
EXPOSED_USER(`root')dnl
dnl This changes sendmail to only listen on the loopback device 127.0.0.1
dnl and not on any other network devices. Comment this out if you want
dnl to accept email over the network.
dnl DAEMON_OPTIONS(`Port=smtp,Addr=127.0.0.1, Name=MTA')
dnl NOTE: binding both IPv4 and IPv6 daemon to the same port requires
dnl       a kernel patch
dnl DAEMON_OPTIONS(`port=smtp,Addr=::1, Name=MTA-v6, Family=inet6')
dnl We strongly recommend to comment this one out if you want to protect
dnl yourself from spam. However, the laptop and users on computers that do
dnl not have 24x7 DNS do need this.
dnl FEATURE(`accept_unresolvable_domains')dnl
dnl FEATURE(`relay_based_on_MX')dnl
MAILER(smtp)dnl
MAILER(procmail)dnl
Cwlocalhost.localdomain



Thank for any help you can give

Zero AI Policy

We believe in human intelligence. Our moderation policy strictly prohibits the use of LLM content in our Q&A threads.


Avatar of jleviejlevie

The first thing to do is to change the hosts file to read:

127.0.0.1       localhost.localdomain   localhost
192.168.0.5     WebServer.mydomain.com Wenserver www mail

The Fully Qualified Domain Name (FQDN) must be first and the systems real host name can't be defined for both the localhost IP and the real IP. Next edit /etc/sysconfig/network and make sure that the hostname is defined as the FQDN, like:

HOSTNAME=WebServer.mydomain.com

I always like to explicitly list the server's name(s) in /etc/local-host-names, like:

localhost
webserver
mail
www
webserver.mydomain.com
mydomain.com

With those changes in place (you can force the hostname change with 'hostname webserver.mydomaincom) restart sendmail and mail should now appear to be from the FQDN of the system. If you want the mail to appear to be from the domain instead of the hostname you'll need the Masquerade features in your sendmail.mc.

I don't know what your are trying to do with the access map so I can't yet tell you what's wrong there. If you'd explain a bit more about your needs and show me your access file we can solve the problem.
 

Avatar of alanbkalanbk

ASKER

I did all that and mail -v hung :



[root@WebServer mail]# mail -v alanbk@yahoo.com
Subject: Testxxx
testxxx
.
Cc:
alanbk@yahoo.com... Connecting to localhost.mydomain.com. via relay...


when i did a ping of localhost.mydomanin.com I did get response.


Avatar of alanbkalanbk

ASKER

Changed the hostname back to Webserver(from webserver.mydomain.com as suggested) and the mail worked but still with loaclhost.localdomain

[root@WebServer mail]# hostname Webserver
[root@WebServer mail]# mail -v alanbk@yahoo.com
Subject: Test
TEst
.
Cc:
alanbk@yahoo.com... Connecting to localhost.localdomain. via relay...
220 webserver.abkprod.dynip.com ESMTP Sendmail 8.12.5/8.12.5; Fri, 7 Feb 2003 12
:13:33 -0500
>>> EHLO localhost.localdomain
250-webserver.mydomain.com Hello Webserver [127.0.0.1], pleased to meet you

250-ENHANCEDSTATUSCODES
250-PIPELINING
250-8BITMIME
250-SIZE
250-DSN
250-ETRN
250-DELIVERBY
250 HELP
>>> MAIL From:<root@localhost.localdomain> SIZE=41
250 2.1.0 <root@localhost.localdomain>... Sender ok
>>> RCPT To:<alanbk@yahoo.com>
>>> DATA
250 2.1.5 <alanbk@yahoo.com>... Recipient ok
354 Enter mail, end with "." on a line by itself
>>> .
250 2.0.0 h17HDXjU005541 Message accepted for delivery
alanbk@yahoo.com... Sent (h17HDXjU005541 Message accepted for delivery)
Closing connection to localhost.localdomain.
>>> QUIT                 alanbk@yahoo.com... Deferred: Connection timed out with
 localhost.mydomain.com.ynip.com closing connection
[root@WebServer mail]#



Reward 1Reward 2Reward 3Reward 4Reward 5Reward 6

EARN REWARDS FOR ASKING, ANSWERING, AND MORE.

Earn free swag for participating on the platform.


Avatar of alanbkalanbk

ASKER

Missed an edit out of the real domain name, since i missed it there it the real one editited:

[root@WebServer mail]# hostname Webserver
[root@WebServer mail]# mail -v alanbk@yahoo.com
Subject: Test
TEst
.
Cc:
alanbk@yahoo.com... Connecting to localhost.localdomain. via relay...
220 webserver.abkprod.dynip.com ESMTP Sendmail 8.12.5/8.12.5; Fri, 7 Feb 2003 12
:13:33 -0500
>>> EHLO localhost.localdomain
250-webserver.abkprod.dynip.com Hello Webserver [127.0.0.1], pleased to meet you

250-ENHANCEDSTATUSCODES
250-PIPELINING
250-8BITMIME
250-SIZE
250-DSN
250-ETRN
250-DELIVERBY
250 HELP
>>> MAIL From:<root@localhost.localdomain> SIZE=41
250 2.1.0 <root@localhost.localdomain>... Sender ok
>>> RCPT To:<alanbk@yahoo.com>
>>> DATA
250 2.1.5 <alanbk@yahoo.com>... Recipient ok
354 Enter mail, end with "." on a line by itself
>>> .
250 2.0.0 h17HDXjU005541 Message accepted for delivery
alanbk@yahoo.com... Sent (h17HDXjU005541 Message accepted for delivery)
Closing connection to localhost.localdomain.
>>> QUIT                 alanbk@yahoo.com... Deferred: Connection timed out with
 localhost.abkprod.dynip.com.ynip.com closing connection
[root@WebServer mail]#

Make sure that /etc/mail/access contains at least:

localhost.localdomain           RELAY
localhost                       RELAY
127.0.0.1                       RELAY

and if you change that file that you re-make the access map.

Could I see the contents of:

1) /etc/hosts
2) /etc/sysconfig/network
3) /etc/mail/local-host-names
4) /etc/mail/access
5) the output of hostname

Avatar of alanbkalanbk

ASKER

/etc/hosts:
127.0.0.1       localhost.localdomain
192.168.0.5     WebServer WebServer.abkprod.dynip.com www mail

[root@WebServer mail]# cat /etc/sysconfig/network
NETWORKING=yes
HOSTNAME=WebServer.abkprod.dynip.com
GATEWAY=192.168.0.254

[root@WebServer mail]# cat /etc/mail/local-host-names
# local-host-names - include all aliases for your machine here.
localhost
WebServer
mail
WebServer.abkprod.dynip.com
www
abkprod.dynip.com


[root@WebServer mail]# cat /etc/mail/access
# by default we allow relaying from localhost...
localhost.localdomain           RELAY
localhost                       RELAY
127.0.0.1                       RELAY
abkprod.dynip.com               RELAY
192.168.0                       RELAY

[root@WebServer mail]#hostname
webserver.abkprod.dynip.com


The timeout error:
[root@WebServer mail]#    alanbk@yahoo.com... Deferred: Connection timed out with localhost.abkprod.dynip.com.



Free T-shirt

Get a FREE t-shirt when you ask your first question.

We believe in human intelligence. Our moderation policy strictly prohibits the use of LLM content in our Q&A threads.


Avatar of alanbkalanbk

ASKER

/etc/hosts:
127.0.0.1       localhost.localdomain
192.168.0.5     WebServer WebServer.abkprod.dynip.com www mail

[root@WebServer mail]# cat /etc/sysconfig/network
NETWORKING=yes
HOSTNAME=WebServer.abkprod.dynip.com
GATEWAY=192.168.0.254

[root@WebServer mail]# cat /etc/mail/local-host-names
# local-host-names - include all aliases for your machine here.
localhost
WebServer
mail
WebServer.abkprod.dynip.com
www
abkprod.dynip.com


[root@WebServer mail]# cat /etc/mail/access
# by default we allow relaying from localhost...
localhost.localdomain           RELAY
localhost                       RELAY
127.0.0.1                       RELAY
abkprod.dynip.com               RELAY
192.168.0                       RELAY

[root@WebServer mail]#hostname
webserver.abkprod.dynip.com


The timeout error:
[root@WebServer mail]#    alanbk@yahoo.com... Deferred: Connection timed out with localhost.abkprod.dynip.com.



Your hosts file is wrong. Change it to look like:

127.0.0.1       localhost.localdomain localhost
192.168.0.5     WebServer.abkprod.dynip.com WebServer www mail

The FQDN (WeBServer.abkprod.dynip.com) must be listed first, then the shortnames. I think this is probably the cause of the difficulty.

I don't think it does any harm, but you don't need abkprod.dynip.com               RELAY

in the access map. It will suffice to have:

localhost.localdomain           RELAY
localhost                       RELAY
127.0.0.1                       RELAY
192.168.0                       RELAY

That allows mail from the localhost variants as well as from any machine in the 192.168.0.0/24 network relay access through the server.

Avatar of alanbkalanbk

ASKER

Thanks for being so persistant.

Ive made the changes to the /etc/hosts.

Here is the new /etc/hosts:
[root@WebServer mail]# cat /etc/hosts
# Do not remove the following line, or various programs
# that require network functionality will fail.
127.0.0.1       localhost.localdomain localhost
192.168.0.5     WebServer.abkprod.dynip.com WebServer www mail
[root@WebServer mail]#


Same result it hangs and times out:
[root@WebServer mail]# mail -v alanbk@yahoo.com
Subject: TEST
TEST
.
Cc:
alanbk@yahoo.com... Connecting to localhost.abkprod.dynip.com. via relay...


Any other ideas?  Want to telnet in?  I really appreciate your help.


Reward 1Reward 2Reward 3Reward 4Reward 5Reward 6

EARN REWARDS FOR ASKING, ANSWERING, AND MORE.

Earn free swag for participating on the platform.


Avatar of alanbkalanbk

ASKER

I did stop and restart sendmail after modifing the file

Avatar of alanbkalanbk

ASKER

I did stop and restart sendmail after modifing the file

If you'd like I'd be happy to ssh in and look at the config. With those changes in place it should be working at this point, but perhaps it is a "can't see the forrest for the trees problem".

To be able to look at the relevant bit's & pieces I'd need root privs and that is best done via sudo. Email me at jim@entrophy-free.net and we'll exchange details.

Free T-shirt

Get a FREE t-shirt when you ask your first question.

We believe in human intelligence. Our moderation policy strictly prohibits the use of LLM content in our Q&A threads.


i just wanna cover all your bases here
everytime you make changes to /etc/mail/aliases
you run the "make" command to have sendmail refresh its files

everytime you make changes to your sendmail.mc you run the
"m4 /etc/mail/sendmail.mc > /etc/mail/sendmail.cf" to refresh its macros

~drew

correct me if i am wrong but dont you need at least one of the DAEMON_OPTIONS uncommented

if you just want localhost mail then do the
DAEMON_OPTIONS(`Port=smtp,Addr=127.0.0.1, Name=MTA')

correct me if i am wrong but dont you need at least one of the DAEMON_OPTIONS uncommented

if you just want localhost mail then do the
DAEMON_OPTIONS(`Port=smtp,Addr=127.0.0.1, Name=MTA')

Reward 1Reward 2Reward 3Reward 4Reward 5Reward 6

EARN REWARDS FOR ASKING, ANSWERING, AND MORE.

Earn free swag for participating on the platform.


If not overridden in the sendmail.cf file by a DAEMON_OPTIONS directive the MTA will listen on the SMTP port on all interfaces. The directive referenced above restricts the MTA to only the SMTP port on the localhost IP. That's not what you want for a system that is intended to be a full mailserver.

i think i'm seeing things! i thought alanbk wanted to restrict to localhost only

alanbk:
This old question needs to be finalized -- accept an answer, split points, or get a refund.  For information on your options, please click here-> http:/help/closing.jsp#1 
EXPERTS:
Post your closing recommendations!  No comment means you don't care.

Free T-shirt

Get a FREE t-shirt when you ask your first question.

We believe in human intelligence. Our moderation policy strictly prohibits the use of LLM content in our Q&A threads.


No comment has been added lately, so it's time to clean up this TA.
I will leave a recommendation in the Cleanup topic area that this question is to:

Be PAQ'd/Points No Refunded

Please leave any comments here within the next seven days.

PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!

Paul
EE Cleanup Volunteer

ASKER CERTIFIED SOLUTION
Avatar of YensidModYensidMod

Link to home
membership
Log in or create a free account to see answer.
Signing up is free and takes 30 seconds. No credit card required.
Create Account
Linux

Linux

--

Questions

--

Followers

Top Experts

Linux is a UNIX-like open source operating system with hundreds of distinct distributions, including: Fedora, openSUSE, Ubuntu, Debian, Slackware, Gentoo, CentOS, and Arch Linux. Linux is generally associated with web and database servers, but has become popular in many niche industries and applications.