0

I need to download only emails from the IMAP server which are older than a certain Linux timestamp. The Linux time stamp has to be to the second. This gets updated as per the server time. Example :

datetime.now().strftime('%d-%b-%Y %H:%M:%s')
'21-Dec-2012 16:50:1356088844

Problem code:

result, data = imap_server.search(None, '(SINCE '+datetime.now().strftime('%d-%b-%Y')+')')

The search function only takes in 'SINCE + DATE'. It won't take a full date time argument. It only takes the date example '21-Dec-2012'

How can I solve this?

Chris Seymour
  • 83,387
  • 30
  • 160
  • 202
Vishal Khialani
  • 2,557
  • 6
  • 38
  • 49

0 Answers0