Subject: SMTP port override

From: sujith <[email-masked]>
Date: Fri, 11 Feb 2005 12:01:42 +0530

Hi,

I am trying to connect to an smtp server running on port 587.
On the said server, SMTP auth is required.
But when I call smtp_open_full() with 587 as port, it defaults to port 25 when 
I look at the results obtained from tcpdump.
I tried setting 'smtp_port' using smtp_parameters(), to get the same result. 
Delving through the code, I finally realized that getservbyname() was being 
called in tcp_open() which was defaulting to 25.

My question is, since I pass a port explicitly, shouldn't it override the 
default port obtained from /etc/services ? or am i missing something ?

regards,
Sujith

DISCLAIMER:
Information contained and transmitted by this E-MAIL is proprietary to 
Sify Limited and is intended for use only by the individual or entity to 
which it is addressed, and may contain information that is privileged, 
confidential or exempt from disclosure under applicable law. If this is a 
forwarded message, the content of this E-MAIL may not have been sent with 
the authority of the Company. If you are not the intended recipient, an 
agent of the intended recipient or a  person responsible for delivering the 
information to the named recipient,  you are notified that any use, 
distribution, transmission, printing, copying or dissemination of this 
information in any way or in any manner is strictly prohibited. If you have 
received this communication in error, please delete this mail & notify us 
immediately at [email-masked]
-- 
------------------------------------------------------------------
 For information about this mailing list, and its archives, see: 
 http://www.washington.edu/imap/c-client-list.html
------------------------------------------------------------------

---

From: Mark Crispin <[email-masked]>
Date: Thu, 10 Feb 2005 23:10:48 -0800 (PST)

On Fri, 11 Feb 2005, sujith wrote:
> I am trying to connect to an smtp server running on port 587. On the 
> said server, SMTP auth is required. But when I call smtp_open_full() 
> with 587 as port, it defaults to port 25 when

To set the port number, use ":587" after the host name in the list.

The port number argument only sets the default if "smtp" is not defined as 
a service.

-- Mark --

http://staff.washington.edu/mrc
Science does not emerge from voting, party politics, or public debate.
Si vis pacem, para bellum.