### Addressing
# The email address messages are from by default
('from', 'user@rss2email.invalid'),
+ # Transfer-Encoding. For local mailing it is safe and
+ # convient to use 8bit.
+ ('use_8bit', str(True)),
# True: Only use the 'from' address.
# False: Use the email address specified by the feed, when possible.
('force-from', str(False)),
message['From'] = _formataddr((sender_name, sender_addr))
message['To'] = _formataddr((recipient_name, recipient_addr))
message['Subject'] = _Header(subject, subject_encoding)
+ if config.getboolean(section, 'use_8bit'):
+ message['Content-Transfer-Encoding'] = '8bit'
+ message.set_payload(body)
if extra_headers:
for key,value in extra_headers.items():
encoding = guess_encoding(value, encodings)
['/usr/sbin/sendmail', recipient],
stdin=_subprocess.PIPE, stdout=_subprocess.PIPE,
stderr=_subprocess.PIPE)
- stdout,stderr = p.communicate(message.as_string().encode('ascii'))
+ stdout,stderr = p.communicate(message.as_string()
+ .encode(str(message.get_charset())))
status = p.wait()
if status:
raise _error.SendmailError(