aboutsummaryrefslogtreecommitdiffstats
path: root/imapsync
diff options
context:
space:
mode:
authorGuilhem Moulin <guilhem@fripost.org>2015-07-30 00:10:28 +0200
committerGuilhem Moulin <guilhem@fripost.org>2015-07-30 00:10:28 +0200
commitcdb79844048406e4084496dfca4346ea9f111ba3 (patch)
tree640d79d225cad9037f3e15770b7b3bcf53bf4d8c /imapsync
parent5f2e99687c3d04f8a4e177995192c4a6f4a27478 (diff)
Don't push non-existing mailboxes to @MAILBOXES.
Diffstat (limited to 'imapsync')
-rwxr-xr-ximapsync10
1 files changed, 5 insertions, 5 deletions
diff --git a/imapsync b/imapsync
index ae05163..d46c262 100755
--- a/imapsync
+++ b/imapsync
@@ -408,13 +408,13 @@ my @MAILBOXES;
$mailboxes{$_} = 1 foreach keys %{$IMAP->{remote}->{mailboxes}};
my $sth_subscribe = $DBH->prepare(q{UPDATE mailboxes SET subscribed = ? WHERE idx = ?});
- @MAILBOXES = keys %mailboxes;
- @MAILBOXES = grep !/$CONF->{_}->{'ignore-mailbox'}/, @MAILBOXES
- if defined $CONF->{_}->{'ignore-mailbox'};
+ foreach my $mailbox (keys %mailboxes) {
+ next if defined $CONF->{_}->{'ignore-mailbox'} and $mailbox !~ /$CONF->{_}->{'ignore-mailbox'}/o;
+ my ($lExists, $rExists) = map {mbx_exists($_,$mailbox)} qw/local remote/;
+ next unless $lExists or $rExists;
- foreach my $mailbox (@MAILBOXES) {
check_delim($mailbox); # ensure that the delimiter match
- my ($lExists, $rExists) = map {mbx_exists($_,$mailbox)} qw/local remote/;
+ push $mailbox, @MAILBOXES;
$STH_GET_INDEX->execute($mailbox);
my ($idx,$subscribed) = $STH_GET_INDEX->fetchrow_array();