EXIM 라우터에서 오염된 도메인을 수정하는 방법

EXIM 라우터에서 오염된 도메인을 수정하는 방법

파일 데이터가 오염되는 문제에 직면해 있습니다. $domain 대신 $domain_data를 사용해 보았지만 여전히 오염된 데이터를 수정할 수 없습니다.

오류 로그 main.log

2022-09-06 12:55:31 1oVdjO-000WZa-39 => info <[email protected]> R=localuser T=local_delivery
2022-09-06 12:55:31 1oVdjO-000WZa-39 == [email protected] R=autoreplay T=userautoreply defer (13): Permission denied: Tainted '/etc/exim/domains/example.com/autoreply.info.msg' (file for userautoreply transport) not permitted

도메인 이름(아래 표시)을 수동으로 전송에 넣으면 정상적으로 작동합니다.

# TRANSPORTS CONFIGURATION
userautoreply:
  driver = autoreply
  file = /etc/exim/domains/example.com/autoreply.info.msg
  debug_print = "${local_part}@${domain}"
  from = "${local_part}@${domain}"
  headers = Content-Type: text/plain; charset=utf-8;\nContent-Transfer-Encoding: 8bit
  subject = "${if def:h_Subject: {Autoreply: \"${rfc2047:$h_Subject:}\"} {Autoreply Message}}"
  to = "${sender_address}"

exex 구성은 다음과 같습니다.

도메인 이름 목록

domainlist local_domains = lsearch;/etc/localdomains
domainlist relay_to_domains = +local_domains
localpartlist path_safe_localparts = \N^\.*[^./][^/]*$\N
# ROUTERS CONFIGURATION
autoreplay:
  driver = accept
  require_files = /etc/exim/domains/${lookup{$domain_data}dsearch{/etc/exim/domains/}}/autoreply.${local_part}.msg
  condition = ${if exists{/etc/exim/domains/${lookup{$domain_data}dsearch{/etc/exim/domains/}}/autoreply.${local_part}.msg}{yes}{no}}
  domains = !$primary_hostname : +local_domains
  local_parts = +path_safe_localparts
  retry_use_local_part
  transport = userautoreply
  unseen

아래는 디버그 로그입니다.

