Email

後綴始終密件抄送 root@hostname.domain.com

  • July 13, 2019

我正在嘗試為我的 LAN 設置一個後綴中繼系統。我的很多服務都被 WAN 訪問阻止了,我希望能夠從它們那裡獲得通知。

就目前而言,它目前“有效”,但每封電子郵件都附有“Mailer Deamon Undeliverable”電子郵件,因為它發送正確但總是嘗試密件抄送:root@hostname.domain.com這無法解決。我只將@domain.com 用於電子郵件。

這是我對“來賓”VM 的配置(通過 發送relayhost),我已經嘗試了很多,但沒有任何想法,感謝您的幫助。

我想知道我是否可以在relayhostvs 客人中以某種方式解決這個問題?

/etc/postfix/main.cf
smtpd_banner = $myhostname ESMTP $mail_name (Ubuntu)                                                                                                                                                                                                                  
biff = no                                                                                                                                                                                                                                                             
append_dot_mydomain = no                                                                                                                                                                                                                                              
readme_directory = no                                                                                                                                                                                                                                                 
smtpd_tls_cert_file=/etc/ssl/certs/ssl-cert-snakeoil.pem                                                                                                                                                                                                              
smtpd_tls_key_file=/etc/ssl/private/ssl-cert-snakeoil.key                                                                                                                                                                                                             
smtpd_use_tls=yes                                                                                                                                                                                                                                                     
smtpd_tls_session_cache_database = btree:${data_directory}/smtpd_scache                                                                                                                                                                                               
smtp_tls_session_cache_database = btree:${data_directory}/smtp_scache                                                                                                                                                                                                 
smtpd_relay_restrictions = permit_mynetworks permit_sasl_authenticated defer_unauth_destination                                                                                                                                                                       
myhostname = domain.com                                                                                                                                                                                                                                  
alias_maps = hash:/etc/aliases                                                                                                                                                                                                                                        
alias_database = hash:/etc/aliases                                                                                                                                                                                                                                    
myorigin = domain.com                                                                                                                                                                                                                                    
mydestination = domain.com, localhost                                                                                                                                                                                                                    
relayhost = smtp.domain.com                                                                                                                                                                                                                              
mynetworks = 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128                                                                                                                                                                                                             
mailbox_size_limit = 0                                                                                                                                                                                                                                                
recipient_delimiter = +                                                                                                                                                                                                                                               
inet_interfaces = loopback-only                                                                                                                                                                                                                                       
inet_protocols = all                                                                                                                                                                                                                                                  
masquerade_domains = domain.com  

#THINGS I HAVE TRIED...##
#smtp_header_checks = regexp:/etc/postfix/header_checks                                                                                                                                                                                                                          
#transport_maps = hash:/etc/postfix/transport                                                                                                                                                                                                                         
#smtpd_recipient_restrictions = check_recipient_access hash:/etc/postfix/bad_recipients, permit_mynetworks, reject_unauth_destination, permit                                                                                                                         
#transport_maps = pcre:/etc/postfix/transport_maps                                                                                                                                                                                                                    
#smtp_generic_maps = hash:/etc/postfix/generic                                                                                                                                                                                                                        


/etc/aliases

postmaster:    root                                                                                                                                                                                                                                                   
root: user@domain.com                                                                                                                                                                                                                                   
trash: /tmp/mail.trash                                                                                                                                                                                                                                                

我有一個問題mydestination。我不應該domain.com在那個領域。我將其刪除並將其設置為mydestination = hostname hostname.domain.com localhost,現在它按預期工作。

引用自:https://unix.stackexchange.com/questions/529954