]> source.dussan.org Git - rspamd.git/commitdiff
[Fix] Date header timezone adjustments (#1279) 1281/head
authorAndrew Lewis <nerf@judo.za.org>
Fri, 23 Dec 2016 10:23:40 +0000 (12:23 +0200)
committerAndrew Lewis <nerf@judo.za.org>
Fri, 23 Dec 2016 12:56:09 +0000 (14:56 +0200)
src/libutil/util.c
src/ragel/smtp_date.rl

index c33a92180f8220ec80b4aadeb40266d3a01fdb78..76325522c3cb309c4f17125acaeb8c0f6ba6bc80 100644 (file)
@@ -2648,7 +2648,7 @@ rspamd_tm_to_time (const struct tm *tm, glong tz)
        result += tm->tm_sec;
 
        /* Now apply tz offset */
-       result -= offset;
+       result += offset;
 
        return result;
 }
index 25e1ea3c09cb9228f087ddcb6affd64437ef7d83..6830506cdd712de5f4825a273f3144a81c7470e4 100644 (file)
     }
   }
   action TZ_Sign {
-    tmp = p - 1;
+    tmp = p;
   }
   action TZ_Offset_Start {
 
   }
   action TZ_Offset_End {
     if (p > tmp + 1) {
-      rspamd_strtoul (tmp + 1, p - tmp - 1, (gulong *)&tz);
+      rspamd_strtoul (tmp + 1, p - tmp, (gulong *)&tz);
 
-      if (*tmp == '-') {
+      if (*(tmp - 1) == '-') {
         tz = -(tz);
       }
     }
                      "MST" %TZ_MST | "MDT" %TZ_MDT |
                      "PST" %TZ_PST | "PDT" %TZ_PDT |
                      [a-iA-I] | [k-zK-Z];
-  time            =   time_of_day %DT_End (zone | obs_zone %Obs_Zone_End);
+  time            =   time_of_day %DT_End (zone | obs_zone %Obs_Zone_End) FWS*;
   date_time       =   (day_of_week ",")? date time;
-}%%
\ No newline at end of file
+}%%