我剛剛買了一個新的「公共雲」來把我的新網站放在上面。如何配置exim4使用我自己的域名在VPS上發送和接收電子郵件?
此公共雲位於「高級區域」,這意味着我部署的每個實例都位於具有專用IP(10.1.1.x)的NAT網絡中,並且全局網絡前面有防火牆可以控制IN和OUT端口。
我已經爲Debian 8部署了兩個實例,一個用於網絡服務器&另一個用於數據庫。 我有自己的域名(比如說「mydomain.com」),我希望我的網站能夠使用此域名發送電子郵件(FROM將是「[email protected]」),我希望接收網站用戶發送的電子郵件(至[email protected]),例如使用Thunderbird或Outlook。
Exim4已經安裝在網絡服務器上(默認安裝在Debian 8中),我用dpkg-reconfigure exim4-config
來重新配置它。這是我的不同文件的內容。
/etc/exim4/update-exim4.conf.conf
dc_eximconfig_configtype='internet'
dc_other_hostnames='contact.mydomain.com'
dc_local_interfaces='127.0.0.1'
dc_readhost=''
dc_relay_domains=''
dc_minimaldns='false'
dc_relay_nets=''
dc_smarthost=''
CFILEMODE='644'
dc_use_split_config='false'
dc_hide_mailname=''
dc_mailname_in_oh='true'
dc_localdelivery='mail_spool'
/etc/hosts中:
ROUTER_IP mydomain.com contact
的/ etc /主機名:
contact
的/ etc /電子郵件地址:
[email protected]
當我鍵入hostname
:接觸
當我鍵入hostname -d
:COM
當我鍵入hostname -f
:mydomain.com
在我的DNS我創建了SPF類型的區域,以避免垃圾郵件。那就是:
TTL = 600/Target = "v=spf1 a mx ptr ~all"
我嘗試使用此命令發送電子郵件:
echo "This is a test." | mail -s Testing [email protected]
當我發送郵件到Gmail,我收到一封電子郵件,從root ([email protected])
而不是[email protected]
當我發送電子郵件到我自己的personnal地址,我在exim4 mainlog /var/log/exim4/mainlog
錯誤:
SMTP error from remote mail server after RCPT TO:<[email protected]>: host mail.myserver.com [37.xx.xx.Xx]: 504 5.5.2 <contact>: Helo command rejected: need fully-qualified hostname
我不明白我在做什麼錯。你有什麼想法嗎?
在此先感謝!
問候,
朱利安Q.