如何停止一个循环我已经介绍了一个过渡postfix-spamassassin-dovecot设置

我处于陡峭的电子邮件处理学习曲线的早期阶段,温柔的赞赏:-)。

我有一个设置与后缀dovecot。 我试图将我的电子邮件服务器(域example.com )从我家迁移到其他地方( test.example.com )运行的实例。 这个想法是,当事情似乎工作,我会改变DNS和取代test.example.com example.com )。 我怀疑我所拥有的问题可能是过渡性的,但希望得到任何validation。

在我的旧服务器上,我有实际的Unix账户,并在/ etc /别名中有以下内容:

 a: \a, b 

以便发送到[email protected]电子邮件除了本地副本外, [email protected]转发到[email protected]

在我的新服务器上(目前test.example.com [email protected], [email protected] ),我有虚拟用户[email protected], [email protected]$virtual_alias_maps包含

 @test.example.com @example.com [email protected] [email protected], [email protected] 

其中发送到[email protected]电子邮件将按照预期的方式交付,而无需循环。

然后,我以下面的方式将spamassassin添加到main.cf中,似乎只有一个例外。

 smtp inet n - - - - smtpd -o content_filter=spamassassin spamassassin unix - nn - - pipe user=debian-spamd argv=/usr/bin/spamc -f -e /usr/sbin/sendmail -oi -f ${sender} ${recipient} 

现在,当我将电子邮件发送到[email protected] ,我在邮箱[email protected]获得一份副本,在邮箱[email protected] 两份副本。

看起来扩张发生两次,这让我感到惊讶。

我的问题是:

  1. 为什么扩张发生两次?
  2. 当我更改DNS并删除test. 从我的configuration将这个问题消失(这是否是一个过渡性问题)?
  3. 如果2.的答案是否定的,你有什么build议吗?

这是在你把spamassassin东西之前通过postfix守护进程的电子邮件之旅

 Email for [email protected] -> aliased to [email protected] and [email protected] -> final destination 

spamassassin东西,基本上你把内容filter后缀堆栈,从而电子邮件旅程成为

 Email for [email protected] -> aliased to [email protected] and [email protected] -> spamassassin 

从spamassassin,后缀是由两个电子邮件注入

 Email for [email protected] -> aliased to [email protected] and [email protected] -> final destination Email for [email protected] -> final destination 

这就解释了为什么您在[email protected][email protected]中有两封电子邮件


解决scheme

Postfix有参数receive_override_optionsno_address_mappings来处理这个。 把它放在内容filter之前,你将不会得到重复的电子邮件。

 smtp inet n - - - - smtpd -o content_filter=spamassassin -o receive_override_options=no_address_mappings spamassassin unix - nn - - pipe user=debian-spamd argv=/usr/bin/spamc -f -e /usr/sbin/sendmail -oi -f ${sender} ${recipient}