]> git.g-eek.se Git - interimap.git/commitdiff
pullimap: enable locally unsetting the 'purge-after' option.
authorGuilhem Moulin <guilhem@fripost.org>
Sun, 12 Jun 2016 20:18:43 +0000 (22:18 +0200)
committerGuilhem Moulin <guilhem@fripost.org>
Sun, 12 Jun 2016 20:19:20 +0000 (22:19 +0200)
pullimap

index 054048c9b18059ca565ce6ae132071cde85d36ad..e971f64670bb863d4727477fc202ac4d3fbc4e86 100755 (executable)
--- 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) {