You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

smtp_date_parser.rl 487B

1234567891011121314151617181920212223242526272829
  1. %%{
  2. machine smtp_date_parser;
  3. include smtp_base "smtp_base.rl";
  4. include smtp_date "smtp_date.rl";
  5. main := date_time;
  6. }%%
  7. #include "smtp_parsers.h"
  8. #include "util.h"
  9. %% write data;
  10. guint64
  11. rspamd_parse_smtp_date (const char *data, size_t len)
  12. {
  13. const gchar *p = data, *pe = data + len, *eof = data + len, *tmp = data;
  14. struct tm tm;
  15. glong tz = 0;
  16. gint cs = 0;
  17. memset (&tm, 0, sizeof (tm));
  18. %% write init;
  19. %% write exec;
  20. return rspamd_tm_to_time (&tm, tz);
  21. }