Operating System - HP-UX
1827294 Members
1666 Online
109717 Solutions
New Discussion

Re: sendmail message relay

 
martin wells_1
Advisor

sendmail message relay

Hi All

I have a HPUX server the relays messages from other NT and Unix servers and forwards them on to a mailhost. This seems to work for the NT servers I have set up but can't get it to work for the UNIX host. Message in the maillog on relay host is "DSN: Service unavailable"

When this happens I do get a message sent back to root giving some clues.
What I think: when I send a message from the NT server I get an entry in the maillog on the relays server that says
relay=servername.domain
when its sent from the Unix host I get
relay=root@servername.domain.

Looking in the mail that is sent to root it is saying unknown domain "servername.domain"

The Unix server sending the mail and the one relaying it are in the same domains.

Sorry if this does not make much sense!

Thanks for your help
9 REPLIES 9
Fred Ruffet
Honored Contributor

Re: sendmail message relay

You have to do a little setup on sendmail on the UNIX host you want to send mail from.
In sendmail.cf file (usually in /etc/mail), you will find lines begining with Dj, DM, DS. if domain is your domain name and servername your SMTP server, modify those lines this way :
Djdomain
DMdomain
DSservername

Restart sendmail, and try again.

Regards,

Fred
--

"Reality is just a point of view." (P. K. D.)
martin wells_1
Advisor

Re: sendmail message relay

Thanks Fred

On the server sending the mail I have set the following in sendmail.cf

Dj"domain"
DM"domain"
DS"relayserver"

I have restarted sendmail but now I cant get the mails to reach the relay server. I just get a message saying "external address" user unknown" which is correct as the mail address I'm sending to is an external one
Peter Godron
Honored Contributor

Re: sendmail message relay

Martin,
from your post I guess you are receiving messages from your client onto the server?
So the client is sending the message ok.

Have you set your server to include the domain names of the clients for relaying
(FR -o /etc/hosts on our system) in sendmail.cf? Also make sure the Fw label has your clients as being valid senders.
martin wells_1
Advisor

Re: sendmail message relay

Thats right, the client is sending the message and I can see in the maillog on the relay server that they are being received
We have FW set to the sendmail.cw file and this contains the server in the same way as the NT ones that I have got working.

I think its a problems with something thinks the domain is

"servername.domain" rather than just "domain"
eg server1.foo.com rather than just foo.com


To be honest I'm not sure if its the relay server that is sending that message or the mailhost that is the next link in the chain?


martin wells_1
Advisor

Re: sendmail message relay

This may make this thread more confusing?


This a copy of the mail that is being sent back to root when the

From MAILER-DAEMON Wed Jan 19 11:37:12 GMT 2005
Received: from localhost (localhost)
by relayserver.FOO.co.uk (8.8.6 (PHNE_17190)/8.8.6) with internal id LAA10
232;
Wed, 19 Jan 2005 11:37:12 GMT
Date: Wed, 19 Jan 2005 11:37:12 GMT
From: Mail Delivery Subsystem
Message-Id: <200501191137.LAA10232@relayserver.FOO.co.uk>
To:
MIME-Version: 1.0
Content-Type: multipart/report; report-type=delivery-status;
boundary="LAA10232.1106134632/relayserver.FOO.co.uk"
Subject: Returned mail: Service unavailable
Auto-Submitted: auto-generated (failure)

This is a MIME-encapsulated message

--LAA10232.1106134632/relayserver.FOO.co.uk

The original message was received at Wed, 19 Jan 2005 11:37:12 GMT
from root@sheldon.FOO.co.uk [31.7.145.41]

----- The following addresses had permanent fatal errors -----


----- Transcript of session follows -----
... while talking to mailhost.FOO.co.uk:
>>> MAIL From: SIZE=101
<<< 550 Unknown domain 'sheldon.FOO.co.uk'
554 ... Service unavailable

--LAA10232.1106134632/relayserver.FOO.co.uk
Content-Type: message/delivery-status

Reporting-MTA: dns; relayserver.FOO.co.uk
Received-From-MTA: DNS; sheldon.FOO.co.uk
Arrival-Date: Wed, 19 Jan 2005 11:37:12 GMT

