File qmail-dkim.patch of Package netqmail
--- qmail-dkim.pl.orig 2009-07-03 15:57:33.000000000 +0200
+++ qmail-dkim.pl 2011-05-26 09:32:25.000000000 +0200
@@ -2,6 +2,9 @@
#
# Copyright (C) 2007 Manuel Mausz (manuel@mausz.at)
#
+# Modified by Peter Conrad <conrad@quisquis.de> to support VERH
+# and openSUSE install
+#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either
@@ -18,7 +18,7 @@
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software Foundation,
-# Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
use strict;
use warnings;
@@ -35,7 +38,7 @@
<dkimsign>
<!-- per default sign all mails using dkim -->
- <global algorithm="rsa-sha256" domain="/var/qmail/control/me" keyfile="/var/qmail/control/dkim/global.key" method="simple" selector="beta">
+ <global algorithm="rsa-sha256" domain="@QMAIL_CONFDIR@/control/me" keyfile="@QMAIL_CONFDIR@/dkim/global.key" method="simple" selector="default">
<types id="dkim" />
</global>
@@ -51,21 +54,21 @@
=cut
my $configfile = undef;
-$configfile = '/var/qmail/control/dkim/signconf.xml';
+$configfile = '@QMAIL_CONFDIR@/dkim/signconf.xml';
my $debugfile = undef;
#$debugfile = '/tmp/dkim.debug';
-my $qremote = '/var/qmail/bin/qmail-remote.orig';
-my $rcpthosts = '/var/qmail/control/rcpthosts';
+my $qremote = '@QMAIL_EXECDIR@/qmail-remote.real';
+my $rcpthosts = '@QMAIL_CONFDIR@/control/rcpthosts';
my $binary = 0;
our $config;
$config->{'global'} = {
- types => { dkim => {} },
- keyfile => '/var/qmail/control/dkim/global.key',
+ types => {},
+ keyfile => '@QMAIL_CONFDIR@/dkim/global.key',
algorithm => 'rsa-sha256',
method => 'simple',
- selector => 'beta',
+ selector => 'default',
# either undefined (=sender), string or file (first line of file will be used)
- #domain => '/var/qmail/control/me'
+ #domain => '@QMAIL_CONFDIR@/control/me'
};
#-------------------------------------------------------------------------------
@@ -107,8 +110,35 @@
binmode STDIN;
}
+ my $inHeader = 0;
+ my $verhInBody = 0;
+ my $doVerh = ($#ARGV == 2);
+ my $verhLocal = "";
+ my $verhHost = "";
+ if ($doVerh && $ARGV[2] =~ /\@([^\@]*)$/s) {
+ $verhLocal = $`;
+ $verhHost = $1;
+ if ($verhLocal =~ /[^-a-zA-Z0-9\.]/s) {
+ $verhLocal =~ s/[\r\n\"\\]/\\$&/sg;
+ $verhLocal = "\"$verhLocal\"";
+ }
+ } else {
+ $doVerh = 0;
+ }
while (<STDIN>)
{
+ if ($inHeader) {
+ if (/^[\r\n]+$/) {
+ $inHeader = 0;
+ } elsif (/^#/) {
+ $verhInBody = 1;
+ $_ = $';
+ }
+ }
+ if ($doVerh && ($inHeader || $verhInBody)) {
+ s/##L/$verhLocal/g;
+ s/##H/$verhHost/g;
+ }
$mailbuf .= $_;
unless ($binary)
{