staffim/postman-bundle

Symfony 2 的邮件处理

安装: 97

依赖者: 0

建议者: 0

安全: 0

星标: 1

关注者: 6

分支: 2

开放问题: 0

类型:symfony-bundle

dev-master 2016-08-23 11:16 UTC

This package is auto-updated.

Last update: 2024-09-05 18:13:25 UTC


README

目标

邮件处理的基石(类似于 Symfony 核心的 HttpFoundation 用于 HTTP)。

安装

在您的 composer.json 中需要 staffim/postman-bundle 包并更新依赖项。

$ composer require staffim/postman-bundle:*

将 PostmanBundle 添加到应用程序的内核

    public function registerBundles()
    {
        $bundles = array(
            ...
            new Postman\PostmanBundle\PostmanBundle(),
            ...
        );
        ...
    }

使用方法

定义从您的 MTA 到 Symfony 的控制台命令的邮件管道。在 Exim 4 中,这可能通过路由器

# /etc/exim4/conf.d/router/postman
postman:
    debug_print = "R: postman for $local_part@$domain"
    driver      = accept
    transport   = postman_pipe

和传输

# /etc/exim4/conf.d/transport/postman
postman_pipe:
    debug_print = "T: postman_pipe for $local_part@$domain"
    driver      = pipe

    return_fail_output
    # Failure to exec is treated specially, and causes the message to be frozen.
    freeze_exec_fail

    path    = "/bin:/usr/bin:/usr/local/bin"
    command = "/usr/bin/php /var/www/app/app/console -e=prod postman:mail:handle"
    user    = www-data
    group   = www-data
    umask   = 022