仮想ドメインには 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