From: Guilhem Moulin Date: Sun, 12 Jun 2016 20:18:43 +0000 (+0200) Subject: pullimap: enable locally unsetting the 'purge-after' option. X-Git-Url: https://git.g-eek.se/?a=commitdiff_plain;h=320a4da020952e3a8b926535d03d49a28dea20d0;p=interimap.git pullimap: enable locally unsetting the 'purge-after' option. --- diff --git a/pullimap b/pullimap index 054048c..e971f64 100755 --- a/pullimap +++ b/pullimap @@ -66,7 +66,7 @@ my $CONF = read_config( delete $CONFIG{config} // $NAME, , 'deliver-method' => qr/\A([ls]mtp:\[.*\]:\d+)\z/ , 'deliver-ehlo' => qr/\A(\P{Control}+)\z/ , 'deliver-rcpt' => qr/\A(\P{Control}+)\z/ - , 'purge-after' => qr/\A(\d+)\z/ + , 'purge-after' => qr/\A(\d*)\z/ )->{$ARGV[0]}; my ($MAILBOX, $STATE); @@ -238,7 +238,7 @@ my $LAST_PURGED; sub purge() { my $days = $CONF->{'purge-after'} // return; my ($uidnext) = $IMAP->get_cache('UIDNEXT'); - return unless 1<$uidnext; + return unless $days ne '' and 1<$uidnext; my $set = "1:".($uidnext-1); unless ($days == 0) {