Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Sendmail configuration 4

Status
Not open for further replies.

nandak7

Technical User
Sep 24, 2001
52
US
Hi ALL,

I am new to Linux.I am trying to configure sendmail in redhat linux 9.0. Almost I am done with configuration. But when I tested I was not able to send and receive emails. Linux server is behind ISA firewall. I couldnt find any easy doumentation in web.The documentation in sendmail.org is more confusing.

How can I test sendmail server?. Can anyone send urls for good documentaion?. I published sendmail with ISA firewall. Also I created MX record in local DNS server. I did all basic changes in sendmail configuration. Still no luck.I going crazy with sendmail configuration. Can any one help me out to figure out the problem.

Thanks
Nanda

 
look for the line in the sendmail.mc file that is forcing sendmail to listen on local host (127.0.0.1) and put dnl in front of it. The recompile sendmail using the m4 preprocessor.

There is no God, only 10001010
 
Hi Rhinokiller,

Thanks for your reply.I checked sendmail.mc file, but it has dnl infront of 127.0.0.1

So where I am doing wrong? Any idea

Thanks In Advance

Nanda



 
Check your access file and make sure that you have the following in there
localhost RELAY
127.0.0.1 RELAY
also you'll the dotted decimal of your network in here (the network where the mail is comming from prob. your DMZ) followed by RELAY
N.B. you'll need to hash this file after you edit it
makemap hash /etc/mail/access.db < /etc/mail/access

Check your relay-domains file and make sure your domain is listed.

Check your local-host-names file and make sure your domain is listed there, for example
yourdomain.com
mail.yourdomain.com

(This only applies if FEATURE(use_cw_file)is in you sendmail.mc)

You'll need to restart sendmail but personally I just reboot the box after I've changed the local-hosthost-names (just speaking from experience).

There is no God, only 10001010
 


Hi Rhinokiller,
Thanks for your immediate reply.

Content of my access file is

localhost.localdomain relay
localhost relay
127.0.0.1 relay
mydomainname.com ok
192.168.25.1/254 ok

Please let me know this is right?

Also I do not have a file called relay-domains.

Content of /etc/hosts is
127.0.0.1 mail localhost.localdomain localhost
192.168.25.55 mail.mydomainname.com mail

Contents of /etc/sysconfig/network is
NETWORKING=yes
HOSTNAME=mail
GATEWAY=192.168.25.101
Please let me know if you need further information.
Thanks in Advance
Nanda
 
