summaryrefslogtreecommitdiffstats
path: root/contrib/sendmail/rmail
diff options
context:
space:
mode:
authorgshapiro <gshapiro@FreeBSD.org>2000-10-01 01:49:02 +0000
committergshapiro <gshapiro@FreeBSD.org>2000-10-01 01:49:02 +0000
commitf84ac9120cb7d9f087e5dcb863c4bf25ba2985e6 (patch)
tree1965ed8ab83d1520308eb01c0471d69de74d7653 /contrib/sendmail/rmail
parent4332139a9a11f773ffe5109bed871561e3c290a1 (diff)
downloadFreeBSD-src-f84ac9120cb7d9f087e5dcb863c4bf25ba2985e6.zip
FreeBSD-src-f84ac9120cb7d9f087e5dcb863c4bf25ba2985e6.tar.gz
Import of sendmail version 8.11.1 into vendor branch SENDMAIL with
release tag v8_11_1. Obtained from: ftp://ftp.sendmail.org/pub/sendmail/
Diffstat (limited to 'contrib/sendmail/rmail')
-rw-r--r--contrib/sendmail/rmail/Makefile.m43
-rw-r--r--contrib/sendmail/rmail/rmail.c24
2 files changed, 20 insertions, 7 deletions
diff --git a/contrib/sendmail/rmail/Makefile.m4 b/contrib/sendmail/rmail/Makefile.m4
index 0c42c6b..deed449 100644
--- a/contrib/sendmail/rmail/Makefile.m4
+++ b/contrib/sendmail/rmail/Makefile.m4
@@ -1,6 +1,9 @@
include(confBUILDTOOLSDIR`/M4/switch.m4')
+# sendmail dir
+SMSRCDIR= ifdef(`confSMSRCDIR', `confSMSRCDIR', `${SRCDIR}/sendmail')
PREPENDDEF(`confENVDEF', `confMAPDEF')
+PREPENDDEF(`confINCDIRS', `-I${SMSRCDIR} ')
bldPRODUCT_START(`executable', `rmail')
define(`bldNO_INSTALL')
diff --git a/contrib/sendmail/rmail/rmail.c b/contrib/sendmail/rmail/rmail.c
index b04ea3f..74020a1 100644
--- a/contrib/sendmail/rmail/rmail.c
+++ b/contrib/sendmail/rmail/rmail.c
@@ -19,7 +19,7 @@ static char copyright[] =
#endif /* ! lint */
#ifndef lint
-static char id[] = "@(#)$Id: rmail.c,v 8.39.4.5 2000/07/18 05:55:29 gshapiro Exp $";
+static char id[] = "@(#)$Id: rmail.c,v 8.39.4.8 2000/09/16 22:20:25 gshapiro Exp $";
#endif /* ! lint */
/*
@@ -89,9 +89,9 @@ static char id[] = "@(#)$Id: rmail.c,v 8.39.4.5 2000/07/18 05:55:29 gshapiro Exp
# define STDIN_FILENO 0
#endif /* ! STDIN_FILENO */
-#if defined(BSD4_4) || defined(linux) || SOLARIS >= 20600 || (SOLARIS < 10000 && SOLARIS >= 206) || _AIX4 >= 40300
+#if defined(BSD4_4) || defined(linux) || SOLARIS >= 20600 || (SOLARIS < 10000 && SOLARIS >= 206) || _AIX4 >= 40300 || defined(HPUX11)
# define HASSNPRINTF 1
-#endif /* defined(BSD4_4) || defined(linux) || SOLARIS >= 20600 || (SOLARIS < 10000 && SOLARIS >= 206) || _AIX4 >= 40300 */
+#endif /* defined(BSD4_4) || defined(linux) || SOLARIS >= 20600 || (SOLARIS < 10000 && SOLARIS >= 206) || _AIX4 >= 40300 || defined(HPUX11) */
#if defined(sun) && !defined(BSD) && !defined(SOLARIS) && !defined(__svr4__) && !defined(__SVR4)
# define memmove(d, s, l) (bcopy((s), (d), (l)))
@@ -151,7 +151,7 @@ main(argc, argv)
FILE *fp;
char *addrp = NULL, *domain, *p, *t;
char *from_path, *from_sys, *from_user;
- char *args[100], buf[2048], lbuf[2048];
+ char **args, buf[2048], lbuf[2048];
struct stat sb;
extern char *optarg;
extern int optind;
@@ -310,8 +310,13 @@ main(argc, argv)
offset = (off_t)ftell(stdin);
}
+
+ /* Allocate args (with room for sendmail args as well as recipients */
+ args = (char **)xalloc(sizeof(*args) * (10 + argc));
+
i = 0;
args[i++] = _PATH_SENDMAIL; /* Build sendmail's argument list. */
+ args[i++] = "-G"; /* relay submission */
args[i++] = "-oee"; /* No errors, just status. */
args[i++] = "-odq"; /* Queue it, don't try to deliver. */
args[i++] = "-oi"; /* Ignore '.' on a line by itself. */
@@ -338,7 +343,7 @@ main(argc, argv)
** the address (helps to pass addrs like @gw1,@gw2:aa@bb)
*/
- while (*argv)
+ while (*argv != NULL)
{
if (**argv == '-')
err(EX_USAGE, "dash precedes argument: %s", *argv);
@@ -353,13 +358,18 @@ main(argc, argv)
snprintf(args[i++], len, "<%s>", *argv);
}
argv++;
+ argc--;
+
+ /* Paranoia check, argc used for args[] bound */
+ if (argc < 0)
+ err(EX_SOFTWARE, "Argument count mismatch");
}
- args[i] = 0;
+ args[i] = NULL;
if (debug)
{
fprintf(stderr, "Sendmail arguments:\n");
- for (i = 0; args[i]; i++)
+ for (i = 0; args[i] != NULL; i++)
fprintf(stderr, "\t%s\n", args[i]);
}
OpenPOWER on IntegriCloud