fdm icon indicating copy to clipboard operation
fdm copied to clipboard

Age Seems To Be Interpreted Differently At Different Times

Open tekktonic opened this issue 1 month ago • 1 comments

I have the following delivery config:

$cache = "%h/.fdm.d/seen"
$key = "%[message_id]"
cache $cache expire 1 month

..accounts...

action 'deliver' maildir "%h/mail/%a"
action 'keep' keep
action 'drop' drop

match age > 1 month action 'drop'

match not string $key to "" {
	match in-cache $cache key $key action keep
	match all action to-cache $cache key $key continue

	match matched action {'deliver' 'keep'}
}

match unmatched action 'drop'

However, I'm receiving mail in my mailbox which I've received before. For example I woke up this morning to e-mails in my inbox from October 14th and 15th. My best guess at what's happening is that there's a mismatch between "1 month" (the cache expiry) and "1 month" (the rule to drop mail older than a month.) Maybe 1 month is being considered 28 days (4 weeks) in the cache? It's not the end of the world, but it's a bit annoying.

Incidentally: I've noticed that fetching mail with this config on large mailboxes is quite slow. Is the cache lookup linear or something like that?

tekktonic avatar Nov 14 '25 13:11 tekktonic

A month is 2419200 seconds for both age and expiry.

expiry is from when the item was added to the cache to now, but age is from the Date header in the email, so maybe that explains the difference you are seeing.

nicm avatar Nov 26 '25 19:11 nicm