Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rewrite / merge with sendmail backend from django-snippets #2

Merged
merged 2 commits into from
Mar 12, 2014

Conversation

blueyed
Copy link
Contributor

@blueyed blueyed commented Jan 11, 2014

I have merged https://djangosnippets.org/snippets/1864/, with the following notable changes:

  • write the message as_bytes() - this is what the SMTP backend does
    and is probably the right thing to do
  • use sendmail -t (parse recipients from mails; as with my previous commit)
  • removed thread locking, which should not be necessary, according to
    https://djangosnippets.org/snippets/1864/#c4310 - likely copied from
    the SMTP backend
  • raise an Exception in case of error (as with my previous commit)

See the commits for more information.

  - sendmail: use '-t' to parse recipients from mail, instead of only
    sending to the first one
  - do not use shell=True!
  - capture stderr and use it together with returncode to raise an
    exception

Ref: perenecabuto#1
  - based on BaseEmailBackend (which does not append separator/newline)
  - return number of sent mails (as per documentation)
  - handle `fail_silently`

I have merged https://djangosnippets.org/snippets/1864/, with the
following notable changes:
  - write the message as_bytes() - this is what the SMTP backend does
    and is _probably_ the right thing to do
  - use `sendmail -t` (parse recipients from mails; as with my previous commit)
  - removed thread locking, which should not be necessary, according to
    https://djangosnippets.org/snippets/1864/#c4310 - likely copied from
    the SMTP backend
  - raise an Exception in case of error (as with my previous commit)
@blueyed
Copy link
Contributor Author

blueyed commented Jan 11, 2014

Some notes: the Exception might be changed, I have probably not looked hard enough to find a better, already existing class for this. Also the text, maybe.

@mlowicki
Copy link

@perenecabuto could you have a look on this change? Would be useful to have it on pypi as soon as possible.

perenecabuto added a commit that referenced this pull request Mar 12, 2014
Rewrite / merge with sendmail backend from django-snippets
@perenecabuto perenecabuto merged commit 4ad95b0 into perenecabuto:master Mar 12, 2014
@blueyed blueyed deleted the rewrite-on-base branch March 12, 2014 22:15
@perenecabuto
Copy link
Owner

I have accepted the pull request and uploaded to pypi as version 0.1.2.
Thanks for improvements. =D

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants