Hello all, this is my first attempt on a port (modification), please be patient.
[email protected] (Genadijus Paleckis), 2006.01.06 (Fri) 09:54 (CET): > ProxSMTP is a flexible tool that allows you to reject, change or log > email based on arbitrary critera. It accepts SMTP connections and > forwards the SMTP commands and responses to another SMTP server. The > 'DATA' email body is intercepted and filtered before forwarding. > patches included with port contains fixes strcat->strlcat, > strcpy->strlcpy and support for transparent proxying using PF. I bumped version to proxsmtp-1.8 (latest as of now), modified distinfo, HOMEPAGE, AUTOCONF_VERSION, WRKBUILD -> WRKSRC, added two more strcpy->strlcpy, automagically copy proxsmtpd.conf to SYSCONFDIR, adjusted MESSAGE to this and the ``new'' PF syntax. > Please test and report. Yes! diff of my changes from [email protected] port: diff -ur tmp/proxsmtp/Makefile /usr/ports/mail/proxsmtp/Makefile --- tmp/proxsmtp/Makefile Fri Jan 6 09:49:41 2006 +++ /usr/ports/mail/proxsmtp/Makefile Fri Dec 17 13:40:14 2010 @@ -1,9 +1,9 @@ COMMENT= "smtp proxy filter" -DISTNAME= proxsmtp-1.3 +DISTNAME= proxsmtp-1.8 PKGNAME= ${DISTNAME} CATEGORIES= mail -HOMEPAGE= http://memberwebs.com/nielsen/software/proxsmtp/ +HOMEPAGE= http://thewalter.net/stef/software/proxsmtp/ MASTER_SITES= ${HOMEPAGE} MAINTAINER= Genadijus Paleckis <[email protected]> @@ -17,15 +17,15 @@ WANTLIB= c pthread CONFIGURE_STYLE= autoconf -AUTOCONF_VERSION= 2.59 +AUTOCONF_VERSION= 2.61 post-install: ${INSTALL_DATA_DIR} ${PREFIX}/share/examples/proxsmtpd - ${INSTALL_DATA} ${WRKBUILD}/doc/proxsmtpd.conf \ + ${INSTALL_DATA} ${WRKSRC}/doc/proxsmtpd.conf \ ${PREFIX}/share/examples/proxsmtpd - ${INSTALL_DATA} ${WRKBUILD}/scripts/add_header.sh \ + ${INSTALL_DATA} ${WRKSRC}/scripts/add_header.sh \ ${PREFIX}/share/examples/proxsmtpd - ${INSTALL_DATA} ${WRKBUILD}/scripts/spamassassin.sh \ + ${INSTALL_DATA} ${WRKSRC}/scripts/spamassassin.sh \ ${PREFIX}/share/examples/proxsmtpd .include <bsd.port.mk> diff -ur tmp/proxsmtp/distinfo /usr/ports/mail/proxsmtp/distinfo --- tmp/proxsmtp/distinfo Thu Jan 5 07:20:38 2006 +++ /usr/ports/mail/proxsmtp/distinfo Fri Dec 17 13:03:59 2010 @@ -1,4 +1,5 @@ -MD5 (proxsmtp-1.3.tar.gz) = ed488f2444f3796af44eaa92d4fa477e -RMD160 (proxsmtp-1.3.tar.gz) = a936a147db1ffdd363a6f86fd845c9e8f12449e1 -SHA1 (proxsmtp-1.3.tar.gz) = bc816783774c976dfcd8da342ba49fb8d3149c25 -SIZE (proxsmtp-1.3.tar.gz) = 188684 +MD5 (proxsmtp-1.8.tar.gz) = 9a8662fbceb30c893e9983b2fe9c4801 +RMD160 (proxsmtp-1.8.tar.gz) = 397af3a9c2cceaf7c2a403b529ddd00fb77577fb +SHA1 (proxsmtp-1.8.tar.gz) = 9963d25f9c54736542e3c3a53974c61ae6915e7e +SHA256 (proxsmtp-1.8.tar.gz) = b6704790a5a4c0e5a53901baae7a8e894b22db48c016c628501b0559c53eb4b1 +SIZE (proxsmtp-1.8.tar.gz) = 202233 diff -ur tmp/proxsmtp/patches/patch-common_smtppass_c /usr/ports/mail/proxsmtp/patches/patch-common_smtppass_c --- tmp/proxsmtp/patches/patch-common_smtppass_c Thu Jan 5 14:26:38 2006 +++ /usr/ports/mail/proxsmtp/patches/patch-common_smtppass_c Fri Dec 17 13:15:17 2010 @@ -1,6 +1,6 @@ $OpenBSD$ ---- common/smtppass.c.orig Wed Oct 19 08:52:49 2005 -+++ common/smtppass.c Thu Jan 5 15:26:30 2006 +--- common/smtppass.c.orig Tue May 27 14:46:35 2008 ++++ common/smtppass.c Fri Dec 17 13:10:44 2010 @@ -64,6 +64,14 @@ #include <linux/netfilter_ipv4.h> #endif @@ -16,7 +16,7 @@ #include "compat.h" #include "sock_any.h" #include "stringx.h" -@@ -722,7 +730,12 @@ static int make_connections(spctx_t* ctx +@@ -737,7 +745,12 @@ struct sockaddr_any* outaddr; char buf[MAXPATHLEN]; const char* outname; @@ -30,7 +30,7 @@ ASSERT(client != -1); /* Setup the incoming connection. This also fills in peeraddr for us */ -@@ -738,7 +751,7 @@ static int make_connections(spctx_t* ctx +@@ -753,7 +766,7 @@ { memset(&addr, 0, sizeof(addr)); SANY_LEN(addr) = sizeof(addr); @@ -39,7 +39,7 @@ #ifdef LINUX_TRANSPARENT_PROXY if(getsockopt(ctx->client.fd, SOL_IP, SO_ORIGINAL_DST, &SANY_ADDR(addr), &SANY_LEN(addr)) == -1) #else -@@ -748,7 +761,41 @@ static int make_connections(spctx_t* ctx +@@ -763,7 +776,41 @@ sp_message(ctx, LOG_ERR, "couldn't get source address for transparent proxying"); return -1; } @@ -82,7 +82,7 @@ /* Check address types */ if(sock_any_cmp(&addr, &peeraddr, SANY_OPT_NOPORT) == 0) { -@@ -1078,7 +1125,7 @@ static int smtp_passthru(spctx_t* ctx) +@@ -1101,7 +1148,7 @@ /* Make note of the sender for later */ ctx->sender = (char*)reallocf(ctx->sender, strlen(t) + 1); if(ctx->sender) @@ -90,8 +90,8 @@ + strlcpy(ctx->sender, t, sizeof(ctx->sender)); } - /* RCPT TO */ -@@ -1094,11 +1141,11 @@ static int smtp_passthru(spctx_t* ctx) + /* RCPT TO (that the server accepted) */ +@@ -1117,11 +1164,11 @@ { /* Recipients are separated by lines */ if(r != 0) @@ -104,4 +104,21 @@ + strlcat(ctx->recipients, t, sizeof(ctx->recipients)); } } - + +@@ -1136,14 +1183,14 @@ + { + ctx->xforwardaddr = (char*)reallocf(ctx->xforwardaddr, strlen(t) + 1); + if(ctx->xforwardaddr) +- strcpy(ctx->xforwardaddr, t); ++ strlcpy(ctx->xforwardaddr, t, sizeof(ctx->xforwardaddr)); + } + + if((t = parse_xforward (C_LINE + KL(XFORWARD_CMD), "HELO"))) + { + ctx->xforwardhelo = (char*)reallocf(ctx->xforwardhelo, strlen(t) + 1); + if(ctx->xforwardhelo) +- strcpy(ctx->xforwardhelo, t); ++ strlcpy(ctx->xforwardhelo, t, sizeof(ctx->xforwardhelo)); + } + + } diff -ur tmp/proxsmtp/pkg/MESSAGE /usr/ports/mail/proxsmtp/pkg/MESSAGE --- tmp/proxsmtp/pkg/MESSAGE Fri Jan 6 09:22:55 2006 +++ /usr/ports/mail/proxsmtp/pkg/MESSAGE Fri Dec 17 13:58:41 2010 @@ -1,10 +1,14 @@ -Copy ${PREFIX}/share/examples/proxsmtpd/proxsmtpd.conf to /etc and change it -to affect your needs. +A sample proxsmtpd.conf has been copied to /etc. Edit it to suit your +needs. -I you intend to use it as transparent filter then add rule to pf.conf: -rdr on $int_if inet proto tcp from any to any port 25 -> 127.0.0.1 port 10025 +I you intend to use it in transparent mode then add a rule along these +lines to pf.conf: + +pass in on $int_if inet proto tcp from any to any port 25 \ + rdr-to 127.0.0.1 port 10025 + where $int_if is your internal firewall interface. -${PREFIX}/share/examples/proxsmtpd contains some examples how to write custom +${PREFIX}/share/examples/proxsmtpd contains some examples of custom filters. diff -ur tmp/proxsmtp/pkg/PLIST /usr/ports/mail/proxsmtp/pkg/PLIST --- tmp/proxsmtp/pkg/PLIST Fri Jan 6 09:21:59 2006 +++ /usr/ports/mail/proxsmtp/pkg/PLIST Fri Dec 17 13:50:17 2010 @@ -1,8 +1,9 @@ @comment $OpenBSD$ @man man/man5/proxsmtpd.conf.5 @man man/man8/proxsmtpd.8 -sbin/proxsmtpd +...@bin sbin/proxsmtpd share/examples/proxsmtpd/ share/examples/proxsmtpd/add_header.sh -share/examples/proxsmtpd/proxsmtpd.conf share/examples/proxsmtpd/spamassassin.sh +share/examples/proxsmtpd/proxsmtpd.conf +...@sample ${SYSCONFDIR}/proxsmtpd.conf
proxsmtp.tar.gz
Description: application/tar-gz
