Exim

Exim4 什麼時候設置 $sender_address_data?

  • December 23, 2015

在關於在 acl 中使用 sender=verify 的Exim 文件中,變數 $ sender_address_data is supposed to be set in an acl after a verify=sender option used in the RCPT acl: “If there is data in the $ address_data 變數在路由結束時,它的值在驗證結束時放在 $sender_address_data 中。”

但對我來說總是空白。在什麼情況下 $sender_address_data 會是非空的?

 

例子:

acl_smtp_rcpt:
 ...
 accept
   authenticated = *
   verify = sender
   logwrite = authenticated user '$authenticated_id' sending as '$sender_address' which \
       is '$sender_address_data', if error: '$sender_verify_failure'

導致 $sender_address_data 始終為空的日誌消息,並且沒有驗證錯誤:

authenticated user 'user1' sending as 'alias1@example.com' which is '', if error: ''

Exim4 套 $ sender_address_data only when $ sender_address 是由編寫配置文件的人在路由器中設置的,並且在接受路由器的末尾不會被其他命令清除;exim 本身從不自動設置值。例如,這組 $ address_data to the local part of the email address, and the value will be available as $ 導致發生路由或驗證的 acl 中的 sender_address_data:

acl_check_rcpt:
 ...
 accept
   authenticated = *
   verify = sender                                         # TRIGGER ROUTER
   logwrite = sender is local user '$sender_address_data'  # USE HERE
 ...

begin routers
...
local_user:
  driver               = accept
  domains              = +local_domains
  check_local_user
  transport            = LOCAL_DELIVERY
  address_data         = ${local_part}                     # SET HERE

引用自:https://serverfault.com/questions/731317