Final-Recipient: RFC822; martin.wells@FOO.co.uk
Action: failed
Status: 5.0.0
Remote-MTA: DNS; mailhost.FOO.co.uk
Diagnostic-Code: SMTP; 550 Unknown domain 'sheldon.FOO.co.uk'
Last-Attempt-Date: Wed, 19 Jan 2005 11:37:12 GMT

--LAA10232.1106134632/relayserver.FOO.co.uk
Content-Type: message/rfc822

Return-Path:
Received: from sheldon.FOO.co.uk (root@sheldon.FOO.co.uk [31.7.145.41])
by relayserver.FOO.co.uk (8.8.6 (PHNE_17190)/8.8.6) with ESMTP id LAA10230
for ; Wed, 19 Jan 2005 11:37:12 GMT
Received: (from root@localhost)
by sheldon.FOO.co.uk (8.9.3 (PHNE_26305)/8.9.3) id LAA16062
for martin.wells@FOO.co.uk; Wed, 19 Jan 2005 11:41:07 GMT
Date: Wed, 19 Jan 2005 11:41:07 GMT
From: root@sheldon.FOO.co.uk
Message-Id: <200501191141.LAA16062@sheldon.FOO.co.uk>
To: martin.wells@FOO.co.uk
Subject: sdwd
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit

wdwd

--LAA10232.1106134632/relayserver.FOO.co.uk--


The domain is foo.co.uk no sheldon.co.uk

Fred Ruffet
Honored Contributor

Re: sendmail message relay

That's what DM is done for. Don't use " in your sendmail.cf directives. DMwhatever.com will masquerade so that your mails will appear like root@whatever.com. And whatever.com has to be resolved.

Regards,

Fred
--

"Reality is just a point of view." (P. K. D.)
Cesare Salvioni
Trusted Contributor

Re: sendmail message relay

Hi,
i don't understand exactly what is working and what is not in your configuration. So here is what i usually do to centralize mail server.

The mail server must accept must accept relaying from all client hosts (if the central mail server is HPUX this should be the default).

The HPUX client must:
1 resolve the hostname-ipaddress of mail server through dns (with fully qualified name: host.domain) and

2 have the macro DH (for local mails) and DS (for non local mails) configured to the mail server. These macros are configured in the file /etc/mail/sendmail.cf
DHmailsrv.mydomain
DSmailsrv.mydomain

3 optionally set in the same file even the macro DM to the central mail server to have the mails masqueraded as sent from the central mail server.

4 stop the process sendmail on the client and change SENDMAIL_SERVER to 0 in the file /etc/rc.config.d/mailservs to avoid it staring at boot

to test everything i suggest to open three terminals, two on the client and one on the server

tail -f /var/adm/syslog/mail.log on server and client

exec in the last terminal:
sendmail -v root
mail body
.


you should see in the last terminal the sendmail explaining what is doing, in the mail.log on client you should see the mail sent to the relay server, in the mail.log on server the mail received, accepted for relay and sent again. See attached file

If it's not working please send a file with attached these three output

You talk about a DSN service unavailbale: default for name resolving is to use DNS, if you don't use a DNS, try changing the rules in the file /etc/mail/service.switch leaving only files.

hope it helps
martin wells_1
Advisor

Re: sendmail message relay

Thanks, to try and clarify

What is working.
1. I can send mail locally on the mail client
2. I can forward mail to the relay server. the sendmail -v "mailaddress" Shows the client connecting and the relay server accepting the mail. This is seen in the mail log on the client.
3. On an NT client I can send a mail, its received on the relayserver and is sent out to the external address and the mail is received.

Whats not working
1. When the relay server receives a mail to send externally from the Unix mail client the mail.log shows the mail being received but i get a message DSN (Delivery Status Notification) Service unavailable. I also get a mail to roots account on the relay server (attached above)

What I need.
For local mail to be sent locally and all others sent to a relay server in the same domain. None of these servers use DNS and can resolve each other without problem.
martin wells_1
Advisor

Re: sendmail message relay

Thanks everyone for your help I know I didn't explain myself very well!

I have managed to get it to work. I think this has finally been done by setting the DM setting in the sendmail.cf file on the client to be the relay server.