]> source.dussan.org Git - rspamd.git/commitdiff
Fix gmime24 compatibility.
authorVsevolod Stakhov <vsevolod@rambler-co.ru>
Wed, 9 Mar 2011 12:49:32 +0000 (15:49 +0300)
committerVsevolod Stakhov <vsevolod@rambler-co.ru>
Wed, 9 Mar 2011 12:49:32 +0000 (15:49 +0300)
Fix adding extra space to raw headers.

Reported by: Victor Ustugov

rspamd.xml.sample
src/lua/lua_task.c
src/message.c

index 1a04eeaa9f298f7140c577c4de30719f55789750..52e49792691f5dcd16c2590daf1868471e788032 100644 (file)
  <symbol weight="1.00" description="SPF verification soft-failed">R_SPF_SOFTFAIL</symbol>
  <symbol weight="-3.00" description="SPF verification alowed">R_SPF_ALLOW</symbol>
 
- <!-- Whitelisted client's IP --> 
- <symbol weight="-2.00" description="Whitelisted client's IP">WHITELIST_IP</symbol>
  <!-- Message seems to be from maillist -->
  <symbol weight="-2.00" description="Message seems to be from maillist">MAILLIST</symbol>
 
 </module>
 
 <!-- whitelist -->
+<!-- Example of using HTTP maps for whitelisting
 <module name="whitelist">
   <ip_whitelist>http://cebka.pp.ru/stuff/grey_whitelist.conf</ip_whitelist>
   <symbol_ip>WHITELIST_IP</symbol_ip>
 </module>
+-->
 
 <!-- chartable -->
 <module name="chartable">
index 549bdc914d135be0e0e3f68147eda0503d0d1921..eb95f0258dc700d06c31b6736f22215b56e2adf6 100644 (file)
@@ -731,9 +731,9 @@ lua_push_internet_address (lua_State *L, InternetAddressList *addrs)
        InternetAddressMailbox        *iamb;
 
        lua_newtable (L);
-       len = internet_address_list_length (list);
+       len = internet_address_list_length (addrs);
        for (i = 0; i < len; i ++) {
-               ia = internet_address_list_get_address (list, i);
+               ia = internet_address_list_get_address (addrs, i);
                if (ia) {
                        lua_newtable (L);
                        iamb = INTERNET_ADDRESS_MAILBOX (ia);
index b4ddde83940fdf63474fa807d18943d2c4608a4d..4f462735124d0ff4efaaf50d428cab091833fa72 100644 (file)
@@ -588,6 +588,10 @@ process_raw_headers (struct worker_task *task)
                                        }
                                }
                        }
+                       /* Strip last space that can be added by \r\n parsing */
+                       if (*(tp - 1) == ' ') {
+                               tp --;
+                       }
                        *tp = '\0';
                        new->value = tmp;
                        task->raw_headers_list = g_list_prepend (task->raw_headers_list, new);