后缀:对于某个地址,只允许来自某个域的电子邮件

我已经build立了我的服务器,为了追踪垃圾邮件的来源(并阻止它),我用来注册邮件的地址是[email protected](例如,对于Facebook,它将是[email protected])。

现在,假设我将垃圾电子邮件发送到[email protected] – (例如来自[email protected])。 我想阻止他们,但继续收到来自facebook.com域的电子邮件 – 即我想限制电子邮件到某个地址来自某个域。

这是可能的Postfix? 或者我需要额外的东西吗? (我已经在运行Dovecot了,尽pipe这似乎不是正确的工具)。

我没有使用传统的垃圾邮件filter,因为上面看起来更优雅 – 但是,如果有一个垃圾邮件filter可以实现上述,我很乐意使用它。

Haraka可以很容易地处理这种情况,而且在Postfix之前设置非常简单,这样您的当前Postfix设置就可以继续工作(或者如果您不想这样做,它可以通过LMTP直接发送到Dovecot) 。

你会设置如下的哈拉卡插件:

var net_utils = require('./net_utils'); exports.hook_rcpt = function (next, connection, params) { var recip = params[0]; if (connection.relaying) { // Already relaying (ie outbound) - skip. return next(); } // Get who this is coming from and change abexample.com into just example.com var check_domain = net_utils.get_organizational_domain(connection.transaction.mail_from.host); // Turn 'example.com' into just 'example' check_domain = check_domain.replace(/\..*$/, ''); if (check_domain.toLowerCase() != recip.user.toLowerCase()) { return next(DENY, "You dirty dirty spammer"); } next(); } 

将其添加到您的插件目录,并添加一行到config / plugins,指定您称为该文件的内容,以便将其加载到您的configuration中。