added imap filter for newer than

This commit is contained in:
Michael Krayer 2020-05-22 13:27:26 +02:00
parent 92aa5b5b8e
commit 0afdb1a2f0
1 changed files with 9 additions and 0 deletions

View File

@ -1124,6 +1124,15 @@ def build_imap_filter():
time_str = time.strftime('%d-%b-%Y', time_old)
imap_filter.append("BEFORE %s" % time_str)
if options.date_old_min == None:
time_now = time.time()
secs_old_min = (options.days_old_min * 24 * 60 * 60)
time_old = time.gmtime(time_now - secs_old_min)
else:
time_old = time.gmtime(options.date_old_min)
time_str = time.strftime('%d-%b-%Y', time_old)
imap_filter.append("SINCE %s" % time_str)
if not options.include_flagged:
imap_filter.append("UNFLAGGED")
if options.min_size: