import smtplib as _smtplib
import subprocess as _subprocess
import sys as _sys
+import uuid as _uuid
from . import LOG as _LOG
from . import config as _config
encoding = guess_encoding(value, encodings)
message[key] = _Header(value, encoding)
+def get_id():
+ """Return a random, universally unique ID
+
+ Conforming to RFC 2822 [1].
+
+ [1]: http://tools.ietf.org/html/rfc2822#section-3.6
+ """
+ return '<{}@dev.null.invalid>'.format(_uuid.uuid4())
+
def get_mimetext(body, content_type='plain', config=None, section='DEFAULT'):
"""Generate a text/* `Message` instance.
import time as _time
import urllib.error as _urllib_error
import urllib.request as _urllib_request
-import uuid as _uuid
import xml.sax as _sax
import xml.sax.saxutils as _saxutils
subject = self._get_entry_title(entry)
extra_headers = _collections.OrderedDict((
('Date', self._get_entry_date(entry)),
- ('Message-ID', '<{}@dev.null.invalid>'.format(_uuid.uuid4())),
+ ('Message-ID', _email.get_id()),
('User-Agent', 'rss2email'),
('X-RSS-Feed', self.url),
('X-RSS-ID', id_),