1. Paul McLanahan
  2. django-celery-email
  3. Issues
Issue #4 resolved

django-celery-email and django-ses

Olivier Girardot
created an issue

Hi, is there currently a way to use django-ses (that's to say amazon's Simple Email Service) with django-celery-email ?

Both define their own EMAIL_BACKEND, so they seem incompatible, how can you change the "underlying" email backend of django-celery-email ?

If it's not possible at the moment, do you think it can be interesting and do you mind if i try working on it ?

Regards, Olivier.

Comments (7)

  1. Olivier Girardot reporter

    i think the answer was in your test_project, is the CELERY_EMAIL_BACKEND responsible for defining the underlying email backend used ? If so, did you ever try to user django-ses's EMAIL_BACKEND as a CELERY_EMAIL_BACKEND ?

    Thanks

  2. Paul McLanahan repo owner

    That is indeed the answer I was going to give you. CELERY_EMAIL_BACKEND should work, but I've never tried it with django-ses. It should work fine in theory. If you do give it a try, I'd be very interested in hearing about your results.

  3. Olivier Girardot reporter

    well i'm having trouble mainly with amazon, but using django_ses email backend as a CELERY_EMAIL_BACKEND seems to work properly. I'll give you a better answer when i'll get it work fully, but for now the worker seems to call the proper backend.

    I have just one fear, it seems that now when Max retries are exceeded the task is completed as successful, here is the log :

    [...] Got task from broker: djcelery_email_send[3f4ad32d-5032-4159-b4e6-9d00c92715ef]
    [...] 400 Bad Request
    [...] <ErrorResponse xmlns="http://ses.amazonaws.com/doc/2010-12-01/">
      <Error>
        <Type>Sender</Type>
        <Code>MessageRejected</Code>
        <Message>Email address is not verified.</Message>
      </Error>
      <RequestId>8f6cff6e-f006-11e0-b11b-0db380ed5de6</RequestId>
    </ErrorResponse>
    
    Got task from broker: djcelery_email_send[3f4ad32d-5032-4159-b4e6-9d00c92715ef] eta:[2011-10-06 05:36:01.614508]
    [...] Task djcelery_email_send[3f4ad32d-5032-4159-b4e6-9d00c92715ef] retry: None
    [...] Got task from broker: djcelery_email_send[b39a08d2-e8eb-42ed-80e5-77fe2d2b5b56] eta:[2011-10-06 05:36:19.784633]
    [...] djcelery_email_send[b39a08d2-e8eb-42ed-80e5-77fe2d2b5b56] retry: None
    [...] Got task from broker: djcelery_email_send[3f4ad32d-5032-4159-b4e6-9d00c92715ef] eta:[2011-10-06 05:39:05.434565]
    [...] Task djcelery_email_send[3f4ad32d-5032-4159-b4e6-9d00c92715ef] retry: None
    [...] Got task from broker: djcelery_email_send[b39a08d2-e8eb-42ed-80e5-77fe2d2b5b56] eta:[2011-10-06 05:39:19.822427]
    [...] Task djcelery_email_send[b39a08d2-e8eb-42ed-80e5-77fe2d2b5b56] retry: None
    [...] Got task from broker: djcelery_email_send[3f4ad32d-5032-4159-b4e6-9d00c92715ef] eta:[2011-10-06 05:42:06.162153]
    [...] Task djcelery_email_send[3f4ad32d-5032-4159-b4e6-9d00c92715ef] retry: None
    [...] djcelery_email_send[b39a08d2-e8eb-42ed-80e5-77fe2d2b5b56]: Max retries exceeded trying to send email to ['xxx@xxxxx.com'].
    [...] Task djcelery_email_send[b39a08d2-e8eb-42ed-80e5-77fe2d2b5b56] succeeded in 1.19408798218s: None
    

    Maybe it's coming from the backend, maybe i just didn't notice it before ? is it normal ? Regards,

    Olivier.

  4. Paul McLanahan repo owner

    The error you're getting from SES seems to be that you're trying to send to or from an email address you haven't verified. Django-ses makes verification of email addresses very easy with a management command. And while you're in sandbox mode w/ ses you can't send email to or from a non-verified address.

    That log is troubling. It does seem to be saying that it succeeded even though it obviously did not. I'll see what I can find out.

    Thanks for the info.

  5. Olivier Girardot reporter

    ok, it's done and working, the only thing is needed more was to define properly the DEFAULT_FROM_EMAIL in my settings to use only a validated email address. Thanks again for your help. i'll link the related blogpost later. Regards,

    Olivier.

  6. Paul McLanahan repo owner

    (Reply via pmcl...@gmail.com):

    Great! Thanks for your help in reporting these issues. I'm glad to hear it works well with django-ses. I look forward to reading your blog post.

    Paul

  7. Log in to comment