git: e575205acabb - main - mail/p5-Sendmail-PMilter: New port: Perl bindings for Sendmail/Postfix milter interface

From: Vladimir Druzenko <vvd_at_FreeBSD.org>
Date: Fri, 13 Sep 2024 13:33:39 UTC
The branch main has been updated by vvd:

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

commit e575205acabbd1b1fcc8766e78bdeabbf87a69b1
Author:     takeda <takeda@takeda.tk>
AuthorDate: 2024-09-13 13:31:12 +0000
Commit:     Vladimir Druzenko <vvd@FreeBSD.org>
CommitDate: 2024-09-13 13:31:12 +0000

    mail/p5-Sendmail-PMilter: New port: Perl bindings for Sendmail/Postfix milter interface
    
    The original Sendmail::Milter (mail/p5-Sendmail-Milter) is not really
    maintained, there's more up to date module Sendmail::PMilter:
    https://metacpan.org/dist/Sendmail-PMilter
    
    Latest version of bogofilter-milter require it:
    https://stuff.mit.edu/~jik/software/bogofilter-milter/
    
    PR:     281354
---
 mail/Makefile                                    |  1 +
 mail/p5-Sendmail-PMilter/Makefile                | 19 ++++++++++
 mail/p5-Sendmail-PMilter/distinfo                |  3 ++
 mail/p5-Sendmail-PMilter/files/patch-Makefile.PL | 45 ++++++++++++++++++++++++
 mail/p5-Sendmail-PMilter/pkg-descr               |  9 +++++
 mail/p5-Sendmail-PMilter/pkg-plist               |  4 +++
 6 files changed, 81 insertions(+)

diff --git a/mail/Makefile b/mail/Makefile
index efa897a0b22b..4bedae148209 100644
--- a/mail/Makefile
+++ b/mail/Makefile
@@ -429,6 +429,7 @@
     SUBDIR += p5-SES
     SUBDIR += p5-Sendmail-AccessDB
     SUBDIR += p5-Sendmail-Milter
+    SUBDIR += p5-Sendmail-PMilter
     SUBDIR += p5-Sisimai
     SUBDIR += p5-Test-Email
     SUBDIR += p5-URI-imap
