AI
res.on('searchEntry', function (entry) {
plugin.logdebug(`Entry found ${JSON.stringify(entry.object)}`, connection);
if (Array.isArray(entry.object.mail)) {
if (entry.object.mail.indexOf(`${from.user}@${from.host}`) !== -1) {
plugin.loginfo(`Email is allowed! Mailbox ${from} is one of ${entry.object.mail.length} aliases belonging to user ${entry.object.dn}.`, connection);
recipientFound = true;
return
}
}
if (entry.object.mail === `${from.user}@${from.host}`) {
plugin.loginfo(`Email is allowed! Mailbox ${from} belongs to user ${entry.object.dn}!`, connection);
recipientFound = true;
return
}
plugin.logwarn(`Email is declined! Mailbox ${from} does not belong to user ${entry.object.dn}!`, connection);
recipientFound = false;
});

