coddingtonbear / django-mailbox

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

Specify date to get messages from #122

Closed yarnball closed 8 years ago

yarnball commented 8 years ago

Hi,

Great work on this project :)

I would like to make a small change- to specify which date it pulls messages from. It is a little impractical to fetch every message in a mailbox by default.

Is it possible to set a date from which it gets mail from? Where and how would I set this?

Thanks

ad-m commented 8 years ago

@yarnball , there is no way to pull mails on specified time. Email protocols freely treats date messages because of its distributed nature. The process involved a lot of servers, messages are sometimes delayed for a few hours of sending and it would be difficult to give the correct date, so messages can be missing. Is the correct date the date of prepare message, the date of receive by first MTA date, mail of transfer by fourth in order MTA or other?

If you don't want fetch every message in mailbox:

Greetings,

yarnball commented 8 years ago

@ad-m Thanks for the quick reply.

Good to know I can choose a specific folder.

I think I did not explain well. I want to specify to only get mail AFTER a certain date. Is that still impossible?

Also, is there a version of this that uses the Google gmail API?

ad-m commented 8 years ago

GMail OAuth2 has some issues now (#120). GMail IMAP should works freely.

There is no way to fetch (get) mail from server AFTER certain date. Can you use Message.processed field maybe?

coddingtonbear commented 8 years ago

I'm afraid there isn't a way for us to only fetch only messages after a specific date, and that might be a little complicated given the problems @ad-m describes above. What we generally recommend is that one use django-mailbox with dedicated mailboxes only (not mailboxes shared with other tools).

If you bump into more questions about that sort of thing, though, feel free to hop into the gitter channel; I'd be glad to talk one-on-one about it.

Cheers!