diff options
author | Guilhem Moulin <guilhem@fripost.org> | 2016-03-08 18:02:10 +0100 |
---|---|---|
committer | Guilhem Moulin <guilhem@fripost.org> | 2016-03-08 18:02:10 +0100 |
commit | e19354c1b2b8015f58b7119763bb8cec401fb3fa (patch) | |
tree | dac3208b7e563a3176fdb937612b0d188b9c92ec /pullimap | |
parent | 69e2f637222f81fd538809ef48f77d5334ef9c71 (diff) |
pullimap: Don't rely on the last purged timestamp when purge-after=0.
Diffstat (limited to 'pullimap')
-rwxr-xr-x | pullimap | 8 |
1 files changed, 4 insertions, 4 deletions
@@ -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); |