Write a script to process messages via IMAP from the domain names yahoo.com and gmail.com.

Job ID: 36197921

Budget: £250 – £750 GBP

We need to write a script for handling messages via IMAP from the domain names yahoo.com and gmail.com. The script should automatically download all new messages from the specified domain names and save them in the database. The script should process all incoming messages and extract from them keywords and phrases to be used in further data processing. In addition, the script should have a function to filter and sort messages according to various criteria, such as date, sender, subject, etc. Finally, the script should have the ability to generate reports and statistics on the processed messages, which will allow for more efficient data management and business objectives.