bool try_greylist(const char *sender, const char *c_addr,
const char *c_name, const char *rcpt)
{
bool try_greylist(const char *sender, const char *c_addr,
const char *c_name, const char *rcpt)
{
if (greylist_cfg.client_awl) {
res = tcbdbget3(awl_db, c_addr, c_addrlen, &len);
if (res && len == sizeof(aent)) {
memcpy(&aent, res, len);
}
if (greylist_cfg.client_awl) {
res = tcbdbget3(awl_db, c_addr, c_addrlen, &len);
if (res && len == sizeof(aent)) {
memcpy(&aent, res, len);
}
klen = snprintf(key, sizeof(key), "%s/%s/%s",
c_net(c_addr, c_name, cnet, sizeof(cnet)),
sender_normalize(sender, sbuf, sizeof(sbuf)), rcpt);
klen = snprintf(key, sizeof(key), "%s/%s/%s",
c_net(c_addr, c_name, cnet, sizeof(cnet)),
sender_normalize(sender, sbuf, sizeof(sbuf)), rcpt);
oent.last = now;
tcbdbput(obj_db, key, klen, &oent, sizeof(oent));
oent.last = now;
tcbdbput(obj_db, key, klen, &oent, sizeof(oent));
+
+ /* Auto whitelist clients:
+ * algorithm:
+ * - on successful entry in the greylist db of a triplet:
+ * - client not whitelisted yet ? -> increase count
+ * -> withelist if count > limit
+ * - client whitelisted already ? -> update last-seen timestamp.
+ */