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

_mail_recipient header override #3781

Closed
ggcatu opened this issue Aug 23, 2017 · 3 comments
Closed

_mail_recipient header override #3781

ggcatu opened this issue Aug 23, 2017 · 3 comments
Assignees

Comments

@ggcatu
Copy link
Contributor

ggcatu commented Aug 23, 2017

CKAN Version if known (or site URL)

ckan/ckan/lib/mailer.py

Lines 30 to 36 in 3fa8d9b

def _mail_recipient(recipient_name, recipient_email,
sender_name, sender_url, subject,
body, headers={}):
mail_from = config.get('smtp.mail_from')
msg = MIMEText(body.encode('utf-8'), 'plain', 'utf-8')
for k, v in headers.items():
msg[k] = v

Mailer is actually adding more keys to the MIMEText, isntead of replacing them.

Please describe the expected behaviour

To change the Content-Type to the new one

Please describe the actual behaviour

The old Content-Type is kept, but a new Content-Type key is created

@amercader amercader self-assigned this Aug 24, 2017
@amercader
Copy link
Member

@ggcatu This sounds really sensible and looks like you know where the code should be changed. Do you want to submit a PR for this?

@ggcatu
Copy link
Contributor Author

ggcatu commented Aug 25, 2017

Check #3784

@amercader
Copy link
Member

Thanks @ggcatu

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

No branches or pull requests

2 participants