为什么 exim4 接受我的消息,尽管我告诉它不应该(通过 require_files)?

为什么 exim4 接受我的消息,尽管我告诉它不应该(通过 require_files)?

我将 exim 用于虚拟域。我创建了以下路由器:

domains_virtual:
  debug_print = "R: domains_virtual for $local_part@$domain"
  driver = accept
  domains = /etc/exim4/domains_virtual.txt
  require_files = /var/mail/virtual/$domain_data/$local_part_data
  transport = virtual_mailbox
  cannot_route_message = Unknown virtual user $local_part@$domain

[email protected]我发送了一封不应被接受的测试邮件:

# ls -la /var/mail/virtual/example.local
insgesamt 30
drwxrwsr-x 3 root mailuser  4 10. Sep 07:34 .
drwxrwsr-x 4 root mailuser  4 10. Sep 06:20 ..
-rw-r--r-- 1 root mailuser 92 10. Sep 06:26 .aliases
drwxrws--- 5 root mailuser  5  9. Mär 2011  ouzncwso
#

然而消息被接受并且 exim 创建了 maildir oehtgczb

为什么?否则我怎么能告诉它呢?

编辑:是的,调用路由器:

# exim4 -bt [email protected]
R: domains_virtual_forward for [email protected]
R: domains_virtual for [email protected]
[email protected]
  router = domains_virtual, transport = virtual_mailbox

这是我与 localhost 进行 SMTP 会话时的日志:

2021-09-10 09:38:50.990 [32472] SMTP connection from [127.0.0.1]:57196 I=[127.0.0.1]:25 (TCP/IP connection count = 2)
2021-09-10 09:39:27.136 [34113] 1mOb84-0008sD-82 SA: Debug: SAEximRunCond expand returned: ''
2021-09-10 09:39:27.137 [34113] 1mOb84-0008sD-82 SA: Action: Not running SA because SAEximRunCond expanded to false (Message-Id: 1mOb84-0008sD-82). From <test@localhost> (host=localhost [127.0.0.1]) for [email protected]
2021-09-10 09:39:27.161 [34113] 1mOb84-0008sD-82 <= test@localhost H=localhost (x) [127.0.0.1]:57196 I=[127.0.0.1]:25 P=smtp S=477 M8S=0 RT=6s id*[email protected] from <test@localhost> for [email protected]
2021-09-10 09:39:27.182 [34120] 1mOb84-0008sD-82 Warning: Tainted '/var/mail/virtual/example.local/oehtgczb' (file or directory name for virtual_mailbox transport) not permitted
2021-09-10 09:39:27.201 [34119] 1mOb84-0008sD-82 => oehtgczb <[email protected]> F=<test@localhost> P=<test@localhost> R=domains_virtual T=virtual_mailbox S=596 QT=6s DT=0.021s
2021-09-10 09:39:27.202 [34119] 1mOb84-0008sD-82 Completed QT=6s
2021-09-10 09:39:28.899 [34113] SMTP connection from localhost (x) [127.0.0.1]:57196 I=[127.0.0.1]:25 closed by QUIT

答案1

我想我有一个解决方案。使用local_parts而不是require_files

domains_virtual:
  debug_print = "R: domains_virtual for $local_part@$domain"
  driver = accept
  domains = /etc/exim4/domains_virtual.txt
  local_parts = dsearch;/var/mail/virtual/$domain_data
  transport = virtual_mailbox
  cannot_route_message = Unknown virtual user $local_part@$domain

相关内容