task->from_envelope);
#endif
}
- tmp_addr = internet_address_list_parse_string (sender);
- if (tmp_addr) {
- internet_address_list_append (task->from_envelope, tmp_addr);
+ if (strcmp (sender, "<>") == 0) {
+ /* Workaround for gmime */
+ internet_address_list_add (task->from_envelope,
+ internet_address_mailbox_new ("", ""));
+ return TRUE;
+ }
+ else {
+ tmp_addr = internet_address_list_parse_string (sender);
+
+ if (tmp_addr) {
+ internet_address_list_append (task->from_envelope, tmp_addr);
#ifdef GMIME24
- g_object_unref (tmp_addr);
+ g_object_unref (tmp_addr);
#else
- internet_address_list_destroy (tmp_addr);
+ internet_address_list_destroy (tmp_addr);
#endif
- return TRUE;
+ return TRUE;
+ }
}
return FALSE;
end
-- Check sender
local smtp_from = task:get_from(1)
- if smtp_from and smtp_from[1] then
+ if smtp_from and smtp_from[1] and smtp_from[1]['addr'] ~= '' then
local mime_from = task:get_from(2)
if not mime_from or not mime_from[1] or
not (string.lower(mime_from[1]['addr']) == string.lower(smtp_from[1]['addr'])) then
if fields then
_.each(function(e)
local match = e[fields[1]]
- if fields[2] then
- match = fields[2](match)
+ if match then
+ if fields[2] then
+ match = fields[2](match)
+ end
+ ret = match_rule(r, match)
end
- ret = match_rule(r, match)
end, ls)
else
_.each(function(e) ret = match_rule(r, e) end, ls)
local from = task:get_from()
local from_user = '<>'
local from_addr = '<>'
- if from then
+ if from and from[1]['addr'] then
from_user = from[1]['user']
from_addr = from[1]['addr']
end