On 9/3/2021 5:38 AM, Kristian wrote:
Hi,
I have a setup of two MX servers sharing postscreen and verify cache
using a memcached service.
At the moment, my config for this is (on both servers):
/etc/postfix/main.cf:
postscreen_cache_map = memcache:/etc/postfix/postscreen_cache.cf
postscreen_cache_cleanup_interval = 0
address_verify_map = memcache:/etc/postfix/verify_cache.cf
address_verify_cache_cleanup_interval = 0
/etc/postfix/postscreen_cache.cf:
memcache = inet:1.2.3.4:11211
key_format = postscreen:%s
/etc/postfix/verify_cache.cf:
memcache = inet:1.2.3.4:11211
ttl = 86400
key_format = verify:%s
What I haven't been able to grasp, is how exactly the memcache
table's ttl value affects the postscreen_*_ttl values and verify's
expire/refresh times, or vice versa.
For example, I have postscreen_bare_newline_ttl = 30d, but with a
memcache ttl of (default) 3600, which one is the true value?
Settings for postscreen and verify that possibly are affected by the
memcache table's ttl could be:
postscreen_bare_newline_ttl = 30d
postscreen_greet_ttl = 1d
postscreen_non_smtp_command_ttl = 30d
postscreen_pipelining_ttl = 30d
postscreen_cache_retention_time = 7d
postscreen_dnsbl_max_ttl =
${postscreen_dnsbl_ttl?{$postscreen_dnsbl_ttl}:{1}}h
postscreen_dnsbl_min_ttl = 60s
address_verify_negative_expire_time = 3d
address_verify_negative_refresh_time = 10m
address_verify_positive_expire_time = 31d
address_verify_positive_refresh_time = 7d
Are some of these settings unused with a cleanup of 0, or is that a
completely different operation?
Generally, the smallest TTL is what will be used. Memcache will
remove entries that have not been accessed for $TTL. Postscreen and
address verify will not use records that have not been refreshed for
their respective $TTL. So they are similar, but not exactly the same.
The expire time marks records as "old" but does not remove them.
The cleanup function removes/deletes expired records.
See http://www.postfix.org/memcache_table.5.html and especially the
notes under the "backup" and "ttl" options.
-- Noel Jones