我正在使用简单的内容filter将邮件传递给perl脚本,以使用pgp密钥进行encryption。
Master.Cf在smtp下
-o content_filter=mail_encrypt:dummy
然后
mail_encrypt unix - nn - - pipe flags= user=gpgmap argv=/usr/sbin/gpgit.pl ${recipient}
Main.cf
content_filter = mail_encrypt
我使用了由Mike Cardwell编写的简单的perl脚本, https://github.com/mikecardwell/gpgit
它“看起来”像它的工作。 我发送邮件,postfix手到mail_encrypt,并给我一个成功传递的消息。
mail postfix/pipe[3149]: 3E87341017: to=<[email protected]>,relay=mail_encrypt,delay=1.6, delays=0.52/0.01/0/1.1, dsn=2.0.0, status=sent (delivered via mail_encrypt service)
但是这个消息没有任何意义。 我认为这不是交给PF来交付,但我不知道在哪里看这一点。
更新:我再次通过content_filter rfc读取并使用高级内容filter。
scan unix - - n - 10 smtp -o smtp_send_xforward_command=yes -o disable_mime_output_conversion=yes -o smtp_generic_maps= localhost:10026 inet nnn - 10 spawn user=gpgmap argv=/usr/sbin/gpgit.pl ${recipient} localhost 10027 localhost:10026 inet n - n - 10 smtpd -o content_filter= -o receive_override_options=no_unknown_recipient_checks,no_header_body_checks,no_milters -o smtpd_helo_restrictions= # -o smtpd_client_restrictions= # -o smtpd_sender_restrictions= # Postfix 2.10 and later: specify empty smtpd_relay_restrictions. # -o smtpd_relay_restrictions= -o smtpd_recipient_restrictions=permit_mynetworks,reject -o mynetworks=127.0.0.0/8 -o smtpd_authorized_xforward_hosts=127.0.0.0/8
现在我收到邮件。 但它看起来几乎像现在它跳过Perl脚本。
Aug 31 15:53:54 mail postfix/qmgr[3781]: 044944242D: from=<[email protected]>, size=1947, nrcpt=1 (queue active) Aug 31 15:53:54 mail postfix/smtp[3799]: 84D3D42428: to=<[email protected]>, relay=localhost[127.0.0.1]:10026, delay=1, delays=0.55/0.01/0.04/0.4, dsn=2.0.0, status=sent (250 2.0.0 Ok: queued as 044944242D) Aug 31 15:53:54 mail postfix/smtpd[3800]: disconnect from localhost[127.0.0.1] Aug 31 15:53:54 mail postfix/qmgr[3781]: 84D3D42428: removed Aug 31 15:53:54 mail postfix/virtual[3802]: 044944242D: to=<[email protected]>, relay=virtual, delay=0.49, delays=0.4/0.05/0/0.04, dsn=2.0.0, status=sent (delivered to maildir)
在做了一些阅读和讨论postfix-users列表pipe道的时候,这种方式并不真正支持。 Postfix正在寻找perl脚本,用sendmail命令把它交回。
我切换到使用gpg邮箱门,这是工作。