head 1.5; access; symbols pkgsrc-2019Q4:1.3.0.26 pkgsrc-2019Q4-base:1.3 pkgsrc-2019Q3:1.3.0.22 pkgsrc-2019Q3-base:1.3 pkgsrc-2019Q2:1.3.0.20 pkgsrc-2019Q2-base:1.3 pkgsrc-2019Q1:1.3.0.18 pkgsrc-2019Q1-base:1.3 pkgsrc-2018Q4:1.3.0.16 pkgsrc-2018Q4-base:1.3 pkgsrc-2018Q3:1.3.0.14 pkgsrc-2018Q3-base:1.3 pkgsrc-2018Q2:1.3.0.12 pkgsrc-2018Q2-base:1.3 pkgsrc-2018Q1:1.3.0.10 pkgsrc-2018Q1-base:1.3 pkgsrc-2017Q4:1.3.0.8 pkgsrc-2017Q4-base:1.3 pkgsrc-2017Q3:1.3.0.6 pkgsrc-2017Q3-base:1.3 pkgsrc-2017Q2:1.3.0.2 pkgsrc-2017Q2-base:1.3 pkgsrc-2017Q1:1.2.0.24 pkgsrc-2017Q1-base:1.2 pkgsrc-2016Q4:1.2.0.22 pkgsrc-2016Q4-base:1.2 pkgsrc-2016Q3:1.2.0.20 pkgsrc-2016Q3-base:1.2 pkgsrc-2016Q2:1.2.0.18 pkgsrc-2016Q2-base:1.2 pkgsrc-2016Q1:1.2.0.16 pkgsrc-2016Q1-base:1.2 pkgsrc-2015Q4:1.2.0.14 pkgsrc-2015Q4-base:1.2 pkgsrc-2015Q3:1.2.0.12 pkgsrc-2015Q3-base:1.2 pkgsrc-2015Q2:1.2.0.10 pkgsrc-2015Q2-base:1.2 pkgsrc-2015Q1:1.2.0.8 pkgsrc-2015Q1-base:1.2 pkgsrc-2014Q4:1.2.0.6 pkgsrc-2014Q4-base:1.2 pkgsrc-2014Q3:1.2.0.4 pkgsrc-2014Q3-base:1.2 pkgsrc-2014Q2:1.2.0.2 pkgsrc-2014Q2-base:1.2 pkgsrc-2014Q1:1.1.1.1.0.62 pkgsrc-2014Q1-base:1.1.1.1 pkgsrc-2013Q4:1.1.1.1.0.60 pkgsrc-2013Q4-base:1.1.1.1 pkgsrc-2013Q3:1.1.1.1.0.58 pkgsrc-2013Q3-base:1.1.1.1 pkgsrc-2013Q2:1.1.1.1.0.56 pkgsrc-2013Q2-base:1.1.1.1 pkgsrc-2013Q1:1.1.1.1.0.54 pkgsrc-2013Q1-base:1.1.1.1 pkgsrc-2012Q4:1.1.1.1.0.52 pkgsrc-2012Q4-base:1.1.1.1 pkgsrc-2012Q3:1.1.1.1.0.50 pkgsrc-2012Q3-base:1.1.1.1 pkgsrc-2012Q2:1.1.1.1.0.48 pkgsrc-2012Q2-base:1.1.1.1 pkgsrc-2012Q1:1.1.1.1.0.46 pkgsrc-2012Q1-base:1.1.1.1 pkgsrc-2011Q4:1.1.1.1.0.44 pkgsrc-2011Q4-base:1.1.1.1 pkgsrc-2011Q3:1.1.1.1.0.42 pkgsrc-2011Q3-base:1.1.1.1 pkgsrc-2011Q2:1.1.1.1.0.40 pkgsrc-2011Q2-base:1.1.1.1 pkgsrc-2011Q1:1.1.1.1.0.38 pkgsrc-2011Q1-base:1.1.1.1 pkgsrc-2010Q4:1.1.1.1.0.36 pkgsrc-2010Q4-base:1.1.1.1 pkgsrc-2010Q3:1.1.1.1.0.34 pkgsrc-2010Q3-base:1.1.1.1 pkgsrc-2010Q2:1.1.1.1.0.32 pkgsrc-2010Q2-base:1.1.1.1 pkgsrc-2010Q1:1.1.1.1.0.30 pkgsrc-2010Q1-base:1.1.1.1 pkgsrc-2009Q4:1.1.1.1.0.28 pkgsrc-2009Q4-base:1.1.1.1 pkgsrc-2009Q3:1.1.1.1.0.26 pkgsrc-2009Q3-base:1.1.1.1 pkgsrc-2009Q2:1.1.1.1.0.24 pkgsrc-2009Q2-base:1.1.1.1 pkgsrc-2009Q1:1.1.1.1.0.22 pkgsrc-2009Q1-base:1.1.1.1 pkgsrc-2008Q4:1.1.1.1.0.20 pkgsrc-2008Q4-base:1.1.1.1 pkgsrc-2008Q3:1.1.1.1.0.18 pkgsrc-2008Q3-base:1.1.1.1 cube-native-xorg:1.1.1.1.0.16 cube-native-xorg-base:1.1.1.1 pkgsrc-2008Q2:1.1.1.1.0.14 pkgsrc-2008Q2-base:1.1.1.1 cwrapper:1.1.1.1.0.12 pkgsrc-2008Q1:1.1.1.1.0.10 pkgsrc-2008Q1-base:1.1.1.1 pkgsrc-2007Q4:1.1.1.1.0.8 pkgsrc-2007Q4-base:1.1.1.1 pkgsrc-2007Q3:1.1.1.1.0.6 pkgsrc-2007Q3-base:1.1.1.1 pkgsrc-2007Q2:1.1.1.1.0.4 pkgsrc-2007Q2-base:1.1.1.1 pkgsrc-2007Q1:1.1.1.1.0.2 pkgsrc-2007Q1-base:1.1.1.1 pkgsrc-base:1.1.1.1 TNF:1.1.1; locks; strict; comment @# @; 1.5 date 2020.01.23.16.45.48; author schmonz; state dead; branches; next 1.4; commitid f0ZHJzyVkOiOQPTB; 1.4 date 2020.01.23.15.55.05; author schmonz; state Exp; branches; next 1.3; commitid WKji0prTsY1tzPTB; 1.3 date 2017.04.04.08.27.56; author schmonz; state Exp; branches; next 1.2; commitid cNyvFtwP0iqN0cMz; 1.2 date 2014.06.02.14.09.20; author schmonz; state Exp; branches; next 1.1; commitid 2UH7jNigzdTyeXCx; 1.1 date 2007.01.18.06.35.24; author schmonz; state Exp; branches 1.1.1.1; next ; 1.1.1.1 date 2007.01.18.06.35.24; author schmonz; state Exp; branches; next ; desc @@ 1.5 log @Modernize patch filename. @ text @$NetBSD: patch-aa,v 1.4 2020/01/23 15:55:05 schmonz Exp $ Use pkgsrc-preferred tools, users, and paths. Avoid 5.28-fatal "Cannot open %s as a filehandle: it is already open as a dirhandle". Fix spelling. --- src/qmqtool.orig 2016-06-11 16:26:52.000000000 +0000 +++ src/qmqtool @@@@ -10,7 +10,7 @@@@ use Getopt::Std; my $qmail = '__QMAILDIR__'; # keep ps/bigtodo dynamic - one nfs homed script can work on any arch -my $ps = ($^O eq 'solaris') ? '/usr/ucb/ps auxww' : 'ps auxww'; +my $ps = '@@PS@@ auxww'; my $bigtodo = ( -d "${qmail}/queue/todo/0" ) ? 1 : 0; # more implemented, little demand. @@@@ -105,10 +105,10 @@@@ if($opt{l}){ } }elsif($opt{B} eq 'r'){ my(%owner,%uid,%gid); - $owner{info} = $owner{local} = $owner{remote} = $owner{bounce} = 'qmails'; - $owner{mess} = $owner{todo} = $owner{intd} = 'qmailq'; + $owner{info} = $owner{local} = $owner{remote} = $owner{bounce} = '@@QMAIL_SEND_USER@@'; + $owner{mess} = $owner{todo} = $owner{intd} = '@@QMAIL_QUEUE_USER@@'; - for my $user (qw/qmailq qmails/){ + for my $user (qw/@@QMAIL_QUEUE_USER@@ @@QMAIL_SEND_USER@@/){ ($uid{$user},$gid{$user}) = (getpwnam($user))[2,3]; } @@@@ -162,6 +162,7 @@@@ if($opt{l}){ } unless($opt{Q}){ print "you must now start qmail-send: for a LWQ installation, run: svc -u /service/qmail-send\n"; + print "for a pkgsrc installation, run: @@RCD_SCRIPTS_DIR@@/qmailsend start\n"; } }else{ syntax(); @@@@ -422,6 +423,7 @@@@ sub check_daemons { next if(/multilog\s+/); # some log to /var/log/qmail/qmail-send/ die "you must stop qmail-send and qmail-smtpd before this program can continue (PID [$1] running).\n", "for a LWQ installation, run: svc -d /service/qmail-send /service/qmail-smtpd\n", + "for a pkgsrc installation, run: @@RCD_SCRIPTS_DIR@@/qmailsend stop; @@RCD_SCRIPTS_DIR@@/qmailsmtpd stop\n", "others may be able to run: kill -9 `$ps | awk '/qmail-send|qmail-smtpd/ { print \$1 }'`\n"; } } @@@@ -652,6 +654,7 @@@@ sub checkqueue { if($opt{r}){ unless($opt{Q}){ print "you must now start qmail-send: for a LWQ installation, run: svc -u /service/qmail-send\n"; + print "for a pkgsrc installation, run: @@RCD_SCRIPTS_DIR@@/qmailsend start\n"; } } } @@@@ -692,6 +695,7 @@@@ sub rm_files { } if($restart){ print "you must now restart qmail-send: for a LWQ installation, run: svc -du /service/qmail-send\n"; + print "for a pkgsrc installation, run: @@RCD_SCRIPTS_DIR@@/qmailsend restart\n"; } } @@@@ -866,9 +870,9 @@@@ sub msgprop { warn "cannot open ${qmail}/queue/intd/${file}: $!\n"; } }else{ - if(open(S, "${qmail}/queue/info/${subdir}/${file}")){ - chop($es=); - close S; + if(open(QQISF, "${qmail}/queue/info/${subdir}/${file}")){ + chop($es=); + close QQISF; substr($es,0,1) = ''; } @@@@ -985,7 +989,7 @@@@ sub find_msgs_bystring { # using find|xargs grep is must faster than regex matching in perl (dunno why) # grep -r isnt portable, dunno if it's safe for huge file lists my $last=0; - open(GREP, "find ${qmail}/queue/mess/ -type f | xargs grep $opts \"$regex\" /dev/null 2>/dev/null |") || die "could not fork find | xargs grep: $!\n"; + open(GREP, "find ${qmail}/queue/mess/ -type f | xargs @@GREP@@ $opts \"$regex\" /dev/null 2>/dev/null |") || die "could not fork find | xargs @@GREP@@ $!\n"; # do not count on grep's exit code, because: # if a message is removed while grepping, exit code is 2 while(){ @@@@ -1013,8 +1017,8 @@@@ sub syntax { -B b Backup queue into ${qmail}/queue.backup/ r Restore backup from ${qmail}/queue.backup/ - -c check queue consitancy - -r repair queue (by deleting fragments) found by checking queue consistancy + -c check queue consistency + -r repair queue (by deleting fragments) found by checking queue consistency -i show how many messages are queued per ip address -nN pay attention to the Nth last smtp-hop -S show how many bytes are queued per ip address @ 1.4 log @Fix "Cannot open %s as a filehandle: it is already open as a dirhandle", deprecated in Perl 5.10 and fatal since 5.28. Bump PKGREVISION. @ text @d1 1 a1 1 $NetBSD: patch-aa,v 1.3 2017/04/04 08:27:56 schmonz Exp $ @ 1.3 log @Update to 1.15. From the changelog: * added a man page in v1.14 * more support for bigtodo (like mediatemple provisions) pkgsrc changes: - Substitute configured qmail users @ text @d1 1 a1 1 $NetBSD: patch-aa,v 1.2 2014/06/02 14:09:20 schmonz Exp $ d3 4 a6 1 Use pkgsrc-preferred tools. d65 13 d87 11 @ 1.2 log @Update to 1.14. From the changelog: * changed english and added Total on qmqtool -s * added more stats with qmqtool -s -V * modified some regexs to be arithmetic instead * changed string finding code: increased speed removed fallback routine use grep -E (egrep) when /pattern/ is used support case insensitive search with /pattern/i * rely on PATH instead of statically searching * improved queue consistency check * -[lRTLx] /displays/ calculated size * added -x feature for extended information on a message * created ./configure ; make ; make install process (even though we're just a light perl script) @ text @d1 1 a1 1 $NetBSD$ d5 1 a5 1 --- src/qmqtool.orig 2009-01-24 04:25:44.000000000 +0000 d10 1 a10 1 # keep ps dynamic - one nfs homed script can work on any arch d13 1 a13 1 my $bigtodo=0; # hardly implemented, no demand. d15 38 a52 24 my %opt; @@@@ -161,6 +161,7 @@@@ if($opt{l}){ } unless($opt{Q}){ print "you must now start qmail-send: for a LWQ installation, run: svc -u /service/qmail-send\n"; + print "for a pkgsrc installation, run: @@RCD_SCRIPTS_DIR@@/qmailsend start\n"; } }else{ syntax(); @@@@ -421,6 +422,7 @@@@ sub check_daemons { next if(/multilog\s+/); # some log to /var/log/qmail/qmail-send/ die "you must stop qmail-send and qmail-smtpd before this program can continue (PID [$1] running).\n", "for a LWQ installation, run: svc -d /service/qmail-send /service/qmail-smtpd\n", + "for a pkgsrc installation, run: @@RCD_SCRIPTS_DIR@@/qmailsend stop; @@RCD_SCRIPTS_DIR@@/qmailsmtpd stop\n", "others may be able to run: kill -9 `$ps | awk '/qmail-send|qmail-smtpd/ { print \$1 }'`\n"; } } @@@@ -651,6 +653,7 @@@@ sub checkqueue { if($opt{r}){ unless($opt{Q}){ print "you must now start qmail-send: for a LWQ installation, run: svc -u /service/qmail-send\n"; + print "for a pkgsrc installation, run: @@RCD_SCRIPTS_DIR@@/qmailsend start\n"; } } d54 6 a59 6 @@@@ -691,6 +694,7 @@@@ sub rm_files { } if($restart){ print "you must now restart qmail-send: for a LWQ installation, run: svc -du /service/qmail-send\n"; + print "for a pkgsrc installation, run: @@RCD_SCRIPTS_DIR@@/qmailsend restart\n"; } d62 9 a70 9 @@@@ -979,7 +983,7 @@@@ sub find_msgs_bystring { my @@msgs; # using find|xargs grep is must faster than regex matching in perl (dunno why) my $last=0; - open(GREP, "find ${qmail}/queue/mess/ -type f | xargs grep $opts \"$regex\" /dev/null 2>/dev/null |") || die "could not fork find | xargs grep: $!\n"; + open(GREP, "find ${qmail}/queue/mess/ -type f | xargs @@GREP@@ $opts \"$regex\" /dev/null 2>/dev/null |") || die "could not fork find | xargs @@GREP@@ $!\n"; # do not count on grep's exit code, because: # if a message is removed while grepping, exit code is 2 while(){ @ 1.1 log @Initial revision @ text @d3 5 a7 5 --- qmqtool.orig 2006-10-07 22:29:46.000000000 -0400 +++ qmqtool @@@@ -10,14 +10,10 @@@@ use strict; use Getopt::Std; my (%tool,%opt); d9 5 a13 11 -my $qmail = '/var/qmail'; -$tool{'ps'} = '/bin/ps'; # full path to ps, or just ps if $PATH is sufficient +my $qmail = '@@QMAILDIR@@'; +$tool{'ps'} = '@@PS@@'; # full path to ps, or just ps if $PATH is sufficient $tool{'ps_arg'} = (`uname -s` =~ /SunOS/) ? '-ef' : 'aux'; # should statically code this -if(-x '/usr/local/bin/grep'){ - $tool{'grep'} = '/usr/local/bin/grep'; # GNU grep is 5 times faster than solaris grep -}elsif(-x '/bin/grep'){ - $tool{'grep'} = '/bin/grep'; -} +$tool{'grep'} = '@@GREP@@'; d15 2 a16 3 # must play with @@ARGV directly because Getopt doesnt have a xx: (-x with or without an arg) my $n = 0; @@@@ -152,6 +148,7 @@@@ if(defined($opt{h})){ d24 6 a29 6 @@@@ -409,6 +406,7 @@@@ sub check_qmailsend { if(/^\s*qmails\s.+\sqmail-send/){ die "you must stop qmail-send before this program can continue\n", "for a LWQ installation, run: svc -d /service/qmail-send\n", + "for a pkgsrc installation, run: @@RCD_SCRIPTS_DIR@@/qmailsend stop\n", "others may be able to run: kill -9 `$tool{'ps'} $tool{'ps_arg'} | awk '/qmails.*qmail-send/ { print \$2 }'`\n"; d32 6 a37 2 @@@@ -586,6 +584,7 @@@@ sub checkqueue { print "no rogue files found\n"; a38 2 print "you must now start qmail-send: for a LWQ installation, run: svc -u /service/qmail-send\n"; + print "for a pkgsrc installation, run: @@RCD_SCRIPTS_DIR@@/qmailsend start\n"; d40 1 a40 3 sub rm_files { @@@@ -624,6 +623,7 @@@@ sub rm_files { d42 1 a42 1 if(defined($restart)){ d48 9 @ 1.1.1.1 log @Initial import of qmqtool, a qmail queue manipulation program geared towards the viewing and safe modification of the contents in a qmail queue. qmqtool was designed with Michele Beltrame's "qmHandle" in mind, however no source code from qmHandle was used within qmqtool. @ text @@