Received: by mail.netbsd.org (Postfix, from userid 605) id 7EA3384FC9; Wed, 10 Jan 2024 11:51:48 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by mail.netbsd.org (Postfix) with ESMTP id AC96D84FC7 for ; Wed, 10 Jan 2024 11:51:47 +0000 (UTC) X-Virus-Scanned: amavisd-new at netbsd.org Received: from mail.netbsd.org ([127.0.0.1]) by localhost (mail.netbsd.org [127.0.0.1]) (amavisd-new, port 10025) with ESMTP id TsqRBXk7Gsnc for ; Wed, 10 Jan 2024 11:51:46 +0000 (UTC) Received: from cvs.NetBSD.org (ivanova.NetBSD.org [IPv6:2001:470:a085:999:28c:faff:fe03:5984]) by mail.netbsd.org (Postfix) with ESMTP id 8226D84CD7 for ; Wed, 10 Jan 2024 11:51:46 +0000 (UTC) Received: by cvs.NetBSD.org (Postfix, from userid 500) id 7908BFA42; Wed, 10 Jan 2024 11:51:46 +0000 (UTC) Content-Transfer-Encoding: 7bit Content-Type: multipart/mixed; boundary="_----------=_1704887506232660" MIME-Version: 1.0 Date: Wed, 10 Jan 2024 11:51:46 +0000 From: "Amitai Schleier" Subject: CVS commit: pkgsrc/mail/p5-Qmail-Deliverable To: pkgsrc-changes@NetBSD.org Reply-To: schmonz@netbsd.org X-Mailer: log_accum Message-Id: <20240110115146.7908BFA42@cvs.NetBSD.org> Sender: pkgsrc-changes-owner@NetBSD.org List-Id: Precedence: bulk List-Unsubscribe: This is a multi-part message in MIME format. --_----------=_1704887506232660 Content-Disposition: inline Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset="US-ASCII" Module Name: pkgsrc Committed By: schmonz Date: Wed Jan 10 11:51:46 UTC 2024 Added Files: pkgsrc/mail/p5-Qmail-Deliverable: DESCR Makefile distinfo pkgsrc/mail/p5-Qmail-Deliverable/patches: patch-lib_Qmail_Deliverable.pm patch-lib_Qmail_Deliverable_Comparison.pod patch-qpsmtpd-plugin_qmail__deliverable Log Message: Add p5-Qmail-Deliverable: Deliverability check daemon for qmail qmail-smtpd does not know if a user exists. Lots of resources are wasted by scanning mail for spam and viruses for addresses that do not exist anyway. A replacement smtpd written in Perl could use this module to quickly verify that a local email address is (probably) actually in use. This module comes with a daemon program called qmail-deliverabled and a module called Qmail::Deliverable::Client that copies the entire public interface, but queries the daemon. Typically, the daemon runs as the root user, and the client is used by the unprivileged smtpd. To generate a diff of this commit: cvs rdiff -u -r0 -r1.1 pkgsrc/mail/p5-Qmail-Deliverable/DESCR \ pkgsrc/mail/p5-Qmail-Deliverable/Makefile \ pkgsrc/mail/p5-Qmail-Deliverable/distinfo cvs rdiff -u -r0 -r1.1 \ pkgsrc/mail/p5-Qmail-Deliverable/patches/patch-lib_Qmail_Deliverable.pm \ pkgsrc/mail/p5-Qmail-Deliverable/patches/patch-lib_Qmail_Deliverable_Comparison.pod \ pkgsrc/mail/p5-Qmail-Deliverable/patches/patch-qpsmtpd-plugin_qmail__deliverable Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. --_----------=_1704887506232660 Content-Disposition: inline Content-Length: 8986 Content-Transfer-Encoding: binary Content-Type: text/x-diff; charset=us-ascii Added files: Index: pkgsrc/mail/p5-Qmail-Deliverable/DESCR diff -u /dev/null pkgsrc/mail/p5-Qmail-Deliverable/DESCR:1.1 --- /dev/null Wed Jan 10 11:51:46 2024 +++ pkgsrc/mail/p5-Qmail-Deliverable/DESCR Wed Jan 10 11:51:45 2024 @@ -0,0 +1,10 @@ +qmail-smtpd does not know if a user exists. Lots of resources are wasted by +scanning mail for spam and viruses for addresses that do not exist anyway. + +A replacement smtpd written in Perl could use this module to quickly verify +that a local email address is (probably) actually in use. + +This module comes with a daemon program called qmail-deliverabled and a module +called Qmail::Deliverable::Client that copies the entire public interface, but +queries the daemon. Typically, the daemon runs as the root user, and the client +is used by the unprivileged smtpd. Index: pkgsrc/mail/p5-Qmail-Deliverable/Makefile diff -u /dev/null pkgsrc/mail/p5-Qmail-Deliverable/Makefile:1.1 --- /dev/null Wed Jan 10 11:51:46 2024 +++ pkgsrc/mail/p5-Qmail-Deliverable/Makefile Wed Jan 10 11:51:45 2024 @@ -0,0 +1,28 @@ +# $NetBSD: Makefile,v 1.1 2024/01/10 11:51:45 schmonz Exp $ + +DISTNAME= Qmail-Deliverable-1.07 +PKGNAME= p5-${DISTNAME} +CATEGORIES= mail +MASTER_SITES= ${MASTER_SITE_PERL_CPAN:=../../authors/id/J/JU/JUERD/} + +MAINTAINER= schmonz@NetBSD.org +HOMEPAGE= https://metacpan.org/pod/Qmail::Deliverable +COMMENT= Deliverability check daemon for qmail +LICENSE= public-domain + +PERL5_PACKLIST= auto/Qmail/Deliverable/.packlist + +SUBST_CLASSES+= varqmail +SUBST_STAGE.varqmail= pre-configure +SUBST_FILES.varqmail= qpsmtpd-plugin/qmail_deliverable +SUBST_FILES.varqmail+= lib/Qmail/Deliverable.pm +SUBST_FILES.varqmail+= lib/Qmail/Deliverable/Comparison.pod +SUBST_VARS.varqmail= QMAILDIR + +BUILD_DEFS+= QMAILDIR + +pre-configure: + ${FIND} ${WRKSRC} -type f -name '*.orig' | ${XARGS} ${RM} -f + +.include "../../lang/perl5/module.mk" +.include "../../mk/bsd.pkg.mk" Index: pkgsrc/mail/p5-Qmail-Deliverable/distinfo diff -u /dev/null pkgsrc/mail/p5-Qmail-Deliverable/distinfo:1.1 --- /dev/null Wed Jan 10 11:51:46 2024 +++ pkgsrc/mail/p5-Qmail-Deliverable/distinfo Wed Jan 10 11:51:46 2024 @@ -0,0 +1,8 @@ +$NetBSD: distinfo,v 1.1 2024/01/10 11:51:46 schmonz Exp $ + +BLAKE2s (Qmail-Deliverable-1.07.tar.gz) = dc52999755f2e6c64b1b4254336bf901841b5890d83f3f448fbd5e724273e90c +SHA512 (Qmail-Deliverable-1.07.tar.gz) = c5a1eae47e29e6a5578cf17cb56bc013bd4df3a68f3b806a821d1b4364961491e0ba9bf784ae41f0d580e7114881f63f4027404feff796bf9a8ff6ffcab1acb4 +Size (Qmail-Deliverable-1.07.tar.gz) = 17814 bytes +SHA1 (patch-lib_Qmail_Deliverable.pm) = e2172dc43a2a4e769ceb28628395469026eff8b8 +SHA1 (patch-lib_Qmail_Deliverable_Comparison.pod) = 0fdd7a6dd3275d7f03068a178ed6ad7c35f804b5 +SHA1 (patch-qpsmtpd-plugin_qmail__deliverable) = 2339f73db04380b2c8bc23fe34790fcea4e60ff9 Index: pkgsrc/mail/p5-Qmail-Deliverable/patches/patch-lib_Qmail_Deliverable.pm diff -u /dev/null pkgsrc/mail/p5-Qmail-Deliverable/patches/patch-lib_Qmail_Deliverable.pm:1.1 --- /dev/null Wed Jan 10 11:51:46 2024 +++ pkgsrc/mail/p5-Qmail-Deliverable/patches/patch-lib_Qmail_Deliverable.pm Wed Jan 10 11:51:46 2024 @@ -0,0 +1,82 @@ +$NetBSD: patch-lib_Qmail_Deliverable.pm,v 1.1 2024/01/10 11:51:46 schmonz Exp $ + +Honor pkgsrc-specified QMAILDIR. + +--- lib/Qmail/Deliverable.pm.orig 2024-01-10 11:42:48.671762270 +0000 ++++ lib/Qmail/Deliverable.pm +@@ -66,21 +66,21 @@ sub reread_config { + %virtualdomains = (); + %users_exact = (); + %users_wild = (); +- my $locals_fn = -e "/var/qmail/control/locals" +- ? "/var/qmail/control/locals" +- : "/var/qmail/control/me"; ++ my $locals_fn = -e "@QMAILDIR@/control/locals" ++ ? "@QMAILDIR@/control/locals" ++ : "@QMAILDIR@/control/me"; + for (_slurp $locals_fn) { + chomp; + ($_) = lc =~ /$ascii/ or do { warn "Invalid character"; next; }; + $locals{$_} = 1; + } +- for (_slurp "/var/qmail/control/virtualdomains") { ++ for (_slurp "@QMAILDIR@/control/virtualdomains") { + chomp; + ($_) = lc =~ /$ascii/ or do { warn "Invalid character"; next; }; + my ($domain, $prepend) = split /:/, $_, 2; + $virtualdomains{$domain} = $prepend; + } +- for (_slurp "/var/qmail/users/assign") { ++ for (_slurp "@QMAILDIR@/users/assign") { + chomp; + ($_) = /$ascii/ or do { warn "Invalid character"; next; }; + if (s/^=([^:]+)://) { +@@ -98,7 +98,7 @@ sub reread_config { + sub _qmail_getpw { + my ($local) = @_; + local $/ = "\0"; +- my @a = _readpipe "/var/qmail/bin/qmail-getpw", $local; ++ my @a = _readpipe "@QMAILDIR@/bin/qmail-getpw", $local; + chomp @a; + for (@a) { + ($_) = /$ascii/ or do { warn "Invalid character"; return ""; } +@@ -361,16 +361,16 @@ returned. A single dot at the end is all + Returns the local qmail user for $address, or undef if the address is not local. + + Returns $address if it does not contain an @. Returns the left side of the @ if +-the right side is listed in /var/qmail/control/locals. Returns the left side of ++the right side is listed in @QMAILDIR@/control/locals. Returns the left side of + the @, prepended with the right prepend string, if the right side is listed in +-/var/qmail/control/virtualdomains. ++@QMAILDIR@/control/virtualdomains. + + =item qmail_user $address + + =item qmail_user $local + + Returns a list of $user, $uid, $gid, $homedir, $dash, $ext according to +-/var/qmail/users/assign or qmail-getpw. ++@QMAILDIR@/users/assign or qmail-getpw. + + =item dot_qmail $address + +@@ -434,8 +434,8 @@ returned. + + =item reread_config + +-Re-reads the config files /var/qmail/control/locals, +-/var/qmail/control/virtualdomains, and /var/qmail/users/assign. ++Re-reads the config files @QMAILDIR@/control/locals, ++@QMAILDIR@/control/virtualdomains, and @QMAILDIR@/users/assign. + + =back + +@@ -473,7 +473,7 @@ checks per second for assigned/virtual u + slower. For my needs, this is still plenty fast enough. + + To support local users automatically, C is executed for local +-addresses that are not matched by /var/qmail/users/assign. If you need it ++addresses that are not matched by @QMAILDIR@/users/assign. If you need it + faster, you can use C to build a users/assign file. + + To support vpopmail's vdelivermail instruction, C is executed for Index: pkgsrc/mail/p5-Qmail-Deliverable/patches/patch-lib_Qmail_Deliverable_Comparison.pod diff -u /dev/null pkgsrc/mail/p5-Qmail-Deliverable/patches/patch-lib_Qmail_Deliverable_Comparison.pod:1.1 --- /dev/null Wed Jan 10 11:51:46 2024 +++ pkgsrc/mail/p5-Qmail-Deliverable/patches/patch-lib_Qmail_Deliverable_Comparison.pod Wed Jan 10 11:51:46 2024 @@ -0,0 +1,15 @@ +$NetBSD: patch-lib_Qmail_Deliverable_Comparison.pod,v 1.1 2024/01/10 11:51:46 schmonz Exp $ + +Honor pkgsrc-specified QMAILDIR. + +--- lib/Qmail/Deliverable/Comparison.pod.orig 2024-01-10 11:42:48.674383628 +0000 ++++ lib/Qmail/Deliverable/Comparison.pod +@@ -190,7 +190,7 @@ http://www.maiers.de/qmail/art38,71.html + Written in sh, checks against a directory tree and dot-qmail. + + This is like vpopmail_check_recipient, but for local users only. It does not +-actually query /var/qmail/users/assign or getpw for home directories, but ++actually query @QMAILDIR@/users/assign or getpw for home directories, but + requires /home/username, where username is directly taken from the email + address. Probably needs to be suid root to function correctly. + Index: pkgsrc/mail/p5-Qmail-Deliverable/patches/patch-qpsmtpd-plugin_qmail__deliverable diff -u /dev/null pkgsrc/mail/p5-Qmail-Deliverable/patches/patch-qpsmtpd-plugin_qmail__deliverable:1.1 --- /dev/null Wed Jan 10 11:51:46 2024 +++ pkgsrc/mail/p5-Qmail-Deliverable/patches/patch-qpsmtpd-plugin_qmail__deliverable Wed Jan 10 11:51:46 2024 @@ -0,0 +1,24 @@ +$NetBSD: patch-qpsmtpd-plugin_qmail__deliverable,v 1.1 2024/01/10 11:51:46 schmonz Exp $ + +Honor pkgsrc-specified QMAILDIR. + +--- qpsmtpd-plugin/qmail_deliverable.orig 2024-01-10 11:42:48.669202870 +0000 ++++ qpsmtpd-plugin/qmail_deliverable +@@ -27,7 +27,7 @@ none is specified, the default (127.0.0. + =item server smtproutes:host:port + + If the specification is prepended by the literal text C, then for +-recipient domains listed in your /var/qmail/control/smtproutes use their ++recipient domains listed in your @QMAILDIR@/control/smtproutes use their + respective hosts for the check. For other domains, the given host is used. The + port has to be the same across all servers. + +@@ -134,7 +134,7 @@ sub register { + + my ($fallback, $port) = $args{server} =~ /:(?:(.*?):?)(\d+)/; + +- open my $fh, "/var/qmail/control/smtproutes" ++ open my $fh, "@QMAILDIR@/control/smtproutes" + or warn "Could not read smtproutes"; + for (readline $fh) { + my ($domain, $mx) = /^(.*?) : \[? ( [^\]:\s]* )/x; --_----------=_1704887506232660--