coddingtonbear / django-mailbox

Import mail from POP3, IMAP, local email mailboxes or directly from Postfix or Exim4 into your Django application automatically.
MIT License
357 stars 166 forks source link

get_new_mail from mailboxes inbox: where in mailbox are the loaded messages located? #239

Closed mondomeme closed 4 years ago

mondomeme commented 4 years ago

Hello,

I'm trying to develop a mail management system using Django and django mailbox. I have a set of same domain mailboxes, for example : mark@dog.com, emily@dog.com. The mailboxes have all the same configuration: imap, tls, host server.

When I load new messages with the get_new_mail function, the messages are correctly loaded, but when I'm trying to access to a mailbox I see no message.

After searching for several hours, I see for a mailbox the loaded messages are marked as 'deleted', instead for another one all messages disappeared.

I don't understand the two different behaviors.

ad-m commented 4 years ago

The Django-mailbox retrieves the e-mail messages by eg. IMAP, POP and then erases them to not download again the next time. Django-mailbox is not a typical mail program, and is a development library that makes it easy to process email messages in Django. A mailbox in that case plays the role of a message queue that needs to be processed. Messages processed from the queue are removed from the queue.

https://django-mailbox.readthedocs.io/en/latest/

mondomeme commented 4 years ago

@ad-m thank you for reply. I understand the messages are erased, but I don't understand for two different mailbox with same configuration the message are definitevely erased or marked and stored as 'Deleted'.

ad-m commented 4 years ago

Ask your mailbox provider. Different mailbox providers handle delete on different way.

mondomeme commented 4 years ago

I figured out why the mailbox messages haven't been deleted: the mailbox has so much messages in inbox and running of get_new_mailcrashed. In fact I see duplicated records in django_mailbox_message table. The other mailbox has much less messages.

The problem now is the same of #212 issue.

ad-m commented 4 years ago

Closed as duplicate.