Topic RSS
5:33 pm
i would like to create a filter based on a header regex match on the date header but it is not working
as expected. i would like to match based on the hour the message is sent.
i have tried numerous iterations but i can't seem to match a colon in the regex:
date:/:/
the date contain colons in the time portion but even this simple regex does not match.
i have tried backslash escaping the colon but this doesn't work either.
if i change the regex to // (match anything) this does match.
any suggestions?
I looked into this. Unfortunately there are three names where the header name is reinterpreted by the base code, so you do not really get the true string value of the header available: Date, Received, and Status. Data in particular is stored as a 64 bit integer, not as a string.
But the value of the Date is available in the header, just not as a string. You can get to it and search on it using a javascript search. So, for example, if you want to find emails that were sent between the hours of 12 and 18, the following javascript search will find them:
let sentDate = new Date(message.date/1000);
(sentDate.getHours() >= 12 && sentDate.getHours() < 18)
11:09 am
rkent said:
I looked into this. Unfortunately there are three names where the header name is reinterpreted by the base code, so you do not really get the true string value of the header available: Date, Received, and Status. Data in particular is stored as a 64 bit integer, not as a string.
But the value of the Date is available in the header, just not as a string. You can get to it and search on it using a javascript search. So, for example, if you want to find emails that were sent between the hours of 12 and 18, the following javascript search will find them:
let sentDate = new Date(message.date/1000);
(sentDate.getHours() >= 12 && sentDate.getHours() < 18)
awesome. thanks for the info. i will try it out.
Most Users Ever Online: 18
Currently Online:
12 Guest(s)
Currently Browsing this Page:
1 Guest(s)
Member Stats:
Guest Posters: 130
Members: 565
Moderators: 1
Admins: 1
Forum Stats:
Groups: 1
Forums: 7
Topics: 231
Posts: 802
Newest Members: Matteo, p.dobrogost, gaute, Mythobeast, terry, Livraria Notre Dame
Moderators: rkent (323)
Administrators: rkent (323)
Log In
Register
Members
Home
Add Reply
Add Topic
Quote
Offline

Recent Comments