12:49:31.797 124677 --------> autoreplay router <--------
12:49:31.797 124677 local_part=info domain=example.com
12:49:31.797 124677 checking domains
12:49:31.798 124677  ╭considering: !$primary_hostname : +local_domains
12:49:31.798 124677  ├───────text: !
12:49:31.798 124677  ├considering: $primary_hostname : +local_domains
12:49:31.798 124677  ├considering:  : +local_domains
12:49:31.798 124677  ├───────text:  : +local_domains
12:49:31.798 124677  ├──expanding: !$primary_hostname : +local_domains
12:49:31.798 124677  ╰─────result: !localhost.localdomain : +local_domains
12:49:31.798 124677 cached yes match for +local_domains
12:49:31.798 124677 cached lookup data = 
12:49:31.798 124677 example.com in "!localhost.localdomain : +local_domains"? yes (matched "+local_domains" - cached)
12:49:31.798 124677 checking local_parts
12:49:31.798 124677  ╭considering: \N^\.*[^./][^/]*$\N
12:49:31.798 124677  ├──protected: ^\.*[^./][^/]*$
12:49:31.798 124677  ├──expanding: \N^\.*[^./][^/]*$\N
12:49:31.798 124677  ╰─────result: ^\.*[^./][^/]*$
12:49:31.798 124677 info in "^\.*[^./][^/]*$"? yes (matched "^\.*[^./][^/]*$")
12:49:31.798 124677 info in "+path_safe_localparts"? yes (matched "+path_safe_localparts")
12:49:31.798 124677 checking require_files
12:49:31.798 124677  ╭considering: /etc/exim/domains/${lookup{$domain_data}dsearch{/etc/exim/domains/}}/autoreply.${local_part}.msg
12:49:31.798 124677  ├───────text: /etc/exim/domains/
12:49:31.798 124677  ├considering: ${lookup{$domain_data}dsearch{/etc/exim/domains/}}/autoreply.${local_part}.msg
12:49:31.798 124677   ╭considering: $domain_data}dsearch{/etc/exim/domains/}}/autoreply.${local_part}.msg
12:49:31.798 124677   ├considering: }dsearch{/etc/exim/domains/}}/autoreply.${local_part}.msg
12:49:31.798 124677   ├──expanding: $domain_data
12:49:31.798 124677   ╰─────result: 
12:49:31.798 124677   ╭considering: /etc/exim/domains/}}/autoreply.${local_part}.msg
12:49:31.798 124677   ├───────text: /etc/exim/domains/
12:49:31.798 124677   ├considering: }}/autoreply.${local_part}.msg
12:49:31.798 124677   ├──expanding: /etc/exim/domains/
12:49:31.798 124677   ╰─────result: /etc/exim/domains/
12:49:31.798 124677  search_open: dsearch "/etc/exim/domains/"
12:49:31.798 124677  search_find: file="/etc/exim/domains/"
12:49:31.798 124677    key="" partial=-1 affix=NULL starflags=0 opts=NULL
12:49:31.798 124677  LRU list:
12:49:31.798 124677    5/etc/exim/domains/
12:49:31.798 124677    :/etc/localdomains
12:49:31.798 124677    End
12:49:31.798 124677  internal_search_find: file="/etc/exim/domains/"
12:49:31.798 124677    type=dsearch key="" opts=NULL
12:49:31.798 124677  ├───item-res: 
12:49:31.798 124677  ├considering: /autoreply.${local_part}.msg
12:49:31.798 124677  ├───────text: /autoreply.
12:49:31.798 124677  ├considering: ${local_part}.msg
12:49:31.798 124677  ├considering: .msg
12:49:31.798 124677  ├───────text: .msg
12:49:31.798 124677  ├──expanding: /etc/exim/domains/${lookup{$domain_data}dsearch{/etc/exim/domains/}}/autoreply.${local_part}.msg
12:49:31.798 124677  ╰─────result: /etc/exim/domains//autoreply.info.msg
12:49:31.798 124677             ╰──(tainted)
12:49:31.798 124677 file check: /etc/exim/domains/${lookup{$domain_data}dsearch{/etc/exim/domains/}}/autoreply.${local_part}.msg
12:49:31.798 124677 expanded file: /etc/exim/domains//autoreply.info.msg
12:49:31.798 124677 stat() yielded -1
12:49:31.798 124677 errno = 2
12:49:31.798 124677 autoreplay router skipped: file check
12:49:31.798 124677 --------> aliases router <--------
12:49:31.798 124677 local_part=info domain=example.com
12:49:31.798 124677 checking require_files
12:49:31.798 124677  ╭considering: /etc/exim/domains/$domain/aliases
12:49:31.798 124677  ├───────text: /etc/exim/domains/
12:49:31.798 124677  ├considering: $domain/aliases
12:49:31.798 124677  ├considering: /aliases
12:49:31.798 124677  ├───────text: /aliases
12:49:31.798 124677  ├──expanding: /etc/exim/domains/$domain/aliases
12:49:31.798 124677  ╰─────result: /etc/exim/domains/example.com/aliases
12:49:31.798 124677             ╰──(tainted)
12:49:31.798 124677 file check: /etc/exim/domains/$domain/aliases
12:49:31.798 124677 expanded file: /etc/exim/domains/example.com/aliases
12:49:31.798 124677 stat() yielded -1
12:49:31.798 124677 errno = 2
12:49:31.798 124677 aliases router skipped: file check

답변1

나는 local_part가 오염된 것으로 간주한다고 생각합니다. ${local_part}를 ${local_part_data}로 바꿔야 합니다.

관련 정보