-
Notifications
You must be signed in to change notification settings - Fork 40
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
cannot send email with only bcc #14
Comments
Note that |
The tests for cc-only and bcc-only worked under Python 2.6 but failed under Python 3.2 on rpatterson's master. Instead of fixing it, I just caused pyramid_mailer to raise a more descriptive error message saying: raise InvalidMessage("Must have at least one direct recipient "
"even if cc or bcc set") We can revisit this later, I just couldn't figure out how to make it work under 3.2. |
Odd, I re-ran tox before pulling and merging and the tests passed under 3.2 for me. Investigating now. |
When I run tox against 95ff3e7, your first commit on top of my master, I see the failures in all envs. When I run tox against d2c6adf, my last change I see only an unrelated failure under jython (which I missed before, sorry). So I'm not seeing a 3.2 specific failure. But reading your comment and commit logs more carefully, it seems like you want pyramid_mailer to enforce a prohibition against cc/bcc only messages so I guess I just shouldn't have gone off and implemented what mmerickel requested without discussion. Oops, sorry. :-) |
@rpatterson, he doesn't want to enforce against cc/bcc only messages. That was just his clear error message until he could revisit the issue. Keep fighting. :-) |
@mmerickel You keep fighting! And here's how... :-) Checkout d2c6adf and see if the 3.2 tests pass for you. |
@mmerickel Are you sure he doesn't want to? Have you looked at 95ff3e7? @mcdonc Care to clarify whether you want to allow messages with cc/bcc but no recipients? |
No I don't want to enforce against it. I just couldn't figure out the failure I see. When I comment out the check I added in message.py:
And add this test to tests.TestMessage def test_cc_without_recipients_2(self):
from pyramid_mailer.message import Message
msg = Message(subject="testing",
sender="sender@example.com",
body="testing",
cc=["tosomeoneelse@example.com"])
response = msg.get_response()
self.assertTrue("Cc: tosomeoneelse@example.com" in str(response)) This is the exception I get on my system under Python 3.2:
It doesn't happen on Python 2.6 or 2.7. I noticed while PDB stepping through it that the "To" header is the empty string. I suspect that may be why but I didn't chase it down and punted by disallowing it. |
@mcdonc Ok, I'll apply that patch and investigate. Thanks! |
By the way I made new releases of pyramid_mailer and repoze.sendmail last night, thanks for the work Ross! |
@mcdonc Yeah, I don't get that error or any failure under 3.2 when I revert your related changes and then add the test you provided above. @mmerickel Can you try running tox against rpatterson/pyramid_mailer@fb2a013? |
I'm on Python 3.2 (not 3.2.1 or 3.2.2), maybe that's the difference. |
Ok, I'm testing 3.2 now |
Hmm, I couldn't build build 3.2 with ssl support, I think because of http://bugs.python.org/issue12012. Without ssl, the imports in the tests are broken. So I manually applied the patch that fixes that bug: http://hg.python.org/cpython/raw-rev/20beec22764f Then I was able to reproduce the issue and commit a workaround that skips headers that would be empty strings which seems appropriate anyways. |
This was fixed with the merge of the above-mentioned pull request. Thanks Ross! |
The text was updated successfully, but these errors were encountered: