Operating System - Linux
1757751 Members
2169 Online
108863 Solutions
New Discussion юеВ

Re: sendmail configuration issue

 
Yogeeraj_1
Honored Contributor

sendmail configuration issue

Dear Experts!

We just finished the installation of RHEL 4.5 our new server and we are currently having a problem configuring sendmail for delivery of emails to our MS Exchange server (VSW0706.mydom.mu).

On our HP-UX server (hpuxsrv.mydom.mu), it working fine. But on the Linux server (linsrv.mydom.mu) the mail is not being 'relayed' to the MS Exchange server.

Below the messages when running sendmail -v -d9.99 -d38.99 a

Linux Server: (linsrv.mydom.mu) - [NOT OK]
=============
[root@linsrv mail]# sendmail -v -d9.99 -d38.99 abcx@mydom.mu < /dev/null
getauthinfo: root@localhost
openmap() dequote:dequote NULL: valid
openmap() host:host NULL: valid
host_map_lookup(mydom.mu) => getcanonname(mydom.mu), trying dns
getcanonname(mydom.mu), found
FOUND mydom.mu
host_map_lookup(mydom.mu) => CACHE mydom.mu
abcx@mydom.mu... Connecting to [127.0.0.1] via relay...
220 linsrv.mydom.mu ESMTP Sendmail 8.13.1/8.13.1; Fri, 23 Nov 2007 16:18:31 +0400
>>> EHLO linsrv.mydom.mu
250-linsrv.mydom.mu Hello linsrv.mydom.mu [127.0.0.1], pleased to meet you
250-ENHANCEDSTATUSCODES
250-PIPELINING
250-8BITMIME
250-SIZE
250-DSN
250-ETRN
250-AUTH DIGEST-MD5 CRAM-MD5
250-DELIVERBY
250 HELP
>>> MAIL From: AUTH=root@linsrv.mydom.mu
250 2.1.0 ... Sender ok
>>> RCPT To:
>>> DATA
250 2.1.5 ... Recipient ok
354 Enter mail, end with "." on a line by itself
>>> .
250 2.0.0 lANCIVbC020559 Message accepted for delivery
abcx@mydom.mu... Sent (lANCIVbC020559 Message accepted for delivery)
Closing connection to [127.0.0.1]
>>> QUIT
221 2.0.0 linsrv.mydom.mu closing connection
closemaps: closing host (NULL)
closemaps: closing dequote (NULL)
[root@linsrv mail]#



HP-UX server: (hpuxsrv.cmt.mu) - [OK]
=============
hpuxsrv:>sendmail -v -d9.99 -d38.99 abcx@mydom.mu < /dev/null
seq_map_parse(aliases.files, )
getauthinfo: root@localhost
map_init(sequence:aliases.files, NULL, 0)
sequence:aliases.files NULL: valid
map_init(implicit:Alias0, /etc/mail/aliases, 0)
wrong pass (pass = 0, rebuildable = 1)
map_init(host:host, NULL, 0)
host:host NULL: valid
map_init(switch:aliases, aliases, 0)
switch_map_open(aliases, aliases, 0)
switch_map_find => 1
files
map_stack[0] = sequence:aliases.files
switch:aliases aliases: valid
map_init(dequote:dequote, NULL, 0)
dequote:dequote NULL: valid
map_init(host:resolve, NULL, 0)
host:resolve NULL: valid
map_init(sequence:aliases.files, NULL, 1)
wrong pass (pass = 1, rebuildable = 0)
map_init(implicit:Alias0, /etc/mail/aliases, 1)
impl_map_open(Alias0, /etc/mail/aliases, 0)
hash_map_open(Alias0, /etc/mail/aliases, 0)
impl_map_lookup(Alias0, @)
db_map_lookup(Alias0, @)
implicit:Alias0 /etc/mail/aliases: valid
map_init(host:host, NULL, 1)
wrong pass (pass = 1, rebuildable = 0)
map_init(switch:aliases, aliases, 1)
wrong pass (pass = 1, rebuildable = 0)
map_init(dequote:dequote, NULL, 1)
wrong pass (pass = 1, rebuildable = 0)
map_init(host:resolve, NULL, 1)
wrong pass (pass = 1, rebuildable = 0)
host_map_lookup(mydom.mu) => getcanonname(mydom.mu), trying files
text_getcanonname(mydom.mu)
getcanonname(mydom.mu), found
mydom.mu
getcanonname(smtp.mydom.mu), trying files
text_getcanonname(smtp.mydom.mu)
getcanonname(smtp.mydom.mu), found
abcx@mydom.mu... Connecting to smtp.mydom.mu. via relay...
220 VSW0706.mydom.mu Microsoft ESMTP MAIL Service ready at Fri, 23 Nov 2007 16:22:39 +0400
>>> EHLO hpuxsrv.mydom.mu
250-VSW0706.mydom.mu Hello [192.168.160.11]
250-SIZE 10485760
250-PIPELINING
250-DSN
250-ENHANCEDSTATUSCODES
250-STARTTLS
250-X-ANONYMOUSTLS
250-AUTH
250-X-EXPS NTLM
250-8BITMIME
250-BINARYMIME
250-CHUNKING
250 XEXCH50
>>> MAIL From:
250 2.1.0 Sender OK
>>> RCPT To:
250 2.1.5 Recipient OK
>>> DATA
354 Start mail input; end with .
>>> .
250 2.6.0 <200711231226.QAA10854@hpuxsrv.mydom.mu> Queued mail for delivery
abcx@mydom.mu... Sent (2.6.0 <200711231226.QAA10854@hpuxsrv.mydom.mu> Queued mail for delivery)
Closing connection to smtp.mydom.mu.
>>> QUIT
221 2.0.0 Service closing transmission channel
closemaps: closing aliases.files (NULL)
closemaps: closing Alias0 (/etc/mail/aliases)
impl_map_close(Alias0, /etc/mail/aliases, 12a3)
db_map_close(Alias0, /etc/mail/aliases, 12a3)
closemaps: closing host (NULL)
closemaps: closing aliases (aliases)
closemaps: closing dequote (NULL)
closemaps: closing resolve (NULL)
hpuxsrv:>


