From a6e4044b18b95b4966e67b7560d25f651d6cd98e Mon Sep 17 00:00:00 2001 From: Daniel Hoffend Date: Wed, 2 Apr 2025 21:55:32 +0200 Subject: [PATCH] Make path to mbexamine configurable --- sa-learn-cyrus | 4 +++- sa-learn-cyrus.conf | 3 +++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/sa-learn-cyrus b/sa-learn-cyrus index 778ba06..7831e4d 100755 --- a/sa-learn-cyrus +++ b/sa-learn-cyrus @@ -100,6 +100,7 @@ our %conf = ( 'imap:unixhierarchysep' => 'yes', 'imap:purge_cmd' => '/usr/lib/cyrus/bin/ipurge', 'imap:mbpath_cmd' => '/usr/lib/cyrus/bin/mbpath', + 'imap:mbexamine_cmd' => '/usr/lib/cyrus/bin/mbexamine', 'imap:user' => 'cyrus', 'imap:userprefix' => 'user', 'imap:domainprefix' => 'domain', @@ -299,7 +300,8 @@ foreach my $mbx (sort @mailboxes) { my $mbox_glob = $conf{'imap:mbox_glob'}; my $mailbox_folder = get_imap_folder_name($domain, $user, $learn_folder); - my $mbexamine_output = `mbexamine "$mailbox_folder"`; + my $mbexamine_cmd = $conf{'imap:mbexamine_cmd'}; + my $mbexamine_output = `$mbexamine_cmd "$mailbox_folder"`; my ($number_of_messages) = $mbexamine_output =~ /Number of Messages:\s+(\d+)/; if ((defined $number_of_messages) and ($number_of_messages > 0)) { log_msg('debug', "Number of Messages not purged so far: $number_of_messages"); diff --git a/sa-learn-cyrus.conf b/sa-learn-cyrus.conf index b401f72..0585c57 100644 --- a/sa-learn-cyrus.conf +++ b/sa-learn-cyrus.conf @@ -139,6 +139,9 @@ domains = '' # imap command to obtain mailbox file system path #mbpath_cmd = /usr/lib/cyrus/bin/mbpath +# imap command to examine mailbox contents +#mbexamine_cmd = /usr/lib/cyrus/bin/mbexamine + # Cyrus-IMAPd user user = cyrus