diff --git a/mail/p5-Mail-Milter-Authentication/Makefile b/mail/p5-Mail-Milter-Authentication/Makefile index 83b0fa34b5ab..1a97766c5251 100644 --- a/mail/p5-Mail-Milter-Authentication/Makefile +++ b/mail/p5-Mail-Milter-Authentication/Makefile @@ -1,95 +1,100 @@ PORTNAME= Mail-Milter-Authentication -PORTVERSION= 3.20240205 -PORTREVISION= 1 +PORTVERSION= 3.20241011 CATEGORIES= mail perl5 MASTER_SITES= CPAN PKGNAMEPREFIX= p5- MAINTAINER= nork@FreeBSD.org COMMENT= Perl Mail Authentication Milter WWW= https://metacpan.org/release/Mail-Milter-Authentication/ LICENSE= ART10 GPLv1+ LICENSE_COMB= dual BUILD_DEPENDS= p5-File-ShareDir-Install>0:devel/p5-File-ShareDir-Install RUN_DEPENDS= p5-App-Cmd>0:devel/p5-App-Cmd \ p5-Clone>0:devel/p5-Clone \ p5-Date-Manip>0:devel/p5-Date-Manip \ p5-Email-Date-Format>0:mail/p5-Email-Date-Format \ p5-Email-Sender>0:mail/p5-Email-Sender \ p5-Email-Simple>0:mail/p5-Email-Simple \ p5-File-Slurp>0:devel/p5-File-Slurp \ p5-Import-Into>0:devel/p5-Import-Into \ p5-JSON-XS>0:converters/p5-JSON-XS \ p5-List-MoreUtils>0:lang/p5-List-MoreUtils \ p5-Lock-File>0:devel/p5-Lock-File \ p5-Log-Dispatchouli>0:devel/p5-Log-Dispatchouli \ p5-Mail-AuthenticationResults>2.20230112:mail/p5-Mail-AuthenticationResults \ p5-Mail-BIMI>=3.20230913:mail/p5-Mail-BIMI \ p5-Mail-DataFeed-Abusix>=1.20200617.1:mail/p5-Mail-DataFeed-Abusix \ p5-Mail-DKIM>=1.20200824:mail/p5-Mail-DKIM \ p5-Mail-DMARC>=1.20160612:mail/p5-Mail-DMARC \ p5-Mail-SPF>0:mail/p5-Mail-SPF \ p5-Net-DNS-Resolver-Mock>=1.20171219:dns/p5-Net-DNS-Resolver-Mock \ p5-Net-DNS>=1.01:dns/p5-Net-DNS \ p5-Net-IP>0:net-mgmt/p5-Net-IP \ p5-Net-Server>0:net/p5-Net-Server \ p5-Proc-ProcessTable>0:devel/p5-Proc-ProcessTable \ p5-Prometheus-Tiny-Shared>=0.020:net-mgmt/p5-Prometheus-Tiny-Shared \ p5-Sereal>0:converters/p5-Sereal \ p5-SUPER>0:devel/p5-SUPER \ p5-Test-File-Contents>0:devel/p5-Test-File-Contents \ p5-Text-Table>0:textproc/p5-Text-Table \ p5-TimeDate>0:devel/p5-TimeDate \ p5-TOML>0:textproc/p5-TOML TEST_DEPENDS= p5-Crypt-OpenSSL-RSA>0:security/p5-Crypt-OpenSSL-RSA \ p5-Test-CheckManifest>0:devel/p5-Test-CheckManifest \ p5-Test-Exception>0:devel/p5-Test-Exception \ - p5-Test-Perl-Critic>0:textproc/p5-Test-Perl-Critic + p5-Test-Perl-Critic>0:textproc/p5-Test-Perl-Critic \ + p5-Test-Pod>0:devel/p5-Test-Pod USES= perl5 shebangfix USE_PERL5= configure USE_RC_SUBR= authentication_milter SHEBANG_FILES= bin/authentication_milter bin/authentication_milter_blocker \ bin/authentication_milter_client bin/authentication_milter_log TEST_ENV= AUTHOR_TESTING=1 \ RELEASE_TESTING=1 \ TEST_AUTHOR=1 -ETCDIR= ${PREFIX}/etc/mail +ETCDIR= ${PREFIX}/etc/mail EXTRACT_AFTER_ARGS= --exclude ./share/authentication_milter.init \ --no-same-owner --no-same-permission -.for V in CACHEDIR ETCDIR RUNDIR SPOOLDIR VARLIBDIR VARLIBDIRBASE \ - DEFAULT_USER DEFAULT_GROUP -REINPLACE_LIST+= -e "s|%%${V}%%|${$V}|g" -.endfor -NO_ARCH= yes -SUB_FILES= pkg-message -.for V in CACHEDIR ETCDIR RUNDIR SPOOLDIR VARLIBDIR VARLIBDIRBASE \ - DEFAULT_USER DEFAULT_GROUP -SUB_LIST+= ${V}=${$V} -.endfor - +REINPLACE_VARS= CACHEDIR \ + DEFAULT_GROUP \ + DEFAULT_USER \ + ETCDIR \ + RUNDIR \ + SPOOLDIR \ + VARLIBDIR \ + VARLIBDIRBASE +REINPLACE_LIST= ${REINPLACE_VARS:@.V.@-e "s|%%${.V.}%%|${${.V.}}|g"@} +NO_ARCH= yes +SUB_FILES= pkg-message +SUB_LIST= ${REINPLACE_VARS:@.V.@${.V.}=${${.V.}}@} PLIST_SUB= ${SUB_LIST} +.ifnmake portclippy CACHEDIR= /var/cache/auth_milter DEFAULT_GROUP= mailnull DEFAULT_USER= mailnull RUNDIR= /var/run/auth_milter SPOOLDIR= /var/spool/auth_milter VARLIBDIR= /var/lib/auth_milter VARLIBDIRBASE= /var/lib +.endif post-patch: cd ${PATCH_WRKSRC} && ${REINPLACE_CMD} ${REINPLACE_LIST} \ bin/authentication_milter \ lib/Mail/Milter/Authentication/Config.pm \ lib/Mail/Milter/Authentication/Handler/DMARC.pm \ - share/authentication_milter.json + share/authentication_milter.json \ + t/04-unit-handler-dmarc.t + ${FIND} ${WRKSRC} -name "*.bak" -delete -o -name "*.orig" -delete post-install: ${MKDIR} ${STAGEDIR}${ETCDIR}/authentication_milter.d .include diff --git a/mail/p5-Mail-Milter-Authentication/distinfo b/mail/p5-Mail-Milter-Authentication/distinfo index 248b6a8464f1..adaa1057af8b 100644 --- a/mail/p5-Mail-Milter-Authentication/distinfo +++ b/mail/p5-Mail-Milter-Authentication/distinfo @@ -1,3 +1,3 @@ -TIMESTAMP = 1708613768 -SHA256 (Mail-Milter-Authentication-3.20240205.tar.gz) = 88a04406509c2f6a2b1b718b1ca250dc4e86f783343ceeb6cd6eac00ed4d0d7e -SIZE (Mail-Milter-Authentication-3.20240205.tar.gz) = 249101 +TIMESTAMP = 1728744567 +SHA256 (Mail-Milter-Authentication-3.20241011.tar.gz) = fa7ef2251ab72a2fbc551ae65223d261c28658a34eb4b7c42aabaed21d3a0eaa +SIZE (Mail-Milter-Authentication-3.20241011.tar.gz) = 257856 diff --git a/mail/p5-Mail-Milter-Authentication/files/patch-MANIFEST b/mail/p5-Mail-Milter-Authentication/files/patch-MANIFEST new file mode 100644 index 000000000000..132031ca1f64 --- /dev/null +++ b/mail/p5-Mail-Milter-Authentication/files/patch-MANIFEST @@ -0,0 +1,10 @@ +--- MANIFEST.orig 2024-10-11 04:07:26 UTC ++++ MANIFEST +@@ -96,7 +96,6 @@ lib/Mail/Milter/Authentication/htdocs/css/skeleton.css + lib/Mail/Milter/Authentication/htdocs/css/authmilter.css + lib/Mail/Milter/Authentication/htdocs/css/normalize.css + lib/Mail/Milter/Authentication/htdocs/css/skeleton.css +-share/authentication_milter.init + share/authentication_milter.json + share/mail-dmarc.ini + t/00-load.t diff --git a/mail/p5-Mail-Milter-Authentication/files/patch-bin_authentication__milter b/mail/p5-Mail-Milter-Authentication/files/patch-bin_authentication__milter index 2d9ef925cdcf..6f6e6b3fdd3c 100644 --- a/mail/p5-Mail-Milter-Authentication/files/patch-bin_authentication__milter +++ b/mail/p5-Mail-Milter-Authentication/files/patch-bin_authentication__milter @@ -1,85 +1,67 @@ ---- bin/authentication_milter.orig 2024-02-05 02:41:57 UTC +--- bin/authentication_milter.orig 2024-10-11 04:07:26 UTC +++ bin/authentication_milter @@ -15,7 +15,7 @@ use Mail::Milter::Authentication::Protocol::SMTP; use Mail::Milter::Authentication::Protocol::SMTP; # CONFIG -my $pid_file = '/run/authentication_milter.pid'; +my $pid_file = '%%RUNDIR%%/authentication_milter.pid'; my $daemon = 0; my $help = 0; my $prefix; -@@ -195,11 +195,11 @@ version 3.20240205 +@@ -195,11 +195,11 @@ version 3.20241011 =item --pidfile Write the process PID to the given file. - defaults to /run/authentication_milter.pid + defaults to %%RUNDIR%%/authentication_milter.pid =item --prefix - Read configuration from dir rather than /etc/ + Read configuration from dir rather than %%ETCDIR%% =item -i|--ident -@@ -212,7 +212,7 @@ version 3.20240205 +@@ -212,7 +212,7 @@ version 3.20241011 =head1 CONFIGURATION - The milter reads configuration from /etc/authentication_milter.json + The milter reads configuration from %%ETCDIR%%/authentication_milter.json The configuration file format is as follows... -@@ -266,10 +266,10 @@ version 3.20240205 +@@ -266,10 +266,10 @@ version 3.20241011 "metric_tempfile" : "/tmpfs/authmilter_metrics", | Path to shared metrics data, defaults to /metrics "metric_basic_http" : 1, | Disable extended http services such as config and grafana json pages - "cache_dir" : "/var/cache/auth_milter", | Path to the shared cache directory - "spool_dir" : "/var/spool/auth_milter", | Path to the shared spool directory - "lib_dir" : "/var/lib/auth_milter", | Path to the shared lib directory - "lock_file" : "/var/run/authmilter.lock", | Optionally specify the location of the Net::Server lock file + "cache_dir" : "%%CACHEDIR%%", | Path to the shared cache directory + "spool_dir" : "%%SPOOLDIR%%", | Path to the shared spool directory + "lib_dir" : "%%VARLIBDIR%%", | Path to the shared lib directory + "lock_file" : "%%RUNDIR%%/authmilter.lock", | Optionally specify the location of the Net::Server lock file # metric_port and metric_host are deprecated. # please use metric_connection instead -@@ -289,7 +289,7 @@ version 3.20240205 +@@ -289,7 +289,7 @@ version 3.20241011 "sock_type" : "inet", | Socket type (inet or unix) "sock_host" : "localhost", | Host to connect to (when inet) "sock_port" : "2525", | Port to connect to (when inet) - "sock_path" : "/var/run/smtp.sock", | Socket path to connect to (when unix) + "sock_path" : "%%RUNDIR%%/smtp.sock", | Socket path to connect to (when unix) "timeout_in" : "10", | Timeout when waiting for inbound SMTP data "timeout_out" : "10", | Timeout when waiting for outbound SMTP data "pipeline_limit" : "50", | Limit the number of transactions accepted in an SMTP pipeline -@@ -315,7 +315,7 @@ version 3.20240205 +@@ -315,7 +315,7 @@ version 3.20241011 "unix:/var/sock/a.sock" : { "server_name" : "util.example.com", "sock_type" : "unix", - "sock_path" : "/var/run/smtp.sock", + "sock_path" : "%%RUNDIR%%/smtp.sock", "timeout_in" : "10", "timeout_out" : "10" } -@@ -408,7 +408,7 @@ version 3.20240205 - }, - "!InactiveModule" : {}, - | Additionally, config for a module can be placed in a file -- | with filename /etc/authentication_milter.d/ModuleName.json -+ | with filename %%ETCDIR%%/authentication_milter.d/ModuleName.json - | the contents of which should be the JSON assigned to the - | entry here. - -@@ -421,7 +421,7 @@ This milter uses Mail::DMARC as a backend for DMARC ch - - This milter uses Mail::DMARC as a backend for DMARC checks, this module requires that a configuration file is setup. - --You should create and populate /etc/mail-dmarc.ini -+You should create and populate %%ETCDIR%%/mail-dmarc.ini - - For DMARC reporting you are also required to setup a datastore, including creating a basic table structure. - The detauls of this are to be found in the Mail::DMARC documentation. diff --git a/mail/p5-Mail-Milter-Authentication/files/patch-lib_Mail_Milter_Authentication.pm b/mail/p5-Mail-Milter-Authentication/files/patch-lib_Mail_Milter_Authentication.pm deleted file mode 100644 index 7908a75deddf..000000000000 --- a/mail/p5-Mail-Milter-Authentication/files/patch-lib_Mail_Milter_Authentication.pm +++ /dev/null @@ -1,18 +0,0 @@ ---- lib/Mail/Milter/Authentication.pm.orig 2024-02-05 02:41:57 UTC -+++ lib/Mail/Milter/Authentication.pm -@@ -32,11 +32,14 @@ use vars qw(@ISA); - my $MYARGS = { - 'ident' => $Mail::Milter::Authentication::Config::IDENT, - 'to_stderr' => 0, # handled elsewhere -+ 'to_stdout' => 0, # handled elsewhere - 'log_pid' => 1, - 'facility' => LOG_MAIL, - }; - if ( exists $config->{ 'log_dispatchouli' } ) { -- $MYARGS = $config->{ 'log_dispatchouli' }; -+ foreach my $k (keys %{$config->{ 'log_dispatchouli' }}) { -+ $MYARGS->{$k} = $config->{ 'log_dispatchouli' }->{$k}; -+ } - } - - $LOGGER = Log::Dispatchouli->new( $MYARGS ); diff --git a/mail/p5-Mail-Milter-Authentication/files/patch-lib_Mail_Milter_Authentication_Config.pm b/mail/p5-Mail-Milter-Authentication/files/patch-lib_Mail_Milter_Authentication_Config.pm index c2ac6dfd0d26..3de07a7988f7 100644 --- a/mail/p5-Mail-Milter-Authentication/files/patch-lib_Mail_Milter_Authentication_Config.pm +++ b/mail/p5-Mail-Milter-Authentication/files/patch-lib_Mail_Milter_Authentication_Config.pm @@ -1,71 +1,72 @@ ---- lib/Mail/Milter/Authentication/Config.pm.orig 2024-02-05 02:41:57 UTC +--- lib/Mail/Milter/Authentication/Config.pm.orig 2024-10-11 04:07:26 UTC +++ lib/Mail/Milter/Authentication/Config.pm @@ -21,7 +21,7 @@ our @EXPORT_OK = qw{ }; -our $PREFIX = '/etc'; +our $PREFIX = '%%ETCDIR%%'; our $IDENT = 'authentication_milter'; my $CONFIG; @@ -31,19 +31,19 @@ sub default_config { 'debug' => 0, 'dryrun' => 0, 'logtoerr' => 0, - 'error_log' => '/var/log/authentication_milter.err', -+ "log_dispatchouli" => {}, ++ 'log_dispatchouli' => {}, 'extended_log' => 1, 'legacy_log' => 0, - 'connection' => 'inet:12345@localhost', - 'umask' => '0000', - 'runas' => 'nobody', - 'rungroup' => 'nogroup', +- 'listen_backlog' => 20, + 'connection' => 'unix:%%RUNDIR%%/auth_milter.sock', + 'umask' => '0077', + 'runas' => '%%DEFAULT_USER%%', + 'rungroup' => '%%DEFAULT_GROUP%%', - 'listen_backlog' => 20, ++ 'listen_backlog' => 200, 'check_for_dequeue' => 60, - 'min_children' => 20, - 'max_children' => 200, - 'min_spare_children' => 10, - 'max_spare_children' => 20, + 'min_children' => 1, + 'max_children' => 2, + 'min_spare_children' => 1, + 'max_spare_children' => 1, 'max_requests_per_child' => 200, 'protocol' => 'milter', 'connect_timeout' => 30, -@@ -61,9 +61,9 @@ sub default_config { +@@ -62,9 +62,9 @@ sub default_config { 'ip_map' => {}, 'authserv_id' => '', 'handlers' => {}, - 'cache_dir' => '/var/cache/authentication_milter', - 'spool_dir' => '/var/spool/authentication_milter', - 'lib_dir' => '/var/lib/authentication_milter', + 'cache_dir' => '%%CACHEDIR%%', + 'spool_dir' => '%%SPOOLDIR%%', + 'lib_dir' => '%%VARLIBDIR%%', 'lock_file' => '', }; -@@ -104,7 +104,7 @@ sub setup_config { +@@ -105,7 +105,7 @@ sub setup_config { else { - if ( $EUID == 0 ) { - # We are root, create in global space + if ( $EUID == 0 && -d "/var/$type" && -w "/var/$type" ) { + # We are root, create in global space if it exists and is writable - $dir = '/var/'.$type.'/authentication_milter'; + $dir = '/var/'.$type.'/auth_milter'; mkdir $dir if ! -e $dir; # Create the subdir for this IDENT $dir .= '/'.$safe_ident; -@@ -119,7 +119,7 @@ sub setup_config { +@@ -120,7 +120,7 @@ sub setup_config { else { - # We are a user! Create something in a temporary space + # We are a user, or have no writable global space, Create something in a temporary space $dir = join( '_', - '/tmp/authentication_milter', + '/tmp/auth_milter', $type, $EUID, $safe_ident, diff --git a/mail/p5-Mail-Milter-Authentication/files/patch-lib_Mail_Milter_Authentication_Handler_DMARC.pm b/mail/p5-Mail-Milter-Authentication/files/patch-lib_Mail_Milter_Authentication_Handler_DMARC.pm index 4f336401d318..9110c1d4a6d8 100644 --- a/mail/p5-Mail-Milter-Authentication/files/patch-lib_Mail_Milter_Authentication_Handler_DMARC.pm +++ b/mail/p5-Mail-Milter-Authentication/files/patch-lib_Mail_Milter_Authentication_Handler_DMARC.pm @@ -1,11 +1,11 @@ ---- lib/Mail/Milter/Authentication/Handler/DMARC.pm.orig 2024-02-05 02:41:57 UTC +--- lib/Mail/Milter/Authentication/Handler/DMARC.pm.orig 2024-10-11 04:07:26 UTC +++ lib/Mail/Milter/Authentication/Handler/DMARC.pm -@@ -26,7 +26,7 @@ sub default_config { - 'report_suppression_list' => 'rbl.example.com', +@@ -27,7 +27,7 @@ sub default_config { + 'report_suppression_email_list' => 'rbl.example.com', 'no_report' => 0, 'hide_report_to' => 0, - 'config_file' => '/etc/mail-dmarc.ini', + 'config_file' => '%%ETCDIR%%/mail-dmarc.ini', 'no_reject_disposition' => 'quarantine', 'no_list_reject_disposition' => 'none', 'reject_on_multifrom' => 30, diff --git a/mail/p5-Mail-Milter-Authentication/files/patch-share_authentication__milter.json b/mail/p5-Mail-Milter-Authentication/files/patch-share_authentication__milter.json index 1547a396af4f..c0130115633f 100644 --- a/mail/p5-Mail-Milter-Authentication/files/patch-share_authentication__milter.json +++ b/mail/p5-Mail-Milter-Authentication/files/patch-share_authentication__milter.json @@ -1,76 +1,66 @@ ---- share/authentication_milter.json.orig 2024-02-05 02:41:57 UTC +--- share/authentication_milter.json.orig 2024-10-11 04:07:26 UTC +++ share/authentication_milter.json @@ -2,19 +2,19 @@ "debug" : 0, "dryrun" : 0, "logtoerr" : 0, - "error_log" : "/var/log/authentication_milter.err", + "log_dispatchouli" : {}, - "connection" : "inet:12345@localhost", - "umask" : "0000", - "runas" : "nobody", - "rungroup" : "nogroup", + "connection" : "unix:%%RUNDIR%%/auth_milter.sock", + "umask" : "0077", + "runas" : "%%DEFAULT_USER%%", + "rungroup" : "%%DEFAULT_GROUP%%", "chroot" : "", - "listen_backlog" : 20, +- "listen_backlog" : 20, - "min_children" : 20, - "max_children" : 200, - "min_spare_children" : 10, - "max_spare_children" : 20, ++ "listen_backlog" : 200, + "min_children" : 1, + "max_children" : 2, + "min_spare_children" : 1, + "max_spare_children" : 1, "max_requests_per_child" : 200, "connect_timeout" : 30, -@@ -31,21 +31,32 @@ +@@ -32,19 +32,30 @@ "handlers" : { "SPF" : { - "hide_none" : 0 + "hide_none" : 0, + "hide_received-spf_header": 1 }, "DKIM" : { "hide_none" : 0, - "check_adsp" : 1, + "check_adsp" : 0, + "hide_domainkeys" : 1, "show_default_adsp" : 0, - "adsp_hide_none" : 0 + "adsp_hide_none" : 1 }, "DMARC" : { "hide_none" : 0, + "hard_reject" : 0, + "no_reject_disposition" : "quarantine", + "use_arc" : 1, + "no_report" : 1, + "config_file": "%%ETCDIR%%/mail-dmarc.ini", "detect_list_id" : "1" - }, - -+ "ARC" : { -+ "hide_none" : 0 + }, + - "PTR" : {}, - - "SenderID" : { -@@ -63,7 +74,7 @@ - "100.200.100.2", - "2001:44c2:3881:aa00::/56", - "2001:44b8:3021:123:dead:beef:abcd:1234" -- ], -+ ] ++ "ARC" : { ++ "hide_none" : 0 }, - "!AddID" : {}, + "PTR" : {}, diff --git a/mail/p5-Mail-Milter-Authentication/files/patch-t_04-unit-handler-dmarc.t b/mail/p5-Mail-Milter-Authentication/files/patch-t_04-unit-handler-dmarc.t new file mode 100644 index 000000000000..66a30f9c2a10 --- /dev/null +++ b/mail/p5-Mail-Milter-Authentication/files/patch-t_04-unit-handler-dmarc.t @@ -0,0 +1,11 @@ +--- t/04-unit-handler-dmarc.t.orig 2024-10-11 04:07:26 UTC ++++ t/04-unit-handler-dmarc.t +@@ -102,7 +102,7 @@ subtest 'config' => sub { + 'report_skip_to' => [ 'my_report_from_address@example.com' ], + 'no_report' => 0, + 'hide_report_to' => 0, +- 'config_file' => '/etc/mail-dmarc.ini', ++ 'config_file' => '%%ETCDIR%%/mail-dmarc.ini', + 'no_reject_disposition' => 'quarantine', + 'no_list_reject_disposition' => 'none', + 'reject_on_multifrom' => 30,