0
我寫了一個插件來根據數據庫將一些電子郵件轉發到另一封電子郵件。haraka:MX沒有A記錄
代碼最簡單的像下面這樣:
exports.hook_rcpt = function (next, connection, params) {
var rcpt = params[0];
if (rcpt.host == "xxx.com") {
it.logwarn("====skdlf");
var address = // get address from database according rcpt.user
var toAddress = new Address('<' + address + '>');
connection.transaction.rcpt_to.pop();
connection.transaction.rcpt_to.push(toAddress);
connection.relaying = true
next(OK);
return;
}
next(DENYSOFT, "not found user account");
}
但是,它似乎在服務器從來沒有碰到上面的任何代碼。 ,我也得到了以下錯誤:
[INFO] [38A98778-D1E0-4064-AF11-0A54720063A8] [access] pass:unlisted(conn)
[INFO] [38A98778-D1E0-4064-AF11-0A54720063A8] [access] pass:unlisted(conn), connect:any
[ERROR] [38A98778-D1E0-4064-AF11-0A54720063A8] [dnsbl] no zones
[INFO] [38A98778-D1E0-4064-AF11-0A54720063A8] [access] pass:unlisted(conn), connect:any, helo:any
[ERROR] [38A98778-D1E0-4064-AF11-0A54720063A8] [helo.checks] forward_dns(Error: queryA ESERVFAIL smtpbg63.qq.com.)
[INFO] [38A98778-D1E0-4064-AF11-0A54720063A8.1] [access] pass:unlisted(mail)
[INFO] [38A98778-D1E0-4064-AF11-0A54720063A8.1] [access] pass:unlisted(conn), connect:any, helo:any, mf/rt:any
[INFO] [38A98778-D1E0-4064-AF11-0A54720063A8.1] [core] hook=mail plugin=mail_from.is_resolvable function=hook_mail params="<[email protected]>" retval=DENY msg="MX without A records"
[NOTICE] [38A98778-D1E0-4064-AF11-0A54720063A8.1] [core] sender <[email protected]> code=DENY msg="MX without A records"
[NOTICE] [38A98778-D1E0-4064-AF11-0A54720063A8.1] [core] disconnect ip=103.7.29.150 rdns="smtpbg63.qq.com" helo="smtpbg63.qq.com" relay=N early=N esmtp=Y tls=N pipe=N txns=1 rcpts=0/0/0 msgs=0/0/0 bytes=0 lr="550 MX without A records" time=10.166
[NOTICE] [5EE4F7EA-7003-4E28-80BC-26A0E0B1CB1A] [core] connect ip=14.17.32.37 port=38176 local_ip=:: local_port=25
[INFO] [5EE4F7EA-7003-4E28-80BC-26A0E0B1CB1A] [access] pass:unlisted(conn)
[INFO] [5EE4F7EA-7003-4E28-80BC-26A0E0B1CB1A] [access] pass:unlisted(conn), connect:any
[ERROR] [5EE4F7EA-7003-4E28-80BC-26A0E0B1CB1A] [dnsbl] no zones
[INFO] [5EE4F7EA-7003-4E28-80BC-26A0E0B1CB1A] [access] pass:unlisted(conn), connect:any, helo:any
[ERROR] [5EE4F7EA-7003-4E28-80BC-26A0E0B1CB1A] [helo.checks] forward_dns(Error: queryA ESERVFAIL smtpbg326.qq.com.)
[INFO] [5EE4F7EA-7003-4E28-80BC-26A0E0B1CB1A.1] [access] pass:unlisted(mail)
[INFO] [5EE4F7EA-7003-4E28-80BC-26A0E0B1CB1A.1] [access] pass:unlisted(conn), connect:any, helo:any, mf/rt:any
[INFO] [5EE4F7EA-7003-4E28-80BC-26A0E0B1CB1A.1] [core] hook=mail plugin=mail_from.is_resolvable function=hook_mail params="<[email protected]>" retval=DENY msg="MX without A records"
[NOTICE] [5EE4F7EA-7003-4E28-80BC-26A0E0B1CB1A.1] [core] sender <[email protected]> code=DENY msg="MX without A records"
[NOTICE] [5EE4F7EA-7003-4E28-80BC-26A0E0B1CB1A.1] [core] disconnect ip=14.17.32.37 rdns="smtpbg326.qq.com" helo="smtpbg326.qq.com" relay=N early=N esmtp=Y tls=N pipe=N txns=1 rcpts=0/0/0 msgs=0/0/0 bytes=0 lr="550 MX without A records" time=10.901
對不起缺乏對電子郵件服務器的知識,但什麼是解決問題的關鍵,我希望創造一個轉發服務器
謝謝。