From c5ad21d92b05c8b7662a48bacd3d42503c3781c1 Mon Sep 17 00:00:00 2001 From: naddy Date: Mon, 13 Aug 2001 01:06:41 +0000 Subject: [PATCH] Import smtpclient 1.0.0. Submitted by Patroklos Argyroudis . This program is a minimal SMTP client that takes an email message body and passes it on to a SMTP server (default is the MTA on the local host). Since it is completely self-supporting, it is especially suitable for use in restricted environments. --- mail/smtpclient/Makefile | 21 ++++++++++++ mail/smtpclient/files/md5 | 3 ++ .../patches/patch-smtpclient_errno_c | 12 +++++++ .../patches/patch-smtpclient_main_c | 32 +++++++++++++++++++ mail/smtpclient/pkg/DESCR | 8 +++++ mail/smtpclient/pkg/PLIST | 3 ++ 6 files changed, 79 insertions(+) create mode 100644 mail/smtpclient/Makefile create mode 100644 mail/smtpclient/files/md5 create mode 100644 mail/smtpclient/patches/patch-smtpclient_errno_c create mode 100644 mail/smtpclient/patches/patch-smtpclient_main_c create mode 100644 mail/smtpclient/pkg/DESCR create mode 100644 mail/smtpclient/pkg/PLIST diff --git a/mail/smtpclient/Makefile b/mail/smtpclient/Makefile new file mode 100644 index 00000000000..7cbeda86414 --- /dev/null +++ b/mail/smtpclient/Makefile @@ -0,0 +1,21 @@ +# $OpenBSD: Makefile,v 1.1.1.1 2001/08/13 01:06:41 naddy Exp $ + +COMMENT= "simple SMTP client" + +DISTNAME= smtpclient-1.0.0 +CATEGORIES= mail +NEED_VERSION= 1.402 +HOMEPAGE= http://www.engelschall.com/sw/smtpclient/ + +MAINTAINER= Patroklos Argyroudis + +PERMIT_PACKAGE_CDROM= Yes +PERMIT_PACKAGE_FTP= Yes +PERMIT_DISTFILES_CDROM= Yes +PERMIT_DISTFILES_FTP= Yes + +MASTER_SITES= ${HOMEPAGE}distrib/ + +CONFIGURE_STYLE= gnu dest + +.include diff --git a/mail/smtpclient/files/md5 b/mail/smtpclient/files/md5 new file mode 100644 index 00000000000..53107b3bc36 --- /dev/null +++ b/mail/smtpclient/files/md5 @@ -0,0 +1,3 @@ +MD5 (smtpclient-1.0.0.tar.gz) = 8b5d9260572107bb901edf6aacbf3747 +RMD160 (smtpclient-1.0.0.tar.gz) = 8f85a3622cb201c798b9c30aa5538d89d2dd53f7 +SHA1 (smtpclient-1.0.0.tar.gz) = 491ef8eeb525641eb25c36b17a4230d9b63e7f94 diff --git a/mail/smtpclient/patches/patch-smtpclient_errno_c b/mail/smtpclient/patches/patch-smtpclient_errno_c new file mode 100644 index 00000000000..92986f1e1fa --- /dev/null +++ b/mail/smtpclient/patches/patch-smtpclient_errno_c @@ -0,0 +1,12 @@ +$OpenBSD: patch-smtpclient_errno_c,v 1.1.1.1 2001/08/13 01:06:41 naddy Exp $ +--- smtpclient_errno.c.orig Wed Aug 1 15:09:39 2001 ++++ smtpclient_errno.c Wed Aug 1 15:11:36 2001 +@@ -91,7 +91,7 @@ char *errorstr(int errnum) + #else + static char buffer[50]; + if (errnum < 0 || errnum >= sys_nerr) { +- sprintf(buffer, "ERR-UNKNOWN (%d)", errnum); ++ snprintf(buffer, (sizeof(buffer) - 1), "ERR-UNKNOWN (%d)", errnum); + return(buffer); + } + return(sys_errlist[errnum]); diff --git a/mail/smtpclient/patches/patch-smtpclient_main_c b/mail/smtpclient/patches/patch-smtpclient_main_c new file mode 100644 index 00000000000..ddbb97587d9 --- /dev/null +++ b/mail/smtpclient/patches/patch-smtpclient_main_c @@ -0,0 +1,32 @@ +$OpenBSD: patch-smtpclient_main_c,v 1.1.1.1 2001/08/13 01:06:41 naddy Exp $ +--- smtpclient_main.c.orig Wed Aug 1 15:25:22 2001 ++++ smtpclient_main.c Wed Aug 1 15:33:07 2001 +@@ -86,7 +86,7 @@ void log(char *str, ...) + char buf[1024]; + + va_start(ap, str); +- vsprintf(buf, str, ap); ++ vsnprintf(buf, 1024, str, ap); + if (usesyslog) + syslog(LOG_ERR, "SMTPclient: %s", buf); + else +@@ -395,16 +395,16 @@ int main(int argc, char **argv) + log("%s: unknown host\n", my_name); + exit(1); + } +- strcpy(my_name, hp->h_name); ++ strlcpy(my_name, hp->h_name, sizeof(my_name)); + + /* + * Determine from address. + */ + if (from_addr == NULL) { + if ((pwd = getpwuid(getuid())) == 0) { +- sprintf(buf, "userid-%d@%s", getuid(), my_name); ++ snprintf(buf, (sizeof(buf) - 1), "userid-%d@%s", getuid(), my_name); + } else { +- sprintf(buf, "%s@%s", pwd->pw_name, my_name); ++ snprintf(buf, (sizeof(buf) - 1), "%s@%s", pwd->pw_name, my_name); + } + from_addr = strdup(buf); + } diff --git a/mail/smtpclient/pkg/DESCR b/mail/smtpclient/pkg/DESCR new file mode 100644 index 00000000000..e33e09d695c --- /dev/null +++ b/mail/smtpclient/pkg/DESCR @@ -0,0 +1,8 @@ +SMTPclient -- simple SMTP client + +This program is a minimal SMTP client that takes an email +message body and passes it on to a SMTP server (default is the +MTA on the local host). Since it is completely self-supporting, +it is especially suitable for use in restricted environments. + +WWW: ${HOMEPAGE} diff --git a/mail/smtpclient/pkg/PLIST b/mail/smtpclient/pkg/PLIST new file mode 100644 index 00000000000..8cf0943a257 --- /dev/null +++ b/mail/smtpclient/pkg/PLIST @@ -0,0 +1,3 @@ +@comment $OpenBSD: PLIST,v 1.1.1.1 2001/08/13 01:06:41 naddy Exp $ +bin/smtpclient +man/man1/smtpclient.1