local function gen_eval_rule(arg)
local eval_funcs = {
{'check_freemail_from', function(task, remain)
- local from = task:get_from()
+ local from = task:get_from('mime')
if from then
return freemail_search(from[1]['addr'])
end
{
'check_for_missing_to_header',
function (task, remain)
- if not task:get_from(1) then
+ if not task:get_recipients('mime') then
return 1
end
{
'check_from_in_blacklist',
function(task, remain)
- local from = task:get_from()
+ local from = task:get_from('mime')
if from and from[1] and from[1]['addr'] then
if sa_lists['from_blacklist'][from[1]['addr']] then
return 1
{
'check_from_in_whitelist',
function(task, remain)
- local from = task:get_from()
+ local from = task:get_from('mime')
if from and from[1] and from[1]['addr'] then
if sa_lists['from_whitelist'][from[1]['addr']] then
return 1
{
'check_from_in_default_whitelist',
function(task, remain)
- local from = task:get_from()
+ local from = task:get_from('mime')
if from and from[1] and from[1]['addr'] then
if sa_lists['from_def_whitelist'][from[1]['addr']] then
return 1
{
'check_to_in_blacklist',
function(task, remain)
- local rcpt = task:get_recipients()
+ local rcpt = task:get_recipients('mime')
if rcpt then
for i,r in ipairs(rcpt) do
if sa_lists['from_blacklist'][r['addr']] then
{
'check_to_in_whitelist',
function(task, remain)
- local rcpt = task:get_recipients()
+ local rcpt = task:get_recipients('mime')
if rcpt then
for i,r in ipairs(rcpt) do
if sa_lists['from_whitelist'][r['addr']] then