Operating System - HP-UX
1848395 Members
3058 Online
104026 Solutions
New Discussion

How to suppress hostname in "telnet <IP> 25"?

 
SOLVED
Go to solution
Hai Nguyen_1
Honored Contributor

How to suppress hostname in "telnet <IP> 25"?

Folks,

I would like to know how to configure sendmail to suppress hostname in the situation below. The command is run in Windows env.

C:\ telnet hp-uxServerIP 25
220 ESMTP
221 hostname.domain closing connection


Connection to host lost.
C:\

How can you suppress "221 hostname.domain closing connection"? Thanks.

Hai
10 REPLIES 10
Sridhar Bhaskarla
Honored Contributor

Re: How to suppress hostname in "telnet <IP> 25"?

Hi,

Edit /etc/mail/sendmail.cf file and search for "Greeting". Make the line to appear like

O SmtpGreetingMessage=""

-Sri
You may be disappointed if you fail, but you are doomed if you don't try
Steven E. Protter
Exalted Contributor

Re: How to suppress hostname in "telnet <IP> 25"?

This is probably a sendmail server side configuration issue.

You can quick fix it by changing the Dj parameter in sendmail.cf on the server.

It picks up the hostname if its not set.

You can set it but be careful.

the Dj parameter when set is picked up on outbound mail. If its not fully qualified and can not be resolved aol and other major mail systems will reject the mail.

After making the change:

/sbin/init.d/sendmail stop
/sbin/init.d/sendmail start

Done.

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
Sridhar Bhaskarla
Honored Contributor

Re: How to suppress hostname in "telnet <IP> 25"?

Hi (again),

Hmmm.. you asked for "closing connection". I don't think you can do it because I believe it isn't really coming from the server side but it's the IP that is getting resolved at the localhost.

-Sri
You may be disappointed if you fail, but you are doomed if you don't try
Steven E. Protter
Exalted Contributor

Re: How to suppress hostname in "telnet <IP> 25"?

I think you need to check both Sri's suggestion and mine.

It will default to hostname under certain circumstances.

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
Hai Nguyen_1
Honored Contributor

Re: How to suppress hostname in "telnet <IP> 25"?

Sri,

Thanks for your quick reply. I already have the greeting configured your way which suppresses the hostname info in the initial connection. My question applies to the "closing connection".

Hai
Hai Nguyen_1
Honored Contributor

Re: How to suppress hostname in "telnet <IP> 25"?

Sri,

I know for sure the hostname.domain was not resolved at the localhost (client site).

Steve,

Dj is not being used in my sendmail.cf. And I do not need to use it.

All,
Let me try to rephrase my question:

All I need is to suppress hostname.domain in the "221..." line if possible. Thanks again for all your help.

Hai
Steven E. Protter
Exalted Contributor
Solution

Re: How to suppress hostname in "telnet <IP> 25"?

I have considerable experience with sendmail. If you take Sri's advice(which is good) yo may find the message defaults to the lostname of the system.

The Dj directive lets you overwrite it.

As far as the 221 message goes, thats how sendmail was written. You can take it change the source and recompile it, or use another MTA to change the behavior.

sendmail tells people when it disconnects them. I don't know how to surpress that behavior.

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
Paula J Frazer-Campbell
Honored Contributor

Re: How to suppress hostname in "telnet <IP> 25"?

Hi

I am not sure but does vrfy off stop this happening or is it just username.



Paula
If you can spell SysAdmin then you is one - anon
Hai Nguyen_1
Honored Contributor

Re: How to suppress hostname in "telnet <IP> 25"?

Paula,

goaway,noexpn,novrfy have been applied. It is hostname.domain which I like to suppress, not username? By the way, I think Steve is right. There is no way to suppress hostname.domain in "221 hostname.domain closing connection" unless I try another MTA or compile the source code myself. I saw this string "221 %s closing connection" in HP-compiled sendmail.

I close this thread here. Thank you all for your help.

Hai
Sridhar Bhaskarla
Honored Contributor

Re: How to suppress hostname in "telnet <IP> 25"?

Hi,

You are right. It does come from the server side. I just ran a tusc on the telnet


socket(AF_INET, SOCK_STREAM, 0) ............................ = 3

send(3, "q u i t \r\n", 6, 0) .............................. = 6
select(2048, 0x40005860, 0x40005760, 0x40005660, 0x40004b48) = 1
recv(3, "2 2 1 hostname.domain ".., 1024, 0) ..... = 48


As indicated by Steven, you can suppress it by manipulating "Dj" macro. But that may open up other problems as you are overwriting the servers' domain.

-Sri

You may be disappointed if you fail, but you are doomed if you don't try