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

Bug#683441: unblock: otrs2/3.1.7+dfsg1-3



Hi Patrick.

Patrick Matthäi <pmatthaei@debian.org> (31/07/2012):
> Package: release.debian.org
> Severity: normal
> User: release.debian.org@packages.debian.org
> Usertags: unblock
> 
> Please unblock package otrs2
> 
> I have added an upstream patch to fix the postmaster module with IMAPTLS
> mailboxes:
> 
> * Add backported upstream patch 27-imaptls-more-than-one-email. Using IMAPTLS
>   will purge all e-mails, if more than one is located in the inbox. This is
>   because of newer Mail::IMAPClient module versions return an array reference
>   insteaf of an array on the ->message action.
> 
> unblock otrs2/3.1.7+dfsg1-3

Attaching the diff would have been helpful, would have saved a few
copying/pasting.

+otrs2 (3.1.7+dfsg1-3) unstable; urgency=low
+
+  * Add backported upstream patch 27-imaptls-more-than-one-email. Using IMAPTLS
+    will purge all e-mails, if more than one is located in the inbox. This is
+    because of newer Mail::IMAPClient module versions return an array reference
+    insteaf of an array on the ->message action.
     ^^^^^^^
     instead, which you can fix for the next uploads.

+diff -Naur otrs2-3.1.7+dfsg1.orig/Kernel/System/MailAccount/IMAPTLS.pm otrs2-3.1.7+dfsg1/Kernel/System/MailAccount/IMAPTLS.pm
+--- otrs2-3.1.7+dfsg1.orig/Kernel/System/MailAccount/IMAPTLS.pm  2011-11-14 16:27:31.000000000 +0100
++++ otrs2-3.1.7+dfsg1/Kernel/System/MailAccount/IMAPTLS.pm       2012-07-28 14:06:33.293674056 +0200
+@@ -132,9 +132,9 @@
+     my $IMAPObject = $Connect{IMAPObject};
+     $IMAPObject->select($IMAPFolder) or die "Could not select: $@\n";
+ 
+-    my @Messages = $IMAPObject->messages()
++    my $Messages = $IMAPObject->messages()
+         || die "Could not retrieve messages : $@\n";
+-    my $NumberOfMessages = scalar @Messages;
++    my $NumberOfMessages = scalar @{$Messages};

What happens if an old Mail::IMAPClient module version is used?

+ 
+     if ($CMD) {
+         print "$AuthType: I found $NumberOfMessages messages on $Param{Login}/$Param{Host}. "
+@@ -147,7 +147,7 @@
+         }
+     }
+     else {
+-        for my $Messageno (@Messages) {
++        for my $Messageno ( @{$Messages} ) {

Ditto.

+ 
+             # check if reconnect is needed
+             $FetchCounter++;
+@@ -243,8 +243,7 @@
+             Message => "$AuthType: Fetched $FetchCounter email(s) from $Param{Login}/$Param{Host}.",
+         );
+     }
+-    $IMAPObject->expunge_mailbox($IMAPFolder);

I think that's part of the bug fix, since the retrieved messages are
deleted through:
                # mark email for deletion if it got processed
                $IMAPObject->delete_message($Messageno);

And I guess calling expunge_mailbox() was a way to make sure all
messages went away? Is calling delete_message() enough?

+-    $IMAPObject->close();
++    $IMAPObject->close;

I think it's a no-op, but a confirmation would be good.

+     if ($CMD) {
+         print "$AuthType: Connection to $Param{Host} closed.\n\n";
+     }

Mraw,
KiBi.

Attachment: signature.asc
Description: Digital signature


Reply to: