Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion sa-learn-cyrus
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down Expand Up @@ -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");
Expand Down
3 changes: 3 additions & 0 deletions sa-learn-cyrus.conf
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down