diff --git a/Changes b/Changes index d63cc1a..a72b07f 100644 --- a/Changes +++ b/Changes @@ -1,5 +1,8 @@ 0.26-dev + Don't break under taint mode on OpenBSD. (thanks to Frank Denis / + Jedi/Sector One) + Have the qmail-queue plugin add the message-id to the "Queued!" message we send back to the client (to help those odd sendmail using people debug their logs) diff --git a/lib/Qpsmtpd/Transaction.pm b/lib/Qpsmtpd/Transaction.pm index 975c2b8..32857a3 100644 --- a/lib/Qpsmtpd/Transaction.pm +++ b/lib/Qpsmtpd/Transaction.pm @@ -55,6 +55,7 @@ sub notes { my $self = shift; my $key = shift; @_ and $self->{_notes}->{$key} = shift; + #warn Data::Dumper->Dump([\$self->{_notes}], [qw(notes)]); $self->{_notes}->{$key}; } @@ -71,6 +72,14 @@ sub body_write { : Qpsmtpd::Utils::tildeexp('~/tmp/'); $spool_dir .= "/" unless ($spool_dir =~ m!/$!); + + $spool_dir =~ /^(.+)$/ or die "spool_dir not configured properly"; + $spool_dir = $1; + + if (-e $spool_dir) { + my $mode = (stat($spool_dir))[2]; + die "Permissions on the spool_dir are not 0700" if $mode & 07077; + } -d $spool_dir or mkdir($spool_dir, 0700) or die "Could not create spool_dir: $!"; $self->{_filename} = $spool_dir . join(":", time, $$, $transaction_counter++);