core.mail_processor.smtp ======================== .. py:module:: core.mail_processor.smtp .. autoapi-nested-parse:: Send E-Mail through SMTP Adapted from repoze.sendmail: https://github.com/repoze/repoze.sendmail Usage: mailer = smptlib.SMTP(host, port) qp = SMTPEmailQueueProcessor(mailer, maildir1, maildir2, ..., limit=x) qp.send_messages() Attributes ---------- .. autoapisummary:: core.mail_processor.smtp.log Classes ------- .. autoapisummary:: core.mail_processor.smtp.MailQueueProcessor core.mail_processor.smtp.SMTPMailQueueProcessor Module Contents --------------- .. py:data:: log .. py:class:: MailQueueProcessor(*paths: str, limit: int | None = None) .. py:method:: split(filename: str) -> tuple[str, str, str] Returns the path, the name and the suffix of the given path. .. py:method:: message_files() -> tuple[str, Ellipsis] Returns a tuple of full paths that need processing. The file names in the directory usually look like this: * 0.1571822840.745629 * 1.1571822743.595377 The part before the first dot is the batch number the rest is the timestamp at time of calling app.send_sms. The messages are sorted by suffix, so by default the sorting happens from oldest to newest message. .. py:method:: send(filename: str, payload: str) -> bool :abstractmethod: Sends the mail and returns success as bool .. py:method:: parse(filename: str) -> str .. py:method:: send_messages() -> None .. py:method:: send_message(filename: str) -> bool .. py:class:: SMTPMailQueueProcessor(mailer: smtplib.SMTP, *paths: str, limit: int | None = None) Bases: :py:obj:`core.mail_processor.core.MailQueueProcessor` .. py:method:: parse_payload(filename: str, payload: str) -> list[email.message.EmailMessage] .. py:method:: send(filename: str, payload: str) -> bool Sends the mail and returns success as bool