aboutsummaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* gmail: Fix determining the start_history_idJason Gunthorpe2020-02-241-7/+13
| | | | | | | | | | | | Occasionally gmail returns history records that have junk in them, for instance messages IDs that don't exist. This appears to be a bug. Using the latest history ID seems to guarantee that a subsequent history query will be empty and we can then avoid the junk and start again. Go back to full query if delta fails for any reason. Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
* Catch failures from the sha1sum forkJason Gunthorpe2020-02-211-1/+2
| | | | | | | | This should trigger a sleep and retry, not a program failure. It happens if the sha1sum races with the user renaming a MailDir file. Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
* Fix an exception if message fetching failsJason Gunthorpe2020-02-212-0/+2
| | | | | | | Since size is used to print the log message, even on failure, set it to some value. Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
* Don't leave asyncio tasks running unexpectedlyJason Gunthorpe2020-02-074-13/+29
| | | | | | | | All cases where gather is called intend that the tasks will complete successfully or all cancel at the first error. Add a little wrapper to achieve this. Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
* Allow access to the message headers during mail directingJason Gunthorpe2020-02-073-30/+90
| | | | | | | Access to the headers like List-ID allows some client side filtering of incoming messages. Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
* Do not pass msgdb all over the placeJason Gunthorpe2020-02-075-39/+38
| | | | | | | The mailboxes can only be linked to a single msgdb, always take it from the mailbox cfg. Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
* Lift Mailbox.cfg out of the sub classesJason Gunthorpe2020-02-076-20/+22
| | | | | | Make sure it is always set Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
* Update documentationJason Gunthorpe2020-02-071-17/+59
| | | | | | For Gmail and other notes about O365 Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
* GMail supportJason Gunthorpe2020-02-066-11/+673
| | | | | | Basic support for GMail using the REST API Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
* Allow a Mailbox to search for messages with a None email_idJason Gunthorpe2020-02-051-16/+40
| | | | | | | Gmail does not have easy access to the email_id, but does have a stable storage_id, so provide a second dictionary. Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
* Preserve flags in the local MailDir that are not supported in the cloudJason Gunthorpe2020-02-052-7/+24
| | | | | | This is needed for gmail, since it doesn't support all of the flags. Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
* Do not run tracing by defaultJason Gunthorpe2020-02-052-4/+2
| | | | | | trace is only for debugging adventures. Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
* Add some more type annotations to O365MailboxJason Gunthorpe2020-02-042-10/+14
| | | | Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
* Add a --offline optionJason Gunthorpe2020-01-312-10/+40
| | | | | | | | | | | This allows treating the local message flags as authoritative during program startup. Messages marked locally as deleted will be deleted on the server during startup. For safety, this never considers the absence of a message locally as a deletion. Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
* Document how to setup the Trash modeJason Gunthorpe2020-01-311-0/+13
| | | | Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
* Support FLAG_DELETED in Office365Jason Gunthorpe2020-01-311-16/+26
| | | | | | | | | | | | | | When a local message is tagged deleted then update the cloud flags and delete the message. Using the Trash flag in a mail dir allows the cloud upload step to see the original message and then upload the local flags before deleting it. For instance, this will allow the Replied flag to be set upon deletion. Once deleted in the cloud the next sync iteration will delete the message locally. Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
* Support the Trash flag in MailDirJason Gunthorpe2020-01-312-3/+8
| | | | | | | This can be set by mutt when 'set maildir_trash=yes' and shows as a deleted item. Keep track of it on the maildir side. Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
* Move Office365 flag manipulation into a functionJason Gunthorpe2020-01-311-67/+70
| | | | | | For reuse in the next patches Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
* Trigger an update of a O365 mailbox if the notification FD closesJason Gunthorpe2020-01-181-0/+2
| | | | | | Fixes an issue where mailbox changes could be missed. Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
* Initial commit of cloud_mdir_syncJason Gunthorpe2020-01-1015-0/+2200
I have been using for a few months now with no ill effects. Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>