Esempio n. 1
0
    def __init__(self, settings):
        self.mfrom = settings.get("envelope_from_addr", "karl@%s" % getfqdn())
        self.bounce_from = settings.get("postoffice.bounce_from_email", self.mfrom)
        queue_path = settings.get("mail_queue_path", None)
        if queue_path is None:
            # Default to var/mail_queue
            # we assume that the console script lives in the 'bin' dir of a
            # sandbox or buildout, and that the mail_queue directory lives in
            # the 'var' directory of the sandbox or buildout
            exe = sys.executable
            sandbox = os.path.dirname(os.path.dirname(os.path.abspath(exe)))
            queue_path = os.path.join(os.path.join(sandbox, "var"), "mail_queue")
            queue_path = os.path.abspath(os.path.normpath(os.path.expanduser(queue_path)))

        QueuedMailDelivery.__init__(self, queue_path)
Esempio n. 2
0
    def __init__(self, settings):
        self.mfrom = getattr(settings, 'envelope_from_addr', None)
        queue_path = getattr(settings, "mail_queue_path", None)
        if queue_path is None:
            # Default to var/mail_queue
            # we assume that the console script lives in the 'bin' dir of a
            # sandbox or buildout, and that the mail_queue directory lives in
            # the 'var' directory of the sandbox or buildout
            exe = sys.executable
            sandbox = os.path.dirname(os.path.dirname(os.path.abspath(exe)))
            queue_path = os.path.join(
                os.path.join(sandbox, "var"), "mail_queue"
            )
            queue_path = os.path.abspath(os.path.normpath(
                os.path.expanduser(queue_path)))

        QueuedMailDelivery.__init__(self, queue_path)
Esempio n. 3
0
File: mailer.py Progetto: zagy/karl
    def __init__(self, settings):
        self.mfrom = settings.get('envelope_from_addr', None)
        self.bounce_from = settings.get('postoffice.bounce_from_email',
                                        self.mfrom)
        queue_path = settings.get("mail_queue_path", None)
        if queue_path is None:
            # Default to var/mail_queue
            # we assume that the console script lives in the 'bin' dir of a
            # sandbox or buildout, and that the mail_queue directory lives in
            # the 'var' directory of the sandbox or buildout
            exe = sys.executable
            sandbox = os.path.dirname(os.path.dirname(os.path.abspath(exe)))
            queue_path = os.path.join(os.path.join(sandbox, "var"),
                                      "mail_queue")
            queue_path = os.path.abspath(
                os.path.normpath(os.path.expanduser(queue_path)))

        QueuedMailDelivery.__init__(self, queue_path)