[amavisd-new] Add patch to fix releasing mail from sql quarantine

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



commit 6595b8b39fe05aadb6df98abfc77a25cf3a74377
Author: Juan Orti Alcaine <juan.orti@xxxxxxxxxxxx>
Date:   Sun Aug 3 23:15:43 2014 +0200

    Add patch to fix releasing mail from sql quarantine

 ...ew-2.9.1-release_mail_from_sql_quarantine.patch |   51 ++++++++++++++++++++
 amavisd-new.spec                                   |    9 +++-
 2 files changed, 59 insertions(+), 1 deletions(-)
---
diff --git a/amavisd-new-2.9.1-release_mail_from_sql_quarantine.patch b/amavisd-new-2.9.1-release_mail_from_sql_quarantine.patch
new file mode 100644
index 0000000..fe5fc04
--- /dev/null
+++ b/amavisd-new-2.9.1-release_mail_from_sql_quarantine.patch
@@ -0,0 +1,51 @@
+diff --git a/amavisd b/amavisd
+index f721756..2a2c418 100755
+--- a/amavisd
++++ b/amavisd
+@@ -20208,7 +20208,7 @@ sub preprocess_policy_query($$) {
+     new_am_id('rel-'.$msginfo->mail_id)  if $releasing;
+     if ($releasing && $quar_type eq 'Q') {  # releasing from SQL
+       do_log(5, "preprocess_policy_query: opening in sql: %s",
+-                $msginfo->mail_id);
++                $msginfo->parent_mail_id);
+       my $obj = $Amavis::sql_storage;
+       $Amavis::extra_code_sql_quar && $obj
+         or die "SQL quarantine code not enabled (3)";
+@@ -20218,31 +20218,31 @@ sub preprocess_policy_query($$) {
+       if (!defined($msginfo->partition_tag) &&
+           defined($sel_msg) && $sel_msg ne '') {
+         do_log(5, "preprocess_policy_query: missing partition_tag in request,".
+-                  " fetching msgs record for mail_id=%s", $msginfo->mail_id);
++                  " fetching msgs record for mail_id=%s", $msginfo->parent_mail_id);
+         # find a corresponding partition_tag if missing from a release request
+         $conn_h->begin_work_nontransaction;  #(re)connect if necessary
+-        $conn_h->execute($sel_msg, untaint($msginfo->mail_id));
++        $conn_h->execute($sel_msg, untaint($msginfo->parent_mail_id));
+         my $a_ref; my $cnt = 0; my $partition_tag;
+         while ( defined($a_ref=$conn_h->fetchrow_arrayref($sel_msg)) ) {
+           $cnt++;
+           $partition_tag = $a_ref->[0]  if !defined $partition_tag;
+           ll(5) && do_log(5, "release: got msgs record for mail_id=%s: %s",
+-                             $msginfo->mail_id, join(', ',@$a_ref));
++                             $msginfo->parent_mail_id, join(', ',@$a_ref));
+         }
+         $conn_h->finish($sel_msg)  if defined $a_ref;  # only if not all read
+         $cnt <= 1 or die "Multiple ($cnt) records with same mail_id exist, ".
+                          "specify a partition_tag in the AM.PDP request";
+         if ($cnt < 1) {
+           do_log(0, "release: no records with msgs.mail_id=%s in a database, ".
+-                    "trying to read from a quar. anyway", $msginfo->mail_id);
++                    "trying to read from a quar. anyway", $msginfo->parent_mail_id);
+         }
+         $msginfo->partition_tag($partition_tag);  # could still be undef/NULL !
+       }
+       ll(5) && do_log(5, "release: opening mail_id=%s, partition_tag=%s",
+-                         $msginfo->mail_id, $msginfo->partition_tag);
++                         $msginfo->parent_mail_id, $msginfo->partition_tag);
+       $conn_h->begin_work_nontransaction;  # (re)connect if not connected
+       $fh = Amavis::IO::SQL->new;
+-      $fh->open($conn_h, $sel_quar, untaint($msginfo->mail_id),
++      $fh->open($conn_h, $sel_quar, untaint($msginfo->parent_mail_id),
+                 'r', untaint($msginfo->partition_tag))
+         or die "Can't open sql obj for reading: $!";  1;
+     } else {  # mail checking or releasing from a file
diff --git a/amavisd-new.spec b/amavisd-new.spec
index 01e00f1..1771fbb 100644
--- a/amavisd-new.spec
+++ b/amavisd-new.spec
@@ -3,7 +3,7 @@
 Summary:        Email filter with virus scanner and spamassassin support
 Name:           amavisd-new
 Version:        2.9.1
-Release:        1%{?prerelease:.%{prerelease}}%{?dist}
+Release:        2%{?prerelease:.%{prerelease}}%{?dist}
 # LDAP schema is GFDL, some helpers are BSD, core is GPLv2+
 License:        GPLv2+ and BSD and GFDL
 Group:          Applications/System
@@ -27,6 +27,9 @@ Patch2:         amavisd-condrestart.patch
 # and it can't be relied upon to exist in recent Fedora builds. Mail
 # sent upstream to amavis-users ML 2013-05-10. -adamw
 Patch3:         amavisd-new-2.8.0-init_network.patch
+# Fix bug #1121552
+# http://lists.amavis.org/pipermail/amavis-users/2014-June/002957.html
+Patch4:         amavisd-new-2.9.1-release_mail_from_sql_quarantine.patch
 BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
 BuildArch:      noarch
 BuildRequires:  systemd
@@ -127,6 +130,7 @@ alerting purposes.
 %patch1 -p1
 %patch2 -p0
 %patch3 -p1
+%patch4 -p1
 
 install -p -m 644 %{SOURCE4} %{SOURCE5} README_FILES/
 sed -e 's,/var/amavis/amavisd.sock\>,%{_localstatedir}/spool/amavisd/amavisd.sock,' -i amavisd-release
@@ -231,6 +235,9 @@ systemctl start amavisd-clean-quarantine.timer >/dev/null 2>&1 || :
 %{_sbindir}/amavisd-snmp-subagent
 
 %changelog
+* Sun Aug 03 2014 Juan Orti Alcaine <jorti@xxxxxxxxxxxxxxxxx> 2.9.1-2
+- Add patch to fix releasing mail from sql quarantine
+
 * Sat Jun 28 2014 Juan Orti Alcaine <jorti@xxxxxxxxxxxxxxxxx> 2.9.1-1
 - New version 2.9.1
 
--
Fedora Extras Perl SIG
http://www.fedoraproject.org/wiki/Extras/SIGs/Perl
perl-devel mailing list
perl-devel@xxxxxxxxxxxxxxxxxxxxxxx
https://admin.fedoraproject.org/mailman/listinfo/perl-devel





[Index of Archives]     [Fedora Announce]     [Fedora Kernel]     [Fedora Testing]     [Fedora Legacy Announce]     [Fedora PHP Devel]     [Kernel Devel]     [Fedora Legacy]     [Fedora Maintainers]     [Fedora Desktop]     [PAM]     [Red Hat Development]     [Big List of Linux Books]     [Gimp]     [Yosemite Information]
  Powered by Linux