mirror of
https://git.freebsd.org/ports.git
synced 2025-05-24 23:16:33 -04:00
- Take maintainership
- Various Makefile cleanups - Added protection for config files, including group creation/ deletion - Incorporated patches from http://bugs.debian.org/ssmtp to fix compiler warnings PR: ports/114945 Submitted by: znerd Reviewed by: stas
This commit is contained in:
parent
592e12bfdd
commit
08bdc13988
Notes:
svn2git
2021-03-31 03:12:20 +00:00
svn path=/head/; revision=223061
9 changed files with 632 additions and 29 deletions
1
GIDs
1
GIDs
|
@ -134,3 +134,4 @@ iserv:*:911:
|
|||
_relayd:*:913:
|
||||
bitlbee:*:914:
|
||||
logcheck:*:915:
|
||||
ssmtp:*:916:
|
||||
|
|
|
@ -7,6 +7,7 @@
|
|||
|
||||
PORTNAME= ssmtp
|
||||
PORTVERSION= 2.61.11.1
|
||||
PORTREVISION= 1
|
||||
CATEGORIES= mail ipv6
|
||||
MASTER_SITES= ${MASTER_SITE_DEBIAN_POOL}
|
||||
DISTNAME= ${PORTNAME}_2.61.orig
|
||||
|
@ -14,7 +15,7 @@ DISTFILES= ${DISTNAME}.tar.gz \
|
|||
ssmtp_2.61-11.1.diff.gz
|
||||
EXTRACT_ONLY= ${DISTNAME}.tar.gz
|
||||
|
||||
MAINTAINER= ports@FreeBSD.org
|
||||
MAINTAINER= glarkin@FreeBSD.org
|
||||
COMMENT= Extremely simple MTA to get mail off the system to a mail hub
|
||||
|
||||
WRKSRC= ${WRKDIR}/${PORTNAME}-2.61
|
||||
|
@ -24,14 +25,24 @@ USE_OPENSSL= yes
|
|||
GNU_CONFIGURE= yes
|
||||
USE_GMAKE= yes
|
||||
|
||||
SSMTP_GROUP= ssmtp
|
||||
SSMTP_GID= 916
|
||||
|
||||
SUB_FILES= pkg-install pkg-deinstall pkg-message
|
||||
SUB_LIST+= SSMTP_GROUP="${SSMTP_GROUP}" \
|
||||
SSMTP_GID="${SSMTP_GID}" \
|
||||
ETCDIR="${ETCDIR}" \
|
||||
CHOWN="${CHOWN}" CHMOD="${CHMOD}" PW="${PW}"
|
||||
|
||||
CONFIGURE_ARGS= --enable-ssl
|
||||
CFLAGS+= -I${OPENSSLINC}
|
||||
LDFLAGS+= -L${OPENSSLLIB}
|
||||
MAILERCONF= /etc/mail/mailer.conf
|
||||
TRUE= /usr/bin/true
|
||||
|
||||
MAN8= ssmtp.8
|
||||
|
||||
.include <bsd.port.pre.mk>
|
||||
|
||||
.if defined(WITH_LOGFILE)
|
||||
CONFIGURE_ARGS+= --enable-logfile
|
||||
.endif
|
||||
|
@ -65,12 +76,14 @@ replace:
|
|||
@${ECHO_CMD} "hoststat ${TRUE}" >> ${MAILERCONF}
|
||||
@${ECHO_CMD} "purgestat ${TRUE}" >> ${MAILERCONF}
|
||||
|
||||
post-install:
|
||||
@${ECHO_MSG} --------------------------------------------------
|
||||
@${ECHO_MSG}
|
||||
@${ECHO_MSG} "To replace sendmail with ssmtp type make replace"
|
||||
@${ECHO_MSG}
|
||||
@${ECHO_MSG} --------------------------------------------------
|
||||
@${SED} 's#%%PREFIX%%#${PREFIX}#' < ${PKGMESSAGE}
|
||||
pre-install:
|
||||
@${SETENV} ${SCRIPTS_ENV} PKG_PREFIX=${PREFIX} \
|
||||
${SH} ${PKGINSTALL} ${PKGNAME} PRE-INSTALL
|
||||
|
||||
.include <bsd.port.mk>
|
||||
post-install:
|
||||
@${SETENV} ${SCRIPTS_ENV} PKG_PREFIX=${PREFIX} \
|
||||
${SH} ${PKGINSTALL} ${PKGNAME} POST-INSTALL
|
||||
|
||||
@${CAT} ${PKGMESSAGE}
|
||||
|
||||
.include <bsd.port.post.mk>
|
||||
|
|
20
mail/ssmtp/files/patch-base64.c
Normal file
20
mail/ssmtp/files/patch-base64.c
Normal file
|
@ -0,0 +1,20 @@
|
|||
--- ./base64.c.orig 2002-05-07 09:26:43.000000000 -0400
|
||||
+++ ./base64.c 2008-11-17 18:55:03.000000000 -0500
|
||||
@@ -31,7 +31,7 @@
|
||||
};
|
||||
#define DECODE64(c) (isascii(c) ? base64val[c] : BAD)
|
||||
|
||||
-void to64frombits(unsigned char *out, const unsigned char *in, int inlen)
|
||||
+void to64frombits(char *out, const unsigned char *in, int inlen)
|
||||
/* raw bytes in quasi-big-endian order to base 64 string (NUL-terminated) */
|
||||
{
|
||||
for (; inlen >= 3; inlen -= 3)
|
||||
@@ -57,7 +57,7 @@
|
||||
*out = '\0';
|
||||
}
|
||||
|
||||
-int from64tobits(char *out, const char *in)
|
||||
+int from64tobits(unsigned char *out, const char *in)
|
||||
/* base 64 to raw bytes in quasi-big-endian order, returning count of bytes */
|
||||
{
|
||||
int len = 0;
|
|
@ -1,18 +1,124 @@
|
|||
--- ssmtp.c.orig Sat Nov 8 18:51:19 2003
|
||||
+++ ssmtp.c Sat Nov 8 19:01:07 2003
|
||||
@@ -14,6 +14,7 @@
|
||||
--- ssmtp.c.orig 2004-07-23 01:58:48.000000000 -0400
|
||||
+++ ssmtp.c 2008-11-19 16:13:46.000000000 -0500
|
||||
@@ -12,8 +12,9 @@
|
||||
See COPYRIGHT for the license
|
||||
|
||||
*/
|
||||
#define VERSION "2.60.4"
|
||||
-#define VERSION "2.60.4"
|
||||
+#define VERSION "2.61-11.1"
|
||||
|
||||
+#include <sys/types.h>
|
||||
#include <sys/socket.h>
|
||||
#include <netinet/in.h>
|
||||
#include <sys/param.h>
|
||||
@@ -366,9 +367,36 @@
|
||||
@@ -54,20 +55,20 @@
|
||||
|
||||
#define ARPADATE_LENGTH 32 /* Current date in RFC format */
|
||||
char arpadate[ARPADATE_LENGTH];
|
||||
-char *auth_user = (char)NULL;
|
||||
-char *auth_pass = (char)NULL;
|
||||
-char *auth_method = (char)NULL; /* Mechanism for SMTP authentication */
|
||||
-char *mail_domain = (char)NULL;
|
||||
-char *from = (char)NULL; /* Use this as the From: address */
|
||||
+char *auth_user = NULL;
|
||||
+char *auth_pass = NULL;
|
||||
+char *auth_method = NULL; /* Mechanism for SMTP authentication */
|
||||
+char *mail_domain = NULL;
|
||||
+char *from = NULL; /* Use this as the From: address */
|
||||
char hostname[MAXHOSTNAMELEN] = "localhost";
|
||||
char *mailhost = "mailhub";
|
||||
-char *minus_f = (char)NULL;
|
||||
-char *minus_F = (char)NULL;
|
||||
+char *minus_f = NULL;
|
||||
+char *minus_F = NULL;
|
||||
char *gecos;
|
||||
-char *prog = (char)NULL;
|
||||
+char *prog = NULL;
|
||||
char *root = NULL;
|
||||
char *tls_cert = "/etc/ssl/certs/ssmtp.pem"; /* Default Certificate */
|
||||
-char *uad = (char)NULL;
|
||||
+char *uad = NULL;
|
||||
|
||||
headers_t headers, *ht;
|
||||
|
||||
@@ -220,16 +221,16 @@
|
||||
char buf[MAXPATHLEN +1], *p;
|
||||
|
||||
if((p = strrchr(str, '/'))) {
|
||||
- if(strncpy(buf, ++p, MAXPATHLEN) == (char *)NULL) {
|
||||
+ if(strncpy(buf, ++p, MAXPATHLEN) == NULL) {
|
||||
die("basename() -- strncpy() failed");
|
||||
}
|
||||
}
|
||||
else {
|
||||
- if(strncpy(buf, str, MAXPATHLEN) == (char *)NULL) {
|
||||
+ if(strncpy(buf, str, MAXPATHLEN) == NULL) {
|
||||
die("basename() -- strncpy() failed");
|
||||
}
|
||||
}
|
||||
- buf[MAXPATHLEN] = (char)NULL;
|
||||
+ buf[MAXPATHLEN] = '\0';
|
||||
|
||||
return(strdup(buf));
|
||||
}
|
||||
@@ -256,7 +257,7 @@
|
||||
|
||||
p = (str + strlen(str));
|
||||
while(isspace(*--p)) {
|
||||
- *p = (char)NULL;
|
||||
+ *p = '\0';
|
||||
}
|
||||
|
||||
return(p);
|
||||
@@ -274,7 +275,7 @@
|
||||
#endif
|
||||
|
||||
/* Simple case with email address enclosed in <> */
|
||||
- if((p = strdup(str)) == (char *)NULL) {
|
||||
+ if((p = strdup(str)) == NULL) {
|
||||
die("addr_parse(): strdup()");
|
||||
}
|
||||
|
||||
@@ -282,7 +283,7 @@
|
||||
q++;
|
||||
|
||||
if((p = strchr(q, '>'))) {
|
||||
- *p = (char)NULL;
|
||||
+ *p = '\0';
|
||||
}
|
||||
|
||||
#if 0
|
||||
@@ -305,7 +306,7 @@
|
||||
q = strip_post_ws(p);
|
||||
if(*q == ')') {
|
||||
while((*--q != '('));
|
||||
- *q = (char)NULL;
|
||||
+ *q = '\0';
|
||||
}
|
||||
(void)strip_post_ws(p);
|
||||
|
||||
@@ -323,7 +324,7 @@
|
||||
{
|
||||
char buf[(BUF_SZ + 1)];
|
||||
|
||||
- if(strchr(str, '@') == (char *)NULL) {
|
||||
+ if(strchr(str, '@') == NULL) {
|
||||
if(snprintf(buf, BUF_SZ, "%s@%s", str,
|
||||
#ifdef REWRITE_DOMAIN
|
||||
rewrite_domain == True ? mail_domain : hostname
|
||||
@@ -348,7 +349,7 @@
|
||||
char *p;
|
||||
|
||||
if((p = strchr(str, '\n'))) {
|
||||
- *p = (char)NULL;
|
||||
+ *p = '\0';
|
||||
}
|
||||
|
||||
/* Any line beginning with a dot has an additional dot inserted;
|
||||
@@ -374,31 +375,58 @@
|
||||
{
|
||||
char buf[(BUF_SZ + 1)], *p;
|
||||
FILE *fp;
|
||||
-
|
||||
+#ifdef USERPREFS
|
||||
+ char *file=NULL;
|
||||
+ if (pw->pw_dir != NULL) {
|
||||
|
@ -24,15 +130,15 @@
|
|||
+ while(fgets(buf, sizeof(buf), fp)) {
|
||||
+ /* Make comments invisible */
|
||||
+ if((p = strchr(buf, '#'))) {
|
||||
+ *p = (char)NULL;
|
||||
+ *p = '\0';
|
||||
+ }
|
||||
+
|
||||
|
||||
+ /* Ignore malformed lines and comments */
|
||||
+ if(strchr(buf, '@') == (char *)NULL) {
|
||||
+ if(strchr(buf, '@') == NULL) {
|
||||
+ continue;
|
||||
+ }
|
||||
+ if((p = strtok(buf, "\n"))) {
|
||||
+ if((uad = strdup(p)) == (char *)NULL) {
|
||||
+ if((uad = strdup(p)) == NULL) {
|
||||
+ die("revaliases() -- strdup() failed");
|
||||
+ }
|
||||
+ }
|
||||
|
@ -47,3 +153,398 @@
|
|||
/* Search if a reverse alias is defined for the sender */
|
||||
while(fgets(buf, sizeof(buf), fp)) {
|
||||
/* Make comments invisible */
|
||||
if((p = strchr(buf, '#'))) {
|
||||
- *p = (char)NULL;
|
||||
+ *p = '\0';
|
||||
}
|
||||
|
||||
/* Ignore malformed lines and comments */
|
||||
- if(strchr(buf, ':') == (char *)NULL) {
|
||||
+ if(strchr(buf, ':') == NULL) {
|
||||
continue;
|
||||
}
|
||||
|
||||
/* Parse the alias */
|
||||
if(((p = strtok(buf, ":"))) && !strcmp(p, pw->pw_name)) {
|
||||
if((p = strtok(NULL, ": \t\r\n"))) {
|
||||
- if((uad = strdup(p)) == (char *)NULL) {
|
||||
+ if((uad = strdup(p)) == NULL) {
|
||||
die("revaliases() -- strdup() failed");
|
||||
}
|
||||
}
|
||||
|
||||
if((p = strtok(NULL, " \t\r\n:"))) {
|
||||
- if((mailhost = strdup(p)) == (char *)NULL) {
|
||||
+ if((mailhost = strdup(p)) == NULL) {
|
||||
die("revaliases() -- strdup() failed");
|
||||
}
|
||||
|
||||
@@ -435,7 +463,7 @@
|
||||
}
|
||||
|
||||
/* Remove the real name if necessary - just send the address */
|
||||
- if((p = addr_parse(str)) == (char *)NULL) {
|
||||
+ if((p = addr_parse(str)) == NULL) {
|
||||
die("from_strip() -- addr_parse() failed");
|
||||
}
|
||||
#if 0
|
||||
@@ -511,11 +539,11 @@
|
||||
#endif
|
||||
|
||||
/* Ignore missing usernames */
|
||||
- if(*str == (char)NULL) {
|
||||
+ if(*str == '\0') {
|
||||
return;
|
||||
}
|
||||
|
||||
- if((rt->string = strdup(str)) == (char *)NULL) {
|
||||
+ if((rt->string = strdup(str)) == NULL) {
|
||||
die("rcpt_save() -- strdup() failed");
|
||||
}
|
||||
|
||||
@@ -540,7 +568,7 @@
|
||||
(void)fprintf(stderr, "*** rcpt_parse(): str = [%s]\n", str);
|
||||
#endif
|
||||
|
||||
- if((p = strdup(str)) == (char *)NULL) {
|
||||
+ if((p = strdup(str)) == NULL) {
|
||||
die("rcpt_parse(): strdup() failed");
|
||||
}
|
||||
q = p;
|
||||
@@ -568,7 +596,7 @@
|
||||
}
|
||||
|
||||
/* End of string? */
|
||||
- if(*(q + 1) == (char)NULL) {
|
||||
+ if(*(q + 1) == '\0') {
|
||||
got_addr = True;
|
||||
}
|
||||
|
||||
@@ -576,7 +604,7 @@
|
||||
if((*q == ',') && (in_quotes == False)) {
|
||||
got_addr = True;
|
||||
|
||||
- *q = (char)NULL;
|
||||
+ *q = '\0';
|
||||
}
|
||||
|
||||
if(got_addr) {
|
||||
@@ -599,19 +627,21 @@
|
||||
{
|
||||
int i;
|
||||
unsigned char digest[MD5_DIGEST_LEN];
|
||||
- unsigned char digascii[MD5_DIGEST_LEN * 2];
|
||||
+ char digascii[MD5_DIGEST_LEN * 2];
|
||||
unsigned char challenge[(BUF_SZ + 1)];
|
||||
- unsigned char response[(BUF_SZ + 1)];
|
||||
- unsigned char secret[(MD5_BLOCK_LEN + 1)];
|
||||
+ char response[(BUF_SZ + 1)];
|
||||
+ char secret[(MD5_BLOCK_LEN + 1)];
|
||||
+ int challenge_len;
|
||||
|
||||
memset (secret,0,sizeof(secret));
|
||||
memset (challenge,0,sizeof(challenge));
|
||||
strncpy (secret, password, sizeof(secret));
|
||||
if (!challengeb64 || strlen(challengeb64) > sizeof(challenge) * 3 / 4)
|
||||
return 0;
|
||||
- from64tobits(challenge, challengeb64);
|
||||
+ challenge_len = from64tobits(challenge, challengeb64);
|
||||
|
||||
- hmac_md5(challenge, strlen(challenge), secret, strlen(secret), digest);
|
||||
+ hmac_md5(challenge, challenge_len,
|
||||
+ (unsigned char *)secret, strlen(secret), digest);
|
||||
|
||||
for (i = 0; i < MD5_DIGEST_LEN; i++) {
|
||||
digascii[2 * i] = hextab[digest[i] >> 4];
|
||||
@@ -625,7 +655,7 @@
|
||||
strncpy (response, username, sizeof(response) - sizeof(digascii) - 2);
|
||||
strcat (response, " ");
|
||||
strcat (response, digascii);
|
||||
- to64frombits(responseb64, response, strlen(response));
|
||||
+ to64frombits(responseb64, (unsigned char *)response, strlen(response));
|
||||
|
||||
return 1;
|
||||
}
|
||||
@@ -660,7 +690,7 @@
|
||||
(void)fprintf(stderr, "header_save(): str = [%s]\n", str);
|
||||
#endif
|
||||
|
||||
- if((p = strdup(str)) == (char *)NULL) {
|
||||
+ if((p = strdup(str)) == NULL) {
|
||||
die("header_save() -- strdup() failed");
|
||||
}
|
||||
ht->string = p;
|
||||
@@ -668,7 +698,7 @@
|
||||
if(strncasecmp(ht->string, "From:", 5) == 0) {
|
||||
#if 1
|
||||
/* Hack check for NULL From: line */
|
||||
- if(*(p + 6) == (char)NULL) {
|
||||
+ if(*(p + 6) == '\0') {
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
@@ -727,19 +757,19 @@
|
||||
void header_parse(FILE *stream)
|
||||
{
|
||||
size_t size = BUF_SZ, len = 0;
|
||||
- char *p = (char *)NULL, *q;
|
||||
+ char *p = NULL, *q = NULL;
|
||||
bool_t in_header = True;
|
||||
- char l = (char)NULL;
|
||||
+ char l = '\0';
|
||||
int c;
|
||||
|
||||
while(in_header && ((c = fgetc(stream)) != EOF)) {
|
||||
/* Must have space for up to two more characters, since we
|
||||
may need to insert a '\r' */
|
||||
- if((p == (char *)NULL) || (len >= (size - 1))) {
|
||||
+ if((p == NULL) || (len >= (size - 1))) {
|
||||
size += BUF_SZ;
|
||||
|
||||
p = (char *)realloc(p, (size * sizeof(char)));
|
||||
- if(p == (char *)NULL) {
|
||||
+ if(p == NULL) {
|
||||
die("header_parse() -- realloc() failed");
|
||||
}
|
||||
q = (p + len);
|
||||
@@ -764,9 +794,9 @@
|
||||
in_header = False;
|
||||
|
||||
default:
|
||||
- *q = (char)NULL;
|
||||
+ *q = '\0';
|
||||
if((q = strrchr(p, '\n'))) {
|
||||
- *q = (char)NULL;
|
||||
+ *q = '\0';
|
||||
}
|
||||
header_save(p);
|
||||
|
||||
@@ -796,17 +826,17 @@
|
||||
while(fgets(buf, sizeof(buf), fp)) {
|
||||
/* Make comments invisible */
|
||||
if((p = strchr(buf, '#'))) {
|
||||
- *p = (char)NULL;
|
||||
+ *p = '\0';
|
||||
}
|
||||
|
||||
/* Ignore malformed lines and comments */
|
||||
- if(strchr(buf, '=') == (char *)NULL) continue;
|
||||
+ if(strchr(buf, '=') == NULL) continue;
|
||||
|
||||
/* Parse out keywords */
|
||||
- if(((p = strtok(buf, "= \t\n")) != (char *)NULL)
|
||||
- && ((q = strtok(NULL, "= \t\n:")) != (char *)NULL)) {
|
||||
+ if(((p = strtok(buf, "= \t\n")) != NULL)
|
||||
+ && ((q = strtok(NULL, "= \t\n:")) != NULL)) {
|
||||
if(strcasecmp(p, "Root") == 0) {
|
||||
- if((root = strdup(q)) == (char *)NULL) {
|
||||
+ if((root = strdup(q)) == NULL) {
|
||||
die("parse_config() -- strdup() failed");
|
||||
}
|
||||
|
||||
@@ -815,7 +845,7 @@
|
||||
}
|
||||
}
|
||||
else if(strcasecmp(p, "MailHub") == 0) {
|
||||
- if((mailhost = strdup(q)) == (char *)NULL) {
|
||||
+ if((mailhost = strdup(q)) == NULL) {
|
||||
die("parse_config() -- strdup() failed");
|
||||
}
|
||||
|
||||
@@ -851,7 +881,7 @@
|
||||
mail_domain = strdup(q);
|
||||
}
|
||||
|
||||
- if(mail_domain == (char *)NULL) {
|
||||
+ if(mail_domain == NULL) {
|
||||
die("parse_config() -- strdup() failed");
|
||||
}
|
||||
rewrite_domain = True;
|
||||
@@ -927,7 +957,7 @@
|
||||
}
|
||||
}
|
||||
else if(strcasecmp(p, "TLSCert") == 0) {
|
||||
- if((tls_cert = strdup(q)) == (char *)NULL) {
|
||||
+ if((tls_cert = strdup(q)) == NULL) {
|
||||
die("parse_config() -- strdup() failed");
|
||||
}
|
||||
|
||||
@@ -938,7 +968,7 @@
|
||||
#endif
|
||||
/* Command-line overrides these */
|
||||
else if(strcasecmp(p, "AuthUser") == 0 && !auth_user) {
|
||||
- if((auth_user = strdup(q)) == (char *)NULL) {
|
||||
+ if((auth_user = strdup(q)) == NULL) {
|
||||
die("parse_config() -- strdup() failed");
|
||||
}
|
||||
|
||||
@@ -947,7 +977,7 @@
|
||||
}
|
||||
}
|
||||
else if(strcasecmp(p, "AuthPass") == 0 && !auth_pass) {
|
||||
- if((auth_pass = strdup(q)) == (char *)NULL) {
|
||||
+ if((auth_pass = strdup(q)) == NULL) {
|
||||
die("parse_config() -- strdup() failed");
|
||||
}
|
||||
|
||||
@@ -956,7 +986,7 @@
|
||||
}
|
||||
}
|
||||
else if(strcasecmp(p, "AuthMethod") == 0 && !auth_method) {
|
||||
- if((auth_method = strdup(q)) == (char *)NULL) {
|
||||
+ if((auth_method = strdup(q)) == NULL) {
|
||||
die("parse_config() -- strdup() failed");
|
||||
}
|
||||
|
||||
@@ -982,11 +1012,11 @@
|
||||
#ifdef INET6
|
||||
struct addrinfo hints, *ai0, *ai;
|
||||
char servname[NI_MAXSERV];
|
||||
- int s;
|
||||
+ int s = -1;
|
||||
#else
|
||||
struct sockaddr_in name;
|
||||
struct hostent *hent;
|
||||
- int s, namelen;
|
||||
+ int s = -1, namelen;
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_SSL
|
||||
@@ -996,7 +1026,7 @@
|
||||
/* Init SSL stuff */
|
||||
SSL_CTX *ctx;
|
||||
SSL_METHOD *meth;
|
||||
- X509 *server_cert;
|
||||
+ const X509 *server_cert;
|
||||
|
||||
SSL_load_error_strings();
|
||||
SSLeay_add_ssl_algorithms();
|
||||
@@ -1117,6 +1147,7 @@
|
||||
}
|
||||
use_tls=True; /* now continue as normal for SSL */
|
||||
}
|
||||
+ printf("cert ok\n");
|
||||
|
||||
ssl = SSL_new(ctx);
|
||||
if(!ssl) {
|
||||
@@ -1179,7 +1210,7 @@
|
||||
buf[i++] = c;
|
||||
}
|
||||
}
|
||||
- buf[i] = (char)NULL;
|
||||
+ buf[i] = '\0';
|
||||
|
||||
return(buf);
|
||||
}
|
||||
@@ -1293,14 +1324,14 @@
|
||||
}
|
||||
|
||||
if((p = strtok(pw->pw_gecos, ";,"))) {
|
||||
- if((gecos = strdup(p)) == (char *)NULL) {
|
||||
+ if((gecos = strdup(p)) == NULL) {
|
||||
die("ssmtp() -- strdup() failed");
|
||||
}
|
||||
}
|
||||
revaliases(pw);
|
||||
|
||||
/* revaliases() may have defined this */
|
||||
- if(uad == (char *)NULL) {
|
||||
+ if(uad == NULL) {
|
||||
uad = append_domain(pw->pw_name);
|
||||
}
|
||||
|
||||
@@ -1349,7 +1380,7 @@
|
||||
/* Try to log in if username was supplied */
|
||||
if(auth_user) {
|
||||
#ifdef MD5AUTH
|
||||
- if(auth_pass == (char *)NULL) {
|
||||
+ if(auth_pass == NULL) {
|
||||
auth_pass = strdup("");
|
||||
}
|
||||
|
||||
@@ -1377,7 +1408,7 @@
|
||||
}
|
||||
memset(buf, 0, sizeof(buf));
|
||||
|
||||
- to64frombits(buf, auth_pass, strlen(auth_pass));
|
||||
+ to64frombits(buf, (unsigned char *)auth_pass, strlen(auth_pass));
|
||||
#ifdef MD5AUTH
|
||||
}
|
||||
#endif
|
||||
@@ -1549,7 +1580,7 @@
|
||||
j = 0;
|
||||
|
||||
add = 1;
|
||||
- while(argv[i][++j] != (char)NULL) {
|
||||
+ while(argv[i][++j] != '\0') {
|
||||
switch(argv[i][j]) {
|
||||
#ifdef INET6
|
||||
case '6':
|
||||
@@ -1567,14 +1598,14 @@
|
||||
if((!argv[i][(j + 1)])
|
||||
&& argv[(i + 1)]) {
|
||||
auth_user = strdup(argv[i+1]);
|
||||
- if(auth_user == (char *)NULL) {
|
||||
+ if(auth_user == NULL) {
|
||||
die("parse_options() -- strdup() failed");
|
||||
}
|
||||
add++;
|
||||
}
|
||||
else {
|
||||
auth_user = strdup(argv[i]+j+1);
|
||||
- if(auth_user == (char *)NULL) {
|
||||
+ if(auth_user == NULL) {
|
||||
die("parse_options() -- strdup() failed");
|
||||
}
|
||||
}
|
||||
@@ -1584,14 +1615,14 @@
|
||||
if((!argv[i][(j + 1)])
|
||||
&& argv[(i + 1)]) {
|
||||
auth_pass = strdup(argv[i+1]);
|
||||
- if(auth_pass == (char *)NULL) {
|
||||
+ if(auth_pass == NULL) {
|
||||
die("parse_options() -- strdup() failed");
|
||||
}
|
||||
add++;
|
||||
}
|
||||
else {
|
||||
auth_pass = strdup(argv[i]+j+1);
|
||||
- if(auth_pass == (char *)NULL) {
|
||||
+ if(auth_pass == NULL) {
|
||||
die("parse_options() -- strdup() failed");
|
||||
}
|
||||
}
|
||||
@@ -1669,14 +1700,14 @@
|
||||
case 'F':
|
||||
if((!argv[i][(j + 1)]) && argv[(i + 1)]) {
|
||||
minus_F = strdup(argv[(i + 1)]);
|
||||
- if(minus_F == (char *)NULL) {
|
||||
+ if(minus_F == NULL) {
|
||||
die("parse_options() -- strdup() failed");
|
||||
}
|
||||
add++;
|
||||
}
|
||||
else {
|
||||
minus_F = strdup(argv[i]+j+1);
|
||||
- if(minus_F == (char *)NULL) {
|
||||
+ if(minus_F == NULL) {
|
||||
die("parse_options() -- strdup() failed");
|
||||
}
|
||||
}
|
||||
@@ -1688,14 +1719,14 @@
|
||||
case 'r':
|
||||
if((!argv[i][(j + 1)]) && argv[(i + 1)]) {
|
||||
minus_f = strdup(argv[(i + 1)]);
|
||||
- if(minus_f == (char *)NULL) {
|
||||
+ if(minus_f == NULL) {
|
||||
die("parse_options() -- strdup() failed");
|
||||
}
|
||||
add++;
|
||||
}
|
||||
else {
|
||||
minus_f = strdup(argv[i]+j+1);
|
||||
- if(minus_f == (char *)NULL) {
|
||||
+ if(minus_f == NULL) {
|
||||
die("parse_options() -- strdup() failed");
|
||||
}
|
||||
}
|
||||
|
|
10
mail/ssmtp/files/patch-ssmtp.h
Normal file
10
mail/ssmtp/files/patch-ssmtp.h
Normal file
|
@ -0,0 +1,10 @@
|
|||
--- ./ssmtp.h.orig 2002-09-27 09:18:24.000000000 -0400
|
||||
+++ ./ssmtp.h 2008-11-17 18:55:03.000000000 -0500
|
||||
@@ -37,5 +37,5 @@
|
||||
void get_arpadate(char *);
|
||||
|
||||
/* base64.c */
|
||||
-void to64frombits(unsigned char *, const unsigned char *, int);
|
||||
-int from64tobits(char *, const char *);
|
||||
+void to64frombits(char *, const unsigned char *, int);
|
||||
+int from64tobits(unsigned char *, const char *);
|
21
mail/ssmtp/files/pkg-deinstall.in
Normal file
21
mail/ssmtp/files/pkg-deinstall.in
Normal file
|
@ -0,0 +1,21 @@
|
|||
#!/bin/sh
|
||||
PATH="/bin:/sbin:/usr/bin:/usr/sbin"
|
||||
|
||||
SSMTP_GROUP=%%SSMTP_GROUP%%
|
||||
|
||||
PW=%%PW%%
|
||||
|
||||
if [ "$2" = "DEINSTALL" ]; then
|
||||
|
||||
if ${PW} groupshow ${SSMTP_GROUP} 2>/dev/null 1>&2; then
|
||||
if ${PW} groupdel -n ${SSMTP_GROUP}; then
|
||||
echo "=> Removed group \"${SSMTP_GROUP}\"."
|
||||
else
|
||||
echo "=> Removal of group \"${SSMTP_GROUP}\" failed..."
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
|
||||
fi
|
||||
|
||||
exit 0
|
33
mail/ssmtp/files/pkg-install.in
Normal file
33
mail/ssmtp/files/pkg-install.in
Normal file
|
@ -0,0 +1,33 @@
|
|||
#!/bin/sh
|
||||
PATH="/bin:/sbin:/usr/bin:/usr/sbin"
|
||||
|
||||
SSMTP_GROUP=%%SSMTP_GROUP%%
|
||||
GID=%%SSMTP_GID%%
|
||||
|
||||
ETCDIR=%%ETCDIR%%
|
||||
CHOWN=%%CHOWN%%
|
||||
CHMOD=%%CHMOD%%
|
||||
PW=%%PW%%
|
||||
|
||||
if [ "$2" = "PRE-INSTALL" ]; then
|
||||
|
||||
if ! ${PW} groupshow ${SSMTP_GROUP} 2>/dev/null 1>&2; then
|
||||
if ${PW} groupadd ${SSMTP_GROUP} -g $GID; then
|
||||
echo "=> Added group \"${SSMTP_GROUP}\"."
|
||||
else
|
||||
echo "=> Adding group \"${SSMTP_GROUP}\" failed..."
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
|
||||
elif [ "$2" = "POST-INSTALL" ]; then
|
||||
|
||||
${CHOWN} root:${SSMTP_GROUP} ${PKG_PREFIX}/sbin/ssmtp
|
||||
${CHMOD} g+s ${PKG_PREFIX}/sbin/ssmtp
|
||||
${CHOWN} -R root:${SSMTP_GROUP} ${ETCDIR}
|
||||
${CHMOD} 750 ${ETCDIR}
|
||||
${CHMOD} 640 ${ETCDIR}/*
|
||||
|
||||
fi
|
||||
|
||||
exit 0
|
|
@ -1,5 +1,8 @@
|
|||
sSMTP has been installed successfully.
|
||||
|
||||
To replace sendmail with ssmtp type "make replace"
|
||||
|
||||
However, before you can use the program, you should copy the files
|
||||
"revaliases.sample" and "ssmtp.conf.sample" in %%PREFIX%%/etc/ssmtp to
|
||||
"revaliases" and "ssmtp.conf" respectively and edit them to suit your needs.
|
||||
"revaliases.sample" and "ssmtp.conf.sample" in %%PREFIX%%/etc/ssmtp
|
||||
to "revaliases" and "ssmtp.conf" respectively and edit them to suit
|
||||
your needs.
|
|
@ -1,9 +1,10 @@
|
|||
A secure, effective and simple way of getting mail off a system to your
|
||||
mail hub. It contains no suid-binaries or other dangerous things - no mail
|
||||
spool to poke around in, and no daemons running in the background. Mail is
|
||||
simply forwarded to the configured mailhost. Extremely easy configuration.
|
||||
A secure, effective and simple way of getting mail off a system to
|
||||
your mail hub. It does not include a mail spool to poke around in,
|
||||
and no daemons running in the background. Mail is simply forwarded
|
||||
to the configured mailhost. Extremely easy configuration.
|
||||
|
||||
WARNING: the above is all it does; it does not receive mail, expand aliases
|
||||
or manage a queue. That belongs on a mail hub with a system administrator.
|
||||
WARNING: the above is all it does; it does not receive mail, expand
|
||||
aliases or manage a queue. That belongs on a mail hub with a system
|
||||
administrator.
|
||||
|
||||
WWW: http://packages.debian.org/stable/mail/ssmtp
|
||||
WWW: http://packages.debian.org/stable/mail/ssmtp
|
||||
|
|
Loading…
Add table
Reference in a new issue