Anubis 作為 GPG 代理

Anubis 作為 GPG 代理

我正在嘗試設置GNU阿努比斯充當某種代理來對來自服務的電子郵件進行簽署/加密。該服務目前配置為使用我們的 SMTP 伺服器發送電子郵件。這個想法是將服務指向 Anubis,然後將 Anubis 指向 SMTP 伺服器。然後,Anubis 會在將訊息傳送到 SMTP 伺服器之前對其進行簽署/加密。

我設定了 Anubis,並作為初始測試,將其設定為修改主旨行。效果很好。當我將其更改為簽署電子郵件時,我開始在 Anubis 偵錯輸出中收到錯誤訊息。

這是阿努比斯配置:

#
# The "CONTROL" section.
# User configuration file.
#

---BEGIN CONTROL---
bind localhost:2525
remote-mta SMTP_SERVER_INFO
ssl-oneway yes 
---END---

#
# The Rule System (The RULE section)
# User configuration file only. Examples:
#

---BEGIN RULE---

gpg-passphrase "test1234"

# Process the (E)SMTP commands.

if command["mail from"] ".*<?root@localhost>?"
 STOP
fi

# Process a message header lines.

if header[From] ".*noreply.*"
  # modify [Subject] "[Anubis Proxy] &" # This action works
  gpg-sign default # This action has an error
fi

---END---

以下是與 GPG 相關的調試輸出部分:

Protocol: OpenPGP
Executable: /usr/bin/gpg2
Version: 2.0.22
Required Version: 1.4.0
Protocol: CMS
Executable: /usr/bin/gpgsm
Version: 2.0.22
Required Version: 1.9.6
Protocol: GPGCONF
Executable: /usr/bin/gpgconf
Version: 2.0.22
Required Version: 2.0.4
Protocol: Assuan
Executable: /tmp/gpg-7KgHae/S.gpg-agent
Version: 1.0
Required Version: 1.0
[2319] GPGME: General error.

我確信 gpg 設定正確,因為從gpg --sign --armor命令列可以讓我簽署一條訊息(輸入密碼後)。

我做錯了什麼導致它無法正常運作?

更新
我應該要提到的是,我從原始碼(版本 4.2)編譯了 Anubis,結果./configure顯示 GPGME 支援已啟用。

相關內容