summaryrefslogtreecommitdiff
path: root/gnu/usr.sbin/sendmail/contrib
diff options
context:
space:
mode:
authorTodd C. Miller <millert@cvs.openbsd.org>2001-09-11 19:02:52 +0000
committerTodd C. Miller <millert@cvs.openbsd.org>2001-09-11 19:02:52 +0000
commitb9658e618d8e5a4f53d0291f13222e5e19dd695f (patch)
tree347b055971d930905e6c510a18587adc19a2f124 /gnu/usr.sbin/sendmail/contrib
parent03eaf40ad95c4f4c5613308db2dfe2f64ee709b0 (diff)
merge in sendmail 8.12.0 with BSD Makefiles and mdoc man pages
Diffstat (limited to 'gnu/usr.sbin/sendmail/contrib')
-rw-r--r--gnu/usr.sbin/sendmail/contrib/README2
-rw-r--r--gnu/usr.sbin/sendmail/contrib/buildvirtuser2
-rw-r--r--gnu/usr.sbin/sendmail/contrib/link_hash.sh2
-rw-r--r--gnu/usr.sbin/sendmail/contrib/qtool.819
-rw-r--r--gnu/usr.sbin/sendmail/contrib/qtool.pl67
5 files changed, 72 insertions, 20 deletions
diff --git a/gnu/usr.sbin/sendmail/contrib/README b/gnu/usr.sbin/sendmail/contrib/README
index c211ca1e9ff..67ddc63f803 100644
--- a/gnu/usr.sbin/sendmail/contrib/README
+++ b/gnu/usr.sbin/sendmail/contrib/README
@@ -7,4 +7,4 @@ care -- some of the patches may be out of date with the latest release
of sendmail. Also, the previous comment applies -- patches belong to
the original author, not to us.
-$Revision: 1.3 $, Last updated $Date: 2001/01/15 21:09:00 $
+$Revision: 1.4 $, Last updated $Date: 2001/09/11 19:02:48 $
diff --git a/gnu/usr.sbin/sendmail/contrib/buildvirtuser b/gnu/usr.sbin/sendmail/contrib/buildvirtuser
index 5b3c872e789..da606c69bdf 100644
--- a/gnu/usr.sbin/sendmail/contrib/buildvirtuser
+++ b/gnu/usr.sbin/sendmail/contrib/buildvirtuser
@@ -27,7 +27,7 @@
# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
# SUCH DAMAGE.
-# $Sendmail: buildvirtuser,v 1.1.2.3 2001/02/12 02:57:13 gshapiro Exp $
+# $Sendmail: buildvirtuser,v 1.3 2001/02/12 02:58:20 gshapiro Exp $
=head1 NAME
diff --git a/gnu/usr.sbin/sendmail/contrib/link_hash.sh b/gnu/usr.sbin/sendmail/contrib/link_hash.sh
index d55799fa63d..44924c4f489 100644
--- a/gnu/usr.sbin/sendmail/contrib/link_hash.sh
+++ b/gnu/usr.sbin/sendmail/contrib/link_hash.sh
@@ -3,7 +3,7 @@
## Copyright (c) 2000 Sendmail, Inc. and its suppliers.
## All rights reserved.
##
-## $Sendmail: link_hash.sh,v 1.1.2.1 2000/04/25 00:10:47 ca Exp $
+## $Sendmail: link_hash.sh,v 1.2 2000/04/25 00:12:28 ca Exp $
##
#
# ln a certificate to its hash
diff --git a/gnu/usr.sbin/sendmail/contrib/qtool.8 b/gnu/usr.sbin/sendmail/contrib/qtool.8
index bc37cf7a25d..17affe5c08f 100644
--- a/gnu/usr.sbin/sendmail/contrib/qtool.8
+++ b/gnu/usr.sbin/sendmail/contrib/qtool.8
@@ -6,9 +6,9 @@
.\" the sendmail distribution.
.\"
.\"
-.\" $Sendmail: qtool.8,v 8.9.16.2 2000/12/15 19:50:41 gshapiro Exp $
+.\" $Sendmail: qtool.8,v 8.12 2000/12/15 19:53:35 gshapiro Exp $
.\"
-.TH QTOOL 8 "$Date: 2001/01/15 21:09:00 $"
+.TH QTOOL 8 "$Date: 2001/09/11 19:02:48 $"
.SH NAME
qtool
\- manipulate sendmail queues
@@ -17,7 +17,7 @@ qtool
.RB [options]
target_directory source [source ...]
.PP
-.B qtool.pl [-d/-b]
+.B qtool.pl [-d|-b]
.RB [options]
source [source ...]
.SH DESCRIPTION
@@ -42,6 +42,10 @@ running sendmail with the -OTimeout.queuereturn=now option.
\fB\-b\fP
Bounce all of the messages specified by source. The messages will be bounced
immediately. No attempt will be made to deliver the messages.
+.TP
+\fB\-C\fP configfile
+Specify the sendmail config file.
+Defaults to /etc/mail/sendmail.cf.
.TP
\fB\-d\fP
Delete all of the messages specified by source.
@@ -191,12 +195,15 @@ Moves the message with id d6CLQh100847 in queue q1 to queue q2.
\fBqtool.pl q2 q1/qfd6CLQh100847\fP
Moves the message with id d6CLQh100847 in queue q1 to queue q2.
.TP
-\fBqtool.pl q2 q1/dfd6CLQh100847\fP
-Moves the message with id d6CLQh100847 in queue q1 to queue q2.
-.TP
\fBqtool.pl -e '$msg{num_delivery_attempts} == 3' /q2 /q1\fP
Moves all of the queue files that have had three attempted deliveries from
queue q1 to queue q2.
+.SH BUGS
+In sendmail 8.12, it is possible for a message's qf and df files
+to be stored in different queues.
+In this situation, you must give qtool the pathname of the qf file,
+not of the df file.
+To be safe, never feed qtool the pathname of a df file.
.SH SEE ALSO
sendmail(8)
.SH HISTORY
diff --git a/gnu/usr.sbin/sendmail/contrib/qtool.pl b/gnu/usr.sbin/sendmail/contrib/qtool.pl
index 3f819bc9ed8..0f81449a946 100644
--- a/gnu/usr.sbin/sendmail/contrib/qtool.pl
+++ b/gnu/usr.sbin/sendmail/contrib/qtool.pl
@@ -3,7 +3,7 @@
## Copyright (c) 1998-2000 Sendmail, Inc. and its suppliers.
## All rights reserved.
##
-## $Sendmail: qtool.pl,v 8.15.16.4 2000/11/30 07:14:01 gshapiro Exp $
+## $Sendmail: qtool.pl,v 8.20 2000/12/05 16:10:07 dmoen Exp $
##
use strict;
use File::Basename;
@@ -63,7 +63,7 @@ my $action;
my $new_condition;
my $conditions = new Compound();
-Getopt::Std::getopts('bde:s:', \%opts);
+Getopt::Std::getopts('bC:de:s:', \%opts);
sub move_action
{
@@ -126,6 +126,37 @@ if ($action == \&move_action)
$destination = new Queue($dst_name);
}
+# determine queue_root by reading config file
+my $queue_root;
+{
+ my $config_file = "/etc/mail/sendmail.cf";
+ if (defined $opts{C})
+ {
+ $config_file = $opts{C};
+ }
+
+ my $line;
+ open(CONFIG_FILE, $config_file) or die "$config_file: $!";
+ while ($line = <CONFIG_FILE>)
+ {
+ chomp $line;
+ if ($line =~ m/^O QueueDirectory=(.*)/)
+ {
+ $queue_root = $1;
+ if ($queue_root =~ m/(.*)\/[^\/]+\*$/)
+ {
+ $queue_root = $1;
+ }
+ last;
+ }
+ }
+ close(CONFIG_FILE);
+ if (!defined $queue_root)
+ {
+ die "QueueDirectory option not defined in $config_file";
+ }
+}
+
while (@ARGV)
{
$source_name = shift(@ARGV);
@@ -161,6 +192,7 @@ sub usage
print(" $0 [-d|-b] source ...\n");
print("options:\n");
print(" -b Bounce the messages specified by source.\n");
+ print(" -C configfile Specify sendmail config file.\n");
print(" -d Delete the messages specified by source.\n");
print(" -e [perl expression] Move only messages for which perl expression returns true.\n");
print(" -s [seconds] Move only messages whose qf file is older than seconds.\n");
@@ -222,6 +254,10 @@ sub add_source
return "'$source_name' does not exist";
}
$data_dir_name = File::Spec->catfile("$source_dir_name", "df");
+ if (!-d $data_dir_name)
+ {
+ $data_dir_name = $source_dir_name;
+ }
$source_dir_name = File::Spec->catfile("$source_dir_name",
"qf");
}
@@ -402,6 +438,7 @@ sub parse
'B' => 'body_type',
'C' => 'controlling_user',
'D' => 'data_file_name',
+ 'd' => 'data_file_directory',
'E' => 'error_recipient',
'F' => 'flags',
'H' => 'parse_header',
@@ -621,10 +658,21 @@ sub new
sub initialize
{
my $self = shift;
- my $queue_dir = shift;
+ my $data_dir = shift;
$self->{id} = shift;
-
- $self->{file_name} = $queue_dir . '/df' . $self->{id};
+ my $control_file = shift;
+
+ $self->{file_name} = $data_dir . '/df' . $self->{id};
+ return if -e $self->{file_name};
+ $control_file->parse();
+ return if !defined $control_file->{data_file_directory};
+ $data_dir = $queue_root . '/' . $control_file->{data_file_directory};
+ chomp $data_dir;
+ if (-d ($data_dir . '/df'))
+ {
+ $data_dir .= '/df';
+ }
+ $self->{file_name} = $data_dir . '/df' . $self->{id};
}
sub do_stat
@@ -694,14 +742,11 @@ sub initialize
$self->{id} = $id;
$self->{control_file} = new ControlFile($queue_dir, $id);
- if ($data_dir)
- {
- $self->{data_file} = new DataFile($data_dir, $id);
- }
- else
+ if (!$data_dir)
{
- $self->{data_file} = new DataFile($queue_dir, $id);
+ $data_dir = $queue_dir;
}
+ $self->{data_file} = new DataFile($data_dir, $id, $self->{control_file});
}
sub last_modified_time