aboutsummaryrefslogtreecommitdiffstats
path: root/pullimap
diff options
context:
space:
mode:
Diffstat (limited to 'pullimap')
-rwxr-xr-xpullimap8
1 files changed, 4 insertions, 4 deletions
diff --git a/pullimap b/pullimap
index c3fd4a0..c16d6ac 100755
--- a/pullimap
+++ b/pullimap
@@ -234,11 +234,11 @@ sub purge() {
return unless 1<$uidnext;
my $set = "1:".($uidnext-1);
- my $now = time;
- return if defined $LAST_PURGED and $now - $LAST_PURGED < 6*3600;
- $LAST_PURGED = $now;
-
unless ($days == 0) {
+ my $now = time;
+ return if defined $LAST_PURGED and $now - $LAST_PURGED < 6*3600; # purge every 6h
+ $LAST_PURGED = $now;
+
my @now = gmtime($now - $days*86400);
my @m = qw/Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec/; # RFC 3501's date-month
my $date = sprintf("%02d-%s-%04d", $now[3], $m[$now[4]], $now[5]+1900);