delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2001/04/10/23:07:27

Mailing-List: contact cygwin-help AT sourceware DOT cygnus DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT sources DOT redhat DOT com>
List-Archive: <http://sources.redhat.com/ml/cygwin/>
List-Post: <mailto:cygwin AT sources DOT redhat DOT com>
List-Help: <mailto:cygwin-help AT sources DOT redhat DOT com>, <http://sources.redhat.com/ml/#faqs>
Sender: cygwin-owner AT sources DOT redhat DOT com
Delivered-To: mailing list cygwin AT sources DOT redhat DOT com
Date: Tue, 10 Apr 2001 18:53:27 -0700
From: Enoch Wu <enochw AT scn DOT org>
To: Corinna Vinschen <cygwin AT cygwin DOT com>
Subject: Patch portnumber for sSMTP
Message-ID: <20010410185327.A4021635@MELON>
Reply-To: Enoch Wu <enochw AT scn DOT org>
Mail-Followup-To: Enoch Wu <enochw AT scn DOT org>,
Corinna Vinschen <cygwin AT cygwin DOT com>
Mime-Version: 1.0
User-Agent: Mutt/1.2.5i
X-Mailer: Mutt 1.2.5i <http://www.mutt.org>
X-Operating-System: CYGWIN_98-4.10 1.1.8(0.34/3/2) i586<http://www.cygwin.com>
X-Sender: ewu AT eskimo DOT com

Hi Corinna & all,

I am "uploading" the patch to add something like:

MailHub=mail.domain.com:2525 

in /etc/ssmtp/ssmtp.conf

root:id AT domain DOT com:mail.domain.com:2525

in /etc/ssmtp/revaliases

------cut here ----------------------------------

diff -p -N -d -r -u2 orig/ssmtp-2.38.7/generate_config cygp/ssmtp-2.38.7/generate_config
--- orig/ssmtp-2.38.7/generate_config	Wed Mar  7 06:38:10 2001
+++ cygp/ssmtp-2.38.7/generate_config	Mon Apr  9 21:30:00 2001
@@ -32,4 +32,14 @@ echo -n "Please enter the full qualified
 read mailhub
 
+portnumber=25
+echo -n "Please enter the smtp port number [$portnumber]: "
+read smtpport
+if [ ! "$smtpport" ]; then
+  mailhub=$mailhub
+else
+  mailhub="$mailhub:$smtpport"
+fi
+
+
 #
 # Generate configuration file
diff -p -N -d -r -u2 orig/ssmtp-2.38.7/revaliases cygp/ssmtp-2.38.7/revaliases
--- orig/ssmtp-2.38.7/revaliases	Thu Feb 24 06:26:26 2000
+++ cygp/ssmtp-2.38.7/revaliases	Mon Apr  9 21:30:00 2001
@@ -3,3 +3,4 @@
 # Format:	local_account:outgoing_address:mailhub
 #
-# Example: root:your_login AT your DOT domain:mailhub.your.domain
+# Example: root:your_login AT your DOT domain:mailhub.your.domain:[port]
+# where [port] is an optional port number that defaults to 25.
diff -p -N -d -r -u2 orig/ssmtp-2.38.7/ssmtp.c cygp/ssmtp-2.38.7/ssmtp.c
--- orig/ssmtp-2.38.7/ssmtp.c	Tue Aug 29 04:07:26 2000
+++ cygp/ssmtp-2.38.7/ssmtp.c	Mon Apr  9 21:30:00 2001
@@ -48,4 +48,5 @@ char *Version = VERSION;	/* The version 
 char *ProgName = NULL;		/* It's name. */
 char *MailHub = MAILHUB;	/* The place to send the mail. */
+int PortNum = PORTNUMBER;       /* The sysadmin assigned smtp port number. */
 char HostName[MAXLINE];		/* Our name, unless overridden. */
 #ifdef REWRITE_DOMAIN
@@ -723,5 +724,5 @@ void 
 parseConfig (FILE * fp)
 {
-  char line[MAXLINE], *p, *q;
+  char line[MAXLINE], *p, *q, *r;
 
   while (fgets (line, sizeof line, fp))
@@ -737,5 +738,5 @@ parseConfig (FILE * fp)
       /* Parse out keywords. */
       if (((p = strtok (line, "= \t\n")) != NULL)
-	  && ((q = strtok (NULL, "= \t\n")) != NULL))
+	  && ((q = strtok (NULL, "= \t\n:")) != NULL))
 	{
 	  if (strcasecmp (p, "Root") == 0)
@@ -751,8 +752,12 @@ parseConfig (FILE * fp)
 	    {
 	      MailHub = strdup (q);
+              if ((r = strtok (NULL, "= \t\n:")) != NULL) PortNum = atoi(strdup(r));
 	      if (LogLevel > 0)
 		{
 		  log_event (LOG_INFO,
 			     "Set MailHub=\"%s\".\n", MailHub);
+		  log_event (LOG_INFO,
+			     "via SMTP Port Number=\"%s\".\n", PortNum);
+                  
 		}
 	    }
@@ -839,5 +844,5 @@ getReverseAliases ()
   FILE *rev_file;
   static char buffer[MAXLINE];
-  char line[MAXLINE], *p;
+  char line[MAXLINE], *p, *r;
   /* Try to open the reverse aliases file */
   rev_file = fopen (REVALIASES_FILE, "r");
@@ -868,12 +873,15 @@ getReverseAliases ()
 		  fromLine = strdup (buffer);
 		}
-	      p = strtok (NULL, " \t\r\n");
+	      p = strtok (NULL, " \t\r\n:");
 	      if (p)
 	        {
 	          MailHub = strdup (p);
+		  if ((r = strtok (NULL, " \t\r\n:")) != NULL) PortNum = atoi(strdup(r));
 	          if (LogLevel > 0)
 		    {
 		      log_event (LOG_INFO,
 			         "Set MailHub=\"%s\".\n", MailHub);
+		      log_event (LOG_INFO,
+			         "via SMTP Port Number=\"%s\".\n", PortNum);
 		    }
 	        }
@@ -1174,8 +1182,8 @@ ssmtp (char *argv[])
       die ("connection lost in middle of processing, exiting.");
     }
-  if ((fd = openSocket (MailHub, PORTNUMBER)) == ERR)
+  if ((fd = openSocket (MailHub, PortNum)) == ERR)
     {
       die ("can't open the smtp port (%d) on %s.",
-	   PORTNUMBER, MailHub);
+	   PortNum, MailHub);
     }
   else if (getOkFromSmtp (fd, buffer) == NO)
diff -p -N -d -r -u2 orig/ssmtp-2.38.7/ssmtp.conf cygp/ssmtp-2.38.7/ssmtp.conf
--- orig/ssmtp-2.38.7/ssmtp.conf	Thu Feb 24 06:26:26 2000
+++ cygp/ssmtp-2.38.7/ssmtp.conf	Mon Apr  9 21:30:00 2001
@@ -11,4 +11,10 @@ root=postmaster
 mailhub=mail
 
+# Example for SMTP port number 2525
+# MailHub=mail.your.domain:2525
+
+# Example for SMTP port number 25 (RFC)
+# MailHub=mail.your.domain        
+
 # Where will the mail seem to come from?
 rewriteDomain=

----cut here ---- end of patch ----

--
Want to unsubscribe from this list?
Check out: http://cygwin.com/ml/#unsubscribe-simple

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019