git: a3c7e5c215f6 - main - mail/postforward: New port: Postfix SRS forwarding agent

From: Daniel Engberg <diizzy_at_FreeBSD.org>
Date: Sun, 16 Oct 2022 21:23:46 UTC
The branch main has been updated by diizzy:

URL: https://cgit.FreeBSD.org/ports/commit/?id=a3c7e5c215f60071f920633960373fcef3b892d0

commit a3c7e5c215f60071f920633960373fcef3b892d0
Author:     Gian Luca Decurtins <luca@asgard.ch>
AuthorDate: 2022-10-16 21:19:42 +0000
Commit:     Daniel Engberg <diizzy@FreeBSD.org>
CommitDate: 2022-10-16 21:23:08 +0000

    mail/postforward: New port: Postfix SRS forwarding agent
    
    Postforward is a mail forwarding utility which aims to compliment the
    Postfix Sender Rewriting Scheme daemon (mail/postsrsd).
    
    The downside of using PostSRSd is that all mail is naively rewritten,
    even when no forwarding is actually performed. Such rewritten
    Return-Path addresses may confuse sieve scripts and other mail filtering
    software.
    
    This is where Postforward comes in. Instead of rewriting all incoming
    mail regardless of final destination, mail systems may be configured to
    pipe mail into Postforward only when forwarding needs to happen,
    leaving non-forwarded mail unaltered by PostSRSd. Postforward will
    rewrite envelope addresses for piped mail using PostSRSd itself and
    re-inject these messages back into the queue, destined for the
    forwarding recipient(s).
    
    Additional patch added to handle mailing lists
    
    Committers note:
    Patch modified to follow Porters Handbook more closely
    
    Reference:
    https://github.com/arbales/postforward/commit/c45dfe827ab9b1fafe3f4b10b8b773353ba908c4
    
    PR:             253035
---
 mail/Makefile              |  1 +
 mail/postforward/Makefile  | 36 ++++++++++++++++++++++++++++++++++++
 mail/postforward/distinfo  |  5 +++++
 mail/postforward/pkg-descr |  2 ++
 4 files changed, 44 insertions(+)

diff --git a/mail/Makefile b/mail/Makefile
index 4d365a576c59..941234e606f0 100644
--- a/mail/Makefile
+++ b/mail/Makefile
@@ -481,6 +481,7 @@
     SUBDIR += postfixadmin-lite
     SUBDIR += postfixadmin33
     SUBDIR += postfixadmin33-lite
+    SUBDIR += postforward
     SUBDIR += postgrey
     SUBDIR += postsrsd
     SUBDIR += prepflog
diff --git a/mail/postforward/Makefile b/mail/postforward/Makefile
new file mode 100644
index 000000000000..89d2757f5766
--- /dev/null
+++ b/mail/postforward/Makefile
@@ -0,0 +1,36 @@
+PORTNAME=	postforward
+DISTVERSIONPREFIX=	v
+DISTVERSION=	1.1.1
+CATEGORIES=	mail
+
+PATCH_SITES=	https://github.com/arbales/postforward/commit/
+PATCHFILES=	c45dfe827ab9b1fafe3f4b10b8b773353ba908c4.patch:-p1
+
+MAINTAINER=	luca@asgard.ch
+COMMENT=	Postfix SRS forwarding agent
+WWW=		https://github.com/zoni/postforward
+
+LICENSE=	BSD2CLAUSE
+LICENSE_FILE=	${WRKSRC}/LICENSE.txt
+
+RUN_DEPENDS=	postsrsd:mail/postsrsd
+
+USES=		go
+
+USE_GITHUB=	yes
+GH_ACCOUNT=	zoni
+
+GO_PKGNAME=	github.com/${GH_ACCOUNT}/${PORTNAME}
+GO_BUILDFLAGS=	-ldflags="-s -w"
+
+PLIST_FILES=	bin/${PORTNAME}
+
+PORTDOCS=	README.md CHANGES.md
+
+OPTIONS_DEFINE=	DOCS
+
+post-install-DOCS-on:
+	@${MKDIR} ${STAGEDIR}${DOCSDIR}
+	(cd ${WRKSRC} && ${INSTALL_DATA} ${PORTDOCS} ${STAGEDIR}${DOCSDIR})
+
+.include <bsd.port.mk>
diff --git a/mail/postforward/distinfo b/mail/postforward/distinfo
new file mode 100644
index 000000000000..f82324794bdd
--- /dev/null
+++ b/mail/postforward/distinfo
@@ -0,0 +1,5 @@
+TIMESTAMP = 1665953717
+SHA256 (zoni-postforward-v1.1.1_GH0.tar.gz) = caef40d6090d7e3ce01448d57cdb55933df434c2e430e5dbeac2e4f4bc59a1f5
+SIZE (zoni-postforward-v1.1.1_GH0.tar.gz) = 6086
+SHA256 (c45dfe827ab9b1fafe3f4b10b8b773353ba908c4.patch) = 862eecf6e6658762b7fbe621191c6aa7d66380607f2c5e0fddc767ccb8c14110
+SIZE (c45dfe827ab9b1fafe3f4b10b8b773353ba908c4.patch) = 2082
diff --git a/mail/postforward/pkg-descr b/mail/postforward/pkg-descr
new file mode 100644
index 000000000000..a7441f3b1f5b
--- /dev/null
+++ b/mail/postforward/pkg-descr
@@ -0,0 +1,2 @@
+Postforward is a mail forwarding utility which aims to compliment the Postfix
+Sender Rewriting Scheme daemon (PostSRSd).