diff --git a/mail/p5-Sendmail-PMilter/Makefile b/mail/p5-Sendmail-PMilter/Makefile
new file mode 100644
index 000000000000..84ac1cf0ef96
--- /dev/null
+++ b/mail/p5-Sendmail-PMilter/Makefile
@@ -0,0 +1,19 @@
+PORTNAME=	Sendmail-PMilter
+DISTVERSION=	1.27
+CATEGORIES=	mail perl5
+MASTER_SITES=	CPAN
+PKGNAMEPREFIX=	p5-
+
+MAINTAINER=	takeda@takeda.tk
+COMMENT=	Perl bindings for Sendmail/Postfix milter interface
+WWW=		https://metacpan.org/dist/Sendmail-PMilter
+
+LICENSE=	BSD3CLAUSE
+LICENSE_FILE=	${WRKSRC}/LICENSE
+
+USES=		perl5
+USE_PERL5=	configure
+
+NO_ARCH=	yes
+
+.include <bsd.port.mk>
diff --git a/mail/p5-Sendmail-PMilter/distinfo b/mail/p5-Sendmail-PMilter/distinfo
new file mode 100644
index 000000000000..5b2edbf67ea5
--- /dev/null
+++ b/mail/p5-Sendmail-PMilter/distinfo
@@ -0,0 +1,3 @@
+TIMESTAMP = 1725761565
+SHA256 (Sendmail-PMilter-1.27.tar.gz) = bb5265360d3c00b312e5ede02484ec2200a5252e48bebb4978420711d8d49b66
+SIZE (Sendmail-PMilter-1.27.tar.gz) = 39605
diff --git a/mail/p5-Sendmail-PMilter/files/patch-Makefile.PL b/mail/p5-Sendmail-PMilter/files/patch-Makefile.PL
new file mode 100644
index 000000000000..5a37c772bd3b
--- /dev/null
+++ b/mail/p5-Sendmail-PMilter/files/patch-Makefile.PL
@@ -0,0 +1,45 @@
+--- Makefile.PL.orig	2024-02-03 16:33:42 UTC
++++ Makefile.PL
+@@ -1,42 +1,6 @@ use ExtUtils::MakeMaker;
+ use 5.008004;
+ use ExtUtils::MakeMaker;
+ 
+-my $install = ( ExtUtils::MakeMaker::prompt(<<EOT . 'Do you wish to install the Sendmail::PMilter package?' => 'yes' ) );
+-
+-Sendmail::PMilter provides access to the message processing hooks in a
+-running Mail Transfer Agent (Sendmail or Postfix), so that filters
+-('milters') which process mail can be written entirely in Perl.  Mail
+-processing according to SMTP takes place at a number of well-defined
+-stages ('connect', 'helo', etc.) during the exchange of the message
+-between client and server.  At each stage, the sets of data available
+-(the connecting IP, sender address etc.) and the permissible actions
+-(rewrite a message header, ACCEPT a message, REJECT it etc.) are also
+-well-defined and are to some extent configurable.
+-
+-Filters built to use Sendmail::PMilter can examine all the information
+-made available by the MTA and can take any of the permitted actions at
+-any stage of mail processing.  Filters can be implemented much more
+-quickly in Perl than in a low-level language like C, and the Perl code
+-does not necessarily need to be thread-safe.  All mail is essentially
+-text, and Perl is a very powerful tool for text processing.  A milter
+-coded in Perl has full access to all Perl library functions, system
+-utilities, standard modules, modules installed from CPAN, modules of
+-your own; a Perl milter can do with a message more or less anything
+-that you might reasonably want to do.
+-
+-The interface to the running MTA follows the 'milter protocol'.  This
+-protocol is driven by the MTA.  It is effected by messages of a simple
+-structure which are passed between the MTA and the milter via a socket
+-connection.  Over the years the Milter Protocol has progressed through
+-several versions, and seems (February 2024) to be extremely stable at
+-Milter Protocol Version 6.
+-
+-Choose "yes" below to install Sendmail::PMilter from this package.
+-
+-EOT
+-
+-if( $install ne 'yes' ) { print "Not installing.\n"; exit; }
+-
+ my %PM = (
+         'lib/Sendmail/PMilter.pm'           =>  '$(INST_LIBDIR)/PMilter.pm',
+         'lib/Sendmail/PMilter/Context.pm'   =>  '$(INST_LIBDIR)/PMilter/Context.pm'
diff --git a/mail/p5-Sendmail-PMilter/pkg-descr b/mail/p5-Sendmail-PMilter/pkg-descr
new file mode 100644
index 000000000000..de854058c468
--- /dev/null
+++ b/mail/p5-Sendmail-PMilter/pkg-descr
@@ -0,0 +1,9 @@
+Sendmail::PMilter provides access to the message processing hooks in a
+running Mail Transfer Agent (Sendmail or Postfix), so that filters
+('milters') which process mail can be written entirely in Perl.  Mail
+processing according to SMTP takes place at a number of well-defined
+stages ('connect', 'helo', etc.) during the exchange of the message
+between client and server.  At each stage, the sets of data available
+(the connecting IP, sender address etc.) and the permissible actions
+(rewrite a message header, ACCEPT a message, REJECT it etc.) are also
+well-defined and are to some extent configurable.
diff --git a/mail/p5-Sendmail-PMilter/pkg-plist b/mail/p5-Sendmail-PMilter/pkg-plist
new file mode 100644
index 000000000000..54068099ddcd
--- /dev/null
+++ b/mail/p5-Sendmail-PMilter/pkg-plist
@@ -0,0 +1,4 @@
+%%SITE_PERL%%/Sendmail/PMilter.pm
+%%SITE_PERL%%/Sendmail/PMilter/Context.pm
+%%PERL5_MAN3%%/Sendmail::PMilter.3.gz
+%%PERL5_MAN3%%/Sendmail::PMilter::Context.3.gz