
나는 pgp 키를 사용하여 암호화하기 위해 간단한 콘텐츠 필터를 사용하여 메일을 Perl 스크립트로 전달하고 있습니다.
Master.Cf
smtp에서
-o content_filter=mail_encrypt:dummy
그 다음에
mail_encrypt unix - n n - - 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를 다시 읽고 고급 콘텐츠 필터를 사용했습니다.
scan unix - - n - 10 smtp
-o smtp_send_xforward_command=yes
-o disable_mime_output_conversion=yes
-o smtp_generic_maps=
localhost:10026 inet n n n - 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)
답변1
postfix-users 목록에 있는 일부 사람들을 읽고 대화한 후에 이러한 방식으로 들어오고 나가는 것은 실제로 지원되지 않습니다. Postfix는 perl 스크립트를 찾고 있으며 sendmail 명령을 사용하여 다시 돌려줍니다.
gpg-mailgate를 사용하도록 전환했는데 작동합니다.