, '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);
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) {