Closed scientifichackers closed 6 years ago
The variety of methods of fetching incoming e-mails automatically are discussed here: http://django-mailbox.readthedocs.io/en/latest/topics/polling.html; is there a specific question you have, or did you just not find the doc?
In your case, you're more than likely going to want to figure out how to receive mail from Exim4 or Postfix directly, but the details of how that would work are dependent on the environment you're running in.
I was trying to make this work, but my signal doesn't seem to fire with new emails that i recieve.
I am using a Gmail account and have enabled the "allow insecure apps" from my account settings.
I am scraping my personal emails, and would like to do so as soon as i receive them as opposed to a cron job.
Please tell me any specific environment information you need to help me.
Did you load signals in AppConfig?
08.03.2018 12:58 PM "pycampers" notifications@github.com napisał(a):
I was trying to make this http://django-mailbox.readthedocs.io/en/latest/topics/signal.html work, but my signal doesn't seem to fire with new emails that i recieve.
— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/coddingtonbear/django-mailbox/issues/173#issuecomment-371467039, or mute the thread https://github.com/notifications/unsubscribe-auth/ADc2r-wbEFiHuUOTE_9gDG3mHj6qXQo0ks5tcRzbgaJpZM4SbUcj .
Please read my question, i wrote
I have setup a signal and loaded it in my AppConfig's ready() method
&
P.S. I have confirmed that the signals.py file is loaded by printing a message at the start of signals.py
Just in case there's some confusion about how things work -- that signal fires when your app has received a message via either a pipe or polling; which of those methods are you using?
@coddingtonbear I am not sure what you're talking about.
It's a simple email, i sent using gmail.
What is that pipe / polling method you talk about? Please redirect me to the docs if I missed something.
P.S. sorry for no-reply, I forgot to check mail.
I'm sorry if I wasn't clear above, but this is the page of the docs you need to familiarize yourself with: http://django-mailbox.readthedocs.io/en/latest/topics/polling.html .
What you need to do is implement one of the four ways of "Getting incoming mail" (see the above doc); your options include running get_new_mail
in your code somewhere, clicking on "Get new mail" in the django admin, running the getmail
management command, or receiving your mail from Exim4 or Postfix via a pipe. The signal you're mentioning above fires when Django-mailbox processes a message received via one of those four methods.
Just to give you a hint -- if you're receiving mail into a Gmail inbox, you won't be able to use the last method ("Receiving mail directly from Exim4 or Postfix via a pipe").
That makes it crystal clear. Thanks.
Btw, I could probably run get_new_mail
as a celery beat task, right?
That's one option, yes.
when i run run get new mails my browser just loads and then i get os error after 2-3 minutes.
I have setup django-mailbox successfully using gmail imap.
I tried
manage.py getmail
and it worked flawlessly.But how can i make it listen for all incoming messages?
I have setup a signal and loaded it in my
AppConfig's ready()
method but it doesn't seem to respond to new messages in my inboxHere is my apps.py
Here is my signals.py
P.S. I have confirmed that the
signals.py
file is loaded by printing a message at the start ofsignals.py