
내가 달성하려는 것은 으로 오는 모든 이메일이 [email protected]
다시 작성되어 [email protected]
으로 전달된다는 것입니다 [email protected]
.
canonical_maps
및 둘 다 virtual_alias_maps
대체 수신자에게 전달하는 작업을 수행합니다. 내가 읽을 때문서canonical_maps
를 사용 하면 cleanup
완전히 다시 작성된다는 것을 알 수 있습니다 .
그러나 실제로는 이메일에 to
원래 수신자의 이름이 그대로 남아 있습니다. 따라서 Bob의 편지함에 있는 이메일을 보면 Joe에게 보낸 이메일이 표시됩니다.
왠지 여기서 뭔가 빠진 것 같은 느낌이 듭니다.
구성:
alias_database = hash:/etc/aliases
alias_maps = hash:/etc/aliases
append_dot_mydomain = no
biff = no
bounce_queue_lifetime = 2d
canonical_maps = hash:/etc/postfix/canonical
config_directory = /etc/postfix
header_checks = pcre:/etc/postfix/header_checks
home_mailbox = Maildir/
html_directory = /usr/share/doc/postfix/html
inet_interfaces = all
mailbox_size_limit = 0
maximal_queue_lifetime = 4d
milter_default_action = accept
milter_protocol = 2
mydestination = ...
myhostname = ...
mynetworks = ...
myorigin = /etc/mailname
non_smtpd_milters = inet:localhost:8891
readme_directory = /usr/share/doc/postfix
recipient_delimiter = +
relayhost =
smtp_fallback_relay = ...
smtp_tls_session_cache_database = btree:${data_directory}/smtp_scache
smtpd_banner = $myhostname ESMTP $mail_name
smtpd_milters = inet:localhost:8891
smtpd_recipient_restrictions = check_recipient_access hash:/etc/postfix/recipient_access permit_mynetworks reject_unauth_destination
smtpd_tls_cert_file = /etc/ssl/certs/ssl-cert-snakeoil.pem
smtpd_tls_key_file = /etc/ssl/private/ssl-cert-snakeoil.key
smtpd_tls_session_cache_database = btree:${data_directory}/smtpd_scache
smtpd_use_tls = yes
transport_maps = hash:/etc/postfix/transport
virtual_alias_maps = hash:/etc/postfix/virtual
로그:
Sep 25 09:40:30 server1 postfix/smtpd[28285]: connect from mail-la0-f66.google.com[209.85.215.66]
Sep 25 09:40:31 server1 postfix/smtpd[28285]: 7CA784EDB6: client=mail-la0-f66.google.com[209.85.215.66]
Sep 25 09:40:31 server1 postfix/cleanup[28339]: 7CA784EDB6: message-id=<CAJjncucnGM532xhcn37VAwmwQoYEwOUfE_A33-oyJJH5PqPUcA@mail.gmail.com>
Sep 25 09:40:31 server1 postfix/qmgr[7593]: 7CA784EDB6: from=<[email protected]>, size=1813, nrcpt=1 (queue active)
Sep 25 09:40:32 server1 postfix/smtpd[28285]: disconnect from mail-la0-f66.google.com[209.85.215.66]
Sep 25 09:40:32 server1 postfix/smtp[28593]: 7CA784EDB6: enabling PIX workarounds: disable_esmtp delay_dotcrlf for ...[...]]:25
Sep 25 09:40:33 server1 postfix/smtp[28593]: 7CA784EDB6: to=<[email protected]>, orig_to=<[email protected]>, relay=...[...]:25, delay=1.6, delays=0.45/0/0.42/0.73, dsn=2.0.0, status=sent (250 2.0.0 Ok: queued as 98F729600E)
Sep 25 09:40:33 server1 postfix/qmgr[7593]: 7CA784EDB6: removed
답변1
mail.log를 보면 원격 클라이언트의 이메일을 다시 작성하려는 것 같습니다. postfix rewrite의 기본 설정은 이런 일이 발생하는 것을 방지합니다.
에서 발췌접미사 다시 쓰기 README
Postfix 버전 2.2에서는 원격 SMTP 클라이언트의 메시지 헤더를 전혀 다시 쓰지 않거나 메시지 헤더의 불완전한 주소에 유효하지 않은 레이블을 지정하는 옵션을 제공합니다. 작동 방식은 다음과 같습니다.
Postfix는 항상 로컬 SMTP 클라이언트와 Postfix sendmail 명령의 메시지 헤더를 다시 작성하고 불완전한 주소에 자체 도메인을 추가합니다. 이
local_header_rewrite_clients
매개변수는 Postfix가 로컬로 간주하는 SMTP 클라이언트(기본적으로 로컬 네트워크 인터페이스 주소만)를 제어합니다.
remote_header_rewrite_domain
Postfix는 매개변수 값이 비어 있으면(기본 설정) 원격 SMTP 클라이언트의 메시지 헤더 주소를 다시 쓰지 않습니다 .그렇지 않으면 Postfix는 원격 SMTP 클라이언트의 메시지 헤더를 다시 쓰고
remote_header_rewrite_domain
불완전한 주소에 값을 추가합니다. 이 기능을 사용하면 "domain.invalid"와 같은 예약된 도메인을 추가하여 불완전한 주소를 로컬 주소로 착각할 수 없습니다.
따라서 가장 간단한 해결책은 매개변수 remote_header_rewrite_domain
에 빈 값을 두지 않는 것입니다. 다음과 같은 값으로 이 매개변수에 값을 제공해야 합니다.
remote_header_rewrite_domain = domain.invalid
또는 static:all
on 매개변수를 사용하여 local_header_rewrite_clients
postfix가 모든 원격 클라이언트를 로컬로 간주하도록 할 수 있습니다.
local_header_rewrite_clients = static:all