what could be wrong in this configuration?

Thanking you in advance for your replies.

Kind regards
yogeeraj
No person was ever honoured for what he received. Honour has been the reward for what he gave (clavin coolidge)
13 REPLIES 13
Ivan Ferreira
Honored Contributor

Re: sendmail configuration issue

I don't know how did you set the smart host information.

In /etc/mail, edit sendmail.cf and configure:

define(`SMART_HOST',`exchange.server')dnl

Then run:

m4 sendmail.mc > sendmail.cf

Restart sendmail

The resulting sendmail.cf file should have a like:

# "Smart" relay host (may be null)
DSexchange.server


What do you get in /var/log/maillog?

What is the status of the message in mailq -v?

Can your exchange hostname be resolved?
Por que hacerlo dificil si es posible hacerlo facil? - Why do it the hard way, when you can do it the easy way?
Yogeeraj_1
Honored Contributor

Re: sendmail configuration issue

hi Ivan,

thank you for the reply.

In the sendmail.cf, we already have the changes made as you mentioned:
DSsmtp.mydom.mu

Below the answers to the other questions:

> Messages in /var/log/maillog
[On linsrv]
Nov 23 17:26:38 linsrv sendmail[20792]: lANDQcMM020790: to=, ctladdr= (0/0), delay=00:00:00, xdelay=00:00:00, mailer=esmtp, pri=120273, relay=cmt.mu. [192.168.199.12], dsn=4.0.0, stat=Deferred: Connection refused by mydom.mu.

[On hpuxsrv]
Nov 23 17:36:19 hpuxsrv sendmail[10947]: RAA10947: to=abcx@mydom.mu, ctladdr=root (0/3), delay=00:00:01, xdelay=00:00:01, mailer=relay, relay=smtp.mydom.mu. [192.168.199.16], stat=Sent (2.6.0 <200711231336.RAA10947@hpuxsrv.mydom.mu> Queued mail for delivery)



> mailq -v
[On linsrv]
[root@linsrv mail]# mailq -v
/var/spool/mqueue (3 requests)
-----Q-ID----- --Size-- -Priority- ---Q-Time--- --------Sender/Recipient--------
lANDQcMM020790 0 120273 Nov 23 17:26
(Deferred: Connection refused by mydom.mu.)

(Deferred: Connection refused by mydom.mu.)
lANDOJJN020774 0 120273 Nov 23 17:24
(Deferred: Connection refused by mydom.mu.)

(Deferred: Connection refused by mydom.mu.)
lANCIVbC020559 0 210273 Nov 23 16:18
(Deferred: Connection refused by mydom.mu.)

(Deferred: Connection refused by mydom.mu.)
Total requests: 3
[root@linsrv mail]#


[On hpuxsrv]
hpuxsrv:var/adm/syslog>mailq -v
Mail queue is empty
hpuxsrv:var/adm/syslog>




>Can Exchange hostname be resolved?

[On hpuxsrv]
hpuxsrv:var/adm/syslog>nslookup
Using /etc/hosts on: hpuxsrv.mydom.mu

> smtp.mydom.mu
Using /etc/hosts on: hpuxsrv.mydom.mu

looking up FILES
Name: smtp.cmt.mu
Address: 192.168.199.16
Aliases: smtp

>

[On linsrv]
[root@linsrv mail]# nslookup
> smtp.mydom.mu
Server: 192.168.199.11
Address: 192.168.199.11#53

Name: smtp.mydom.mu
Address: 192.168.199.16
>

please advise further.

kind regards
yogeeraj
No person was ever honoured for what he received. Honour has been the reward for what he gave (clavin coolidge)
Ivan Ferreira
Honored Contributor

Re: sendmail configuration issue

Considering this message:

stat=Deferred: Connection refused by mydom.mu.

It looks like your exhcange server is not allowing the relay for the Linux host.

You can do a manual try to check if you can send mail via the linux host:

telnet smtp.mydom.mu 25

mail from: somebody@yourdomain
rcp to: someonelse@domain
data

Just testing
.
quit

Ask the exchange administrator to check the logs.
Por que hacerlo dificil si es posible hacerlo facil? - Why do it the hard way, when you can do it the easy way?
skt_skt
Honored Contributor

Re: sendmail configuration issue

i had similar (not same) problem. Try out..
===
Problem solved

sendmail.cf file coming with RH7.2 only listens on loopback interface. u can see that in netstat -an

it looks like this

tcp 0 0 127.0.0.1:25 0.0.0.0:* LISTEN

I Commented following option and restarted the sendmail daemon.

O DaemonPortOptions=Port=smtp,Addr=127.0.0.1, Name=MTA


Then after restarting the daemon using netstat -an.
the output changed to

tcp 0 0 0.0.0.0:25 0.0.0.0:* LISTEN

My mail now works
====
Yogeeraj_1
Honored Contributor

Re: sendmail configuration issue

Hi,

thank you for your replies.

Santhosh Kumar:
===============
[root@linsrv ~]# netstat -an |grep "127.0.0.1:25"
[root@linsrv ~]# grep -i mta /etc/mail/linsrv.mc
dnl DAEMON_OPTIONS(`Port=smtp,Addr=127.0.0.1, Name=MTA')dnl
dnl DAEMON_OPTIONS(`Port=smtps, Name=TLSMTA, M=s')dnl
dnl DAEMON_OPTIONS(`port=smtp,Addr=::1, Name=MTA-v6, Family=inet6')dnl
dnl DAEMON_OPTIONS(`Name=MTA-v4, Family=inet, Name=MTA-v6, Family=inet6')
[root@linsrv ~]#

The configuration seems OK.


IVAN:
======
[root@linsrv log]# telnet smtp.mydom.mu 25
Trying 192.168.199.16...
Connected to smtp.mydom.mu (192.168.199.16).
Escape character is '^]'.
220 VSW0706.mydom.mu Microsoft ESMTP MAIL Service ready at Sat, 24 Nov 2007 12:23:29 +0400
helo
250 VSW0706.mydom.mu Hello [192.168.199.81]
mail from: abcx@mydom.mu
250 2.1.0 Sender OK
rcpt to: abcx@mydom.mu
250 2.1.5 Recipient OK
data
354 Start mail input; end with .
just testing smtp from sdlx2
.
250 2.6.0 Queued mail for delivery
quit
221 2.0.0 Service closing transmission channel
Connection closed by foreign host.
[root@linsrv log]#

NB. No message is logged in the /var/log/maillog

When trying the equivalent using MUTT, we get the following message:
Error sending message, child exited 67 (User unknown.).

And the /var/log/maillog has the following entry:

Nov 24 12:29:44 linsrv sendmail[25182]: lAO8ThRE025182: from=root, size=299, class=0, nrcpts=1, msgid=<20071124082942.GA25176@linsrv.mydom.mu>, relay=root@localhost
Nov 24 12:29:45 linsrv sendmail[25183]: lAO8Tjtu025183: ... User unknown
Nov 24 12:29:45 linsrv sendmail[25182]: lAO8ThRE025182: to=abcx@mydom.mu, ctladdr=root (0/0), delay=00:00:02, xdelay=00:00:00, mailer=relay, pri=30299, relay=[127.0.0.1] [127.0.0.1], dsn=5.1.1, stat=User unknown
Nov 24 12:29:45 linsrv sendmail[25183]: lAO8Tjtu025183: from=, size=299, class=0, nrcpts=0, proto=ESMTP, daemon=MTA, relay=linsrv.mydom.mu [127.0.0.1]
Nov 24 12:29:45 linsrv sendmail[25182]: lAO8ThRE025182: lAO8ThRF025182: DSN: User unknown
Nov 24 12:29:47 linsrv sendmail[25183]: lAO8Tjtw025183: from=<>, size=2064, class=0, nrcpts=1, msgid=<200711240829.lAO8ThRF025182@linsrv.mydom.mu>, proto=ESMTP, daemon=MTA, relay=linsrv.mydom.mu [127.0.0.1]
Nov 24 12:29:47 linsrv sendmail[25182]: lAO8ThRF025182: to=root, delay=00:00:02, xdelay=00:00:01, mailer=relay, pri=31323, relay=[127.0.0.1] [127.0.0.1], dsn=2.0.0, stat=Sent (lAO8Tjtw025183 Message accepted for delivery)
Nov 24 12:29:48 linsrv sendmail[25184]: lAO8Tjtw025183: to=, delay=00:00:02, xdelay=00:00:01, mailer=local, pri=32250, dsn=2.0.0, stat=Sent


I still need to verify the MS Exchange server log.

kind regards
yogeeraj
No person was ever honoured for what he received. Honour has been the reward for what he gave (clavin coolidge)
Jeeshan
Honored Contributor

Re: sendmail configuration issue

Dear Yogeeraj

Do you allow the Linux host in MS exchange server?
If so then check your resolve.conf files and /etc/hosts file

then check sendmail.cf files the following entries
DS entry
Dj$ entry

if all ok then stop sendmail and start then try the following command
echo test | sendmail -v
a warrior never quits
Ivan Ferreira
Honored Contributor

Re: sendmail configuration issue

Mmmmmm, this message:

stat=Deferred: Connection refused by mydom.mu.

Means that you have a problem connecting with the relay for mydom.mu

This message in your direct SMTP test:

250 2.6.0 Queued mail for delivery
quit
221 2.0.0 Service closing transmission channel
Connection closed by foreign host.


Means that you was able to send a mail using SMTP commands, the test message should arrive to the user.

And this message:

Nov 24 12:29:45 linsrv sendmail[25183]: lAO8Tjtu025183: ... User unknown

Makes me think that maybe the linsrv thinks that he is the MTA for mydom.mu and the user is not local.

What do you have in /etc/mail/local-host-names? You should not have listed mydom.mu or the server will think that messages send to that domain destination must be sent locally.

Also, you may try changing your DS (smart host) from FQDN to IP, like this:

DS[192.168.0.1]

The [] will tell sendmail to ignore DNS for the connection to that host.
Por que hacerlo dificil si es posible hacerlo facil? - Why do it the hard way, when you can do it the easy way?
Alpha977
Valued Contributor

Re: sendmail configuration issue

Hello Yogeeraj!

I has the same problem when i try to configure Bugzilla mail.

Ms Exchange usually don't permit relay.
But you can set a stack of IPs who have relay permission.

System-Manager -> Administrative Group -> Server -> yourservername -> Protocols -> SMTP -> Default SMTP Virtual Server -> Properties -> Access -> Relay


Check if the Linux Server's IP is configured on Exchange Server for permit relay.

I hope this help you.

Regards
Steven E. Protter
Exalted Contributor

Re: sendmail configuration issue



Shalom,

250 2.0.0 lANCIVbC020559 Message accepted for delivery
abcx@mydom.mu... Sent (lANCIVbC020559 Message accepted for deliver

As you already know this means that the mail was accepted to the local mail queue and a delivery attempt will occur later and be logged in /var/log/maillog

I know you say the exchange server has authorized this host but all data presented so far seems to indicate the exchange host is rejecting all connections from this system.

Very sorry for not getting to this sooner.

SEP
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