]> source.dussan.org Git - rspamd.git/commitdiff
Fix issues with bounces From processing.
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Tue, 23 Jun 2015 12:52:41 +0000 (13:52 +0100)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Tue, 23 Jun 2015 12:54:01 +0000 (13:54 +0100)
src/libserver/task.c
src/plugins/lua/forged_recipients.lua
src/plugins/lua/multimap.lua
src/plugins/lua/ratelimit.lua

index 1874847de7ad8ae98ab099aaea39908aa4ab3395..031a453e248b98210a3093018534ead3ca7f4437 100644 (file)
@@ -474,16 +474,25 @@ rspamd_task_add_sender (struct rspamd_task *task, const gchar *sender)
                                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;
index 6c553aa0445ffdef8ef2959ccc9e1cc9d4fe6405..e5a6c738c7aa44c9163f69e4c2c77083208a7a55 100644 (file)
@@ -63,7 +63,7 @@ local function check_forged_headers(task)
        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
index 756996ede820ff10ee7ac6081981039a27337ed1..2ba14c653856f85119c51020314e168d84b645af 100644 (file)
@@ -78,10 +78,12 @@ local function check_multimap(task)
       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)
index afc8eda0f88b0757e0fa87d9b878f70ba56fff32..1c1dc4dd64a6845f02f81d43ed1e8729bc890a00 100644 (file)
@@ -242,7 +242,7 @@ local function rate_test_set(task, func)
   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