Change the access file to
mydomainname.com RELAY
192.168.25.1 RELAY
**the dotted address should be the address of the &quot;source&quot; of your email, e.g. if the mail server is in a dmz, you wuld use the address of the dmz nic(in our example above the dmz nic's address=192.168.25.1**
**don't forget to hash this - see above**

Create a relay-domains file in /etc/mail
(use touch relay-domains)
include all your domains here and the mailserver host name.

Your hosts file looks good, but you need to make sure your local-host-names file is written properly.
yourdomain.com
mail.yourdomain.com

There is no God, only 10001010
 
Hi Rhinokiller,

I am working on that, I will get back to you soon.

Thanks
Nanda
 
Now I am able to send email. But I cannot receive emails.I tried to telnet mail.mydomain.com 110, But it says connection refused. So what could be the problem. How to find out POP3 is running?
Any help is appreciated.

Thanks
Nanda
 
This actually has nothing to do with sendmail. Sendmail and pop are both different things. Port 110 is the pop3 port so you should be certain you have a pop3 server that will fire up when inetd sees the connection. See the pop3 line in /etc/inetd.conf

Be sure that the ISA firewall solution you have (ipchains, iptables, or whatever) allows a connection on port 110.


There is no God, only 10001010
 
I did the following changes in,
/etc/xinetd.d/ipop3
edited the following line
log_on_sucess +=USERID
log_on_failure +=USERID
disable =no

and restarted pop3 daemon.

Now I can do telnet mail.mydomainname.com 110 . I can send email but I cannot receive.When I click send / Receive button in outlook express I am not getting any errors.But I dont know where my emails are going.I checked in home/myfolder, I couldnt see any messages.Also I checked in /var/mail/maillog,following are the logs
Aug 11 17:40:30 mail ipop3d [5096]:logout user=myname host=xyz.mydomainname.com [192.168.1.49] nmsgs=0 ndele=0.

Any help is appreciated
Thanks
Nanda

 
Which LDA (local delivery agent) R U using ?
I recommend procmail, (rpm -q procmail) to see if it's installed (define in your sendmail.mc) which by default will deliver mail to /var/spool/mail/username
as long as you have created a valid user or the user name is listed in the /etc/password file

Then send mail to that user from the outside world (yahoo or hotmail) and
tail -f /var/log/maillog
check the log and see what is going on.

I will double check this post tomorrow ... Monday night football ... GO EAGLES..... way too many Rolling Rocks.

There is no God, only 10001010
 
After thought ....
Have you set up your aliases file and created valid user accounts ?

There is no God, only 10001010
 
I think sendmail by default uses procmail.I searched for procmail in sendmail.mc file and I found a lot of procmail words. So I assume sendmail is using procmail by default.

I checked in /etc/password and I found valid username.

Following are the logs from tail -f /var/log/maillog

--------------------------
Aug 12 15:16:12 mail sendmail[5211]: h7BMBGpY004474: to=<nanda@4westtexas.com>, delay=22:04:56, xdelay=00:00:00, mailer=esmtp, pri=571766, relay=4westtexas.com., dsn=4.0.0, stat=Deferred: Connection reset by 4westtexas.com.
Aug 12 15:25:04 mail ipop3d[5217]: pop3 service init from 69.3.251.244
Aug 12 15:25:08 mail ipop3d[5217]: Command stream end of file while reading line user=mano host=h-69-3-251-244.sfldmidn.covad.net [69.3.251.244]
-------------------------
Still I am not able to receive emails and I dont know where the mails are going. I couldnt find any emails under users home folder. Is it neccessary to have aliases file ? . I didnt create any alaises file . Is it ok?

Thanks
Any help is appreciated
Nanda
 
Nandak7,
I also run sendmail, but am no expert. Rhinokiller's giving some excellent configuration tips & should get a star.

Now I show my ignorance:
In your first post -
&quot;Also I created MX record in local DNS server&quot;
Did you tell your domain registrar to point 'mail' to your IP? Also, when someone sends mail to you, what is the bounce message? I believe \var\spool\mail folder holds the users mail until it's popped by the client.

Anyway, hope you get this going. When you do, please post back your solution.
 
Here is how procmail is defined in your sendmail.mc
define(`PROCMAIL_MAILER_PATH',`/usr/bin/procmail')
FEATURE(local_procmail)
MAILER(procmail)

Now create an aliases file (there should already be one in either /etc or /etc/mail )
and include something like
#Lastname, Firstname
username: firstname.lastname

save the file and run the newaliases command

Now set up your mail client (outlook express, netscape eudora etc.) and set the logon name to the username you specified in the aliases file

## make sure you have added the new user properly ##
useradd -g users username
## create a passwd ##
passwd username

Post your maillog after this is done


There is no God, only 10001010
 
Good point rouse01 ... nandek7 what do you mean by &quot;created MX record in local DNS server &quot; ?

Is the following correct:
[david@alphawolf /root]# nslookup mail.4westtexas.com
Server: ns1.sprintlink.net
Address: 204.117.214.10

Name: mail.4westtexas.com
Address: 65.70.102.233



There is no God, only 10001010
 
Yes, I created mx record for sendmail server in our local dns server (windows 2000). In turn we have MX record mapped with our static ip at ISP. In fact I would like to give further information. I configured exchange server trial version and I was able to recive and send emails.My problem is my exchange trial period got over and my company wanted to move to open source.Thats why I am configuring sendmail.So I beleive there wont be any problem with mx record mapping.I have a local dns server in another box which has windows 2000 adv server + dns + domain +active directory enabled + acting as a firewall ( ISA ).
Today I am going to try the suggestions from rhinokiller. I will get back to forums soon.Thanks for the support.

Nanda
 
I included the aliases and also I created some new username and tested sendmail server using outlook client. But no luck. Still I couldnt receive emails. Following are logs from /var/log/maillog. I have a doubt whether I need to configure samba ?
-----------------------
Aug 13 15:19:12 mail ipop3d[4377]: Login user=test2 host=4westweb.4westtexas.com [192.168.25.49] nmsgs=0/0
Aug 13 15:19:12 mail ipop3d[4377]: Logout user=test2 host=4westweb.4westtexas.com [192.168.25.49] nmsgs=0 ndele=0
Aug 13 15:19:12 mail sendmail[4312]: h7DKIpBf004310: to=<test2@4westtexas.com>, delay=00:00:21, xdelay=00:00:21, mailer=esmtp, pri=30437, relay=4westtexas.com. [65.70.102.233], dsn=4.0.0, stat=Deferred: Connection reset by 4westtexas.com.
Aug 13 15:19:37 mail sendmail[4378]: h7DKJaBg004378: ruleset=check_rcpt, arg1=<angw@ms13.hinet.net>, relay=218-166-120-11.hinet-ip.hinet.net [218.166.120.11], reject=550 5.7.1 <angw@ms13.hinet.net>... Relaying denied
Aug 13 15:19:38 mail sendmail[4378]: h7DKJaBg004378: from=<nqr8i.5vy9c@hotmail.com>, size=0, class=0, nrcpts=0, proto=ESMTP, daemon=MTA, relay=218-166-120-11.hinet-ip.hinet.net [218.166.120.11]
--------------------------
Thanks
Nanda
 
OK, you are almost there, don't get discouraged.
At least pop is working properly.
Forget about Samba ... nothing to do with this.

1. Did you correctly configure your access file as instructed above
4westtexas.com RELAY
192.168.25.49 RELAY
localhost RELAY
127.0.0.1 RELAY
##don't forget to hash this file##

2. Have you set up DNS (resolv.conf)
search 4westtexas.com
nameserver xxx.xxx.xxx.xxx
nameserver xxx.xxx.xxx.xxx

3. R U required to authenticate to another SMTP gateway (maybe your ISP) ? or are you relaying mail for yourself ?

4. Post your sendmail.mc

5. I am leaving for the west coast tonight and will be offline until Friday.

There is no God, only 10001010
 
Finally I am ABLE to send and receive emails.

I had two issues.
1.My first issue was wrong entry in /etc/hosts file

My old entry was ...

127.0.0.1 mail localhost.localdomain localhost
192.168.25.155 mail.mydomainname.com mail

New entry is
127.0.0.1 localhost
192.168.25.155 mail.mydomainname.com mail

I found out this problem by debugging using
sendmail -d0

2. My second issue was /etc/mail/access file
My old entry was ...

localhost.localdomain RELAY
localhost RELAY
4westtexas.com RELAY

New entry is
localhost.localdomain RELAY
localhost RELAY
4westtexas.com RELAY

Ofcourse both have same content, but the problem is too much space between words.Better to have single tab always.

Thank you all for the help. My special Thanks goes to Rhinokiller.

I have some more issues:

I am not able send emails to domains like yahoo.com,hotmail.com.But I can receive emails from these domains.So what could be the problem.
Any help is appreciated

Nanda





 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top