my %vanished = map {$_ => 1} @{$self->{_VANISHED}};
- my @failed;
+ my (@failed, @expunged);
foreach my $uid (@set) {
if (exists $vanished{$uid}) {
- # ignore succesfully EXPUNGEd messages
- delete $vanished{$uid};
- delete $self->{_MODIFIED}->{$uid};
+ push @expunged, $uid
} else {
push @failed, $uid;
}
}
+
+ # ignore succesfully EXPUNGEd messages
+ delete @vanished{@expunged};
+ delete @{$self->{_MODIFIED}}{@expunged};
$self->{_VANISHED} = [ keys %vanished ];
- $self->warn("Could not EXPUNGE UID(s) ".compact_set(@failed)) if @failed;
+ $self->log("Removed UID ".compact_set(@expunged)) if @expunged and !$self->{quiet};
+ $self->warn("Could not UID EXPUNGE ".compact_set(@failed)) if @failed;
return @failed;
}
$cache->{UIDNEXT} = $UIDNEXT if ($cache->{UIDNEXT} // 0) < $UIDNEXT;
}
+ $self->log("Added ".($#appends+1)." message(s) to $mailbox, got new UID ".compact_set(@uids))
+ unless $self->{quiet};
return @uids;
}
}
}
+ my @ok;
foreach my $uid (@set) {
if ($failed{$uid}) {
# $uid was listed in the MODIFIED response code
# got multiple FETCH responses for $uid, the last one with $flags
delete $self->{_MODIFIED}->{$uid};
}
+ push @ok, $uid;
}
}
+
+ unless ($self->{quiet}) {
+ $self->log("Updated flags ($flags) for UID ".compact_set(@ok));
+ $self->log("Couldn't update flags ($flags) for UID ".compact_set(keys %failed).', '.
+ "trying again later") if %failed;
+ }
return keys %failed;
}