allow socket number on [IPC] connections -- eventually this
authorEric Allman <eric@ucbvax.Berkeley.EDU>
Fri, 7 May 1982 11:21:23 +0000 (03:21 -0800)
committerEric Allman <eric@ucbvax.Berkeley.EDU>
Fri, 7 May 1982 11:21:23 +0000 (03:21 -0800)
could be used to handle other low-level protocols.

SCCS-vsn: usr.sbin/sendmail/src/deliver.c 3.76
SCCS-vsn: usr.sbin/sendmail/src/version.c 3.101
SCCS-vsn: usr.sbin/sendmail/src/daemon.c 3.11

usr/src/usr.sbin/sendmail/src/daemon.c
usr/src/usr.sbin/sendmail/src/deliver.c
usr/src/usr.sbin/sendmail/src/version.c

index c09a04f..ab6a42b 100644 (file)
@@ -3,13 +3,13 @@
 # include <sys/mx.h>
 
 #ifndef DAEMON
 # include <sys/mx.h>
 
 #ifndef DAEMON
-SCCSID(@(#)daemon.c    3.10            %G%     (w/o daemon mode));
+SCCSID(@(#)daemon.c    3.11            %G%     (w/o daemon mode));
 #else
 
 # include <sys/socket.h>
 # include <net/in.h>
 
 #else
 
 # include <sys/socket.h>
 # include <net/in.h>
 
-SCCSID(@(#)daemon.c    3.10            %G%     (with daemon mode));
+SCCSID(@(#)daemon.c    3.11            %G%     (with daemon mode));
 
 /*
 **  DAEMON.C -- routines to use when running as a daemon.
 
 /*
 **  DAEMON.C -- routines to use when running as a daemon.
@@ -67,6 +67,7 @@ getconnection()
        */
 
        SendmailAddress.sin_addr.s_addr = 0;
        */
 
        SendmailAddress.sin_addr.s_addr = 0;
+       SendmailAddress.sin_port = IPPORT_SMTP;
 
        /*
        **  Try to actually open the connection.
 
        /*
        **  Try to actually open the connection.
@@ -92,6 +93,7 @@ getconnection()
 **
 **     Parameters:
 **             host -- the name of the host.
 **
 **     Parameters:
 **             host -- the name of the host.
+**             port -- the port number to connect to.
 **             outfile -- a pointer to a place to put the outfile
 **                     descriptor.
 **             infile -- ditto for infile.
 **             outfile -- a pointer to a place to put the outfile
 **                     descriptor.
 **             infile -- ditto for infile.
@@ -104,8 +106,9 @@ getconnection()
 **             none.
 */
 
 **             none.
 */
 
-makeconnection(host, outfile, infile)
+makeconnection(host, port, outfile, infile)
        char *host;
        char *host;
+       int port;
        FILE **outfile;
        FILE **infile;
 {
        FILE **outfile;
        FILE **infile;
 {
@@ -117,6 +120,9 @@ makeconnection(host, outfile, infile)
 
        if ((SendmailAddress.sin_addr.s_addr = rhost(&host)) == -1)
                return (EX_NOHOST);
 
        if ((SendmailAddress.sin_addr.s_addr = rhost(&host)) == -1)
                return (EX_NOHOST);
+       if (port == 0)
+               port = IPPORT_SMTP;
+       SendmailAddress.sin_port = port;
 
        /*
        **  Try to actually open the connection.
 
        /*
        **  Try to actually open the connection.
index 26aeb13..00acb5a 100644 (file)
@@ -6,7 +6,7 @@
 # include <syslog.h>
 # endif LOG
 
 # include <syslog.h>
 # endif LOG
 
-SCCSID(@(#)deliver.c   3.75            %G%);
+SCCSID(@(#)deliver.c   3.76            %G%);
 
 /*
 **  DELIVER -- Deliver a message to a list of addresses.
 
 /*
 **  DELIVER -- Deliver a message to a list of addresses.
@@ -647,7 +647,11 @@ openmailer(m, pvp, ctladdr, clever, pmfile, prfile)
 
                if (!clever)
                        syserr("non-clever IPC");
 
                if (!clever)
                        syserr("non-clever IPC");
-               i = makeconnection(pvp[1], pmfile, prfile);
+               if (pvp[2] != NULL)
+                       i = atoi(pvp[2]);
+               else
+                       i = 0;
+               i = makeconnection(pvp[1], i, pmfile, prfile);
                if (i != EX_OK)
                {
                        ExitStat = i;
                if (i != EX_OK)
                {
                        ExitStat = i;
index 9a2d2a5..0568f6d 100644 (file)
@@ -1,5 +1,5 @@
 # ifndef lint
 # ifndef lint
-static char    SccsId[] = "@(#)SendMail version 3.100 of %G%";
+static char    SccsId[] = "@(#)SendMail version 3.101 of %G%";
 # endif lint
 
 # endif lint
 
-char   Version[] = "3.100 [%G%]";
+char   Version[] = "3.101 [%G%]";