簡體   English   中英

無法通過后綴在 MacOS 中正確發送電子郵件

[英]Cannot properly send email in MacOS via postfix

講故事短。 我的 MacOS 版本是:12.4。

在 /etc/postfix/ 中:

sasl_passwd我有:

smtp.emailsrvr.com:587 <myEmail>:<password> 

main.cf我有:

# custom POSTFIX email sender config
relayhost = smtp.emailsrvr.com:587
smtp_sasl_auth_enable=yes
smtp_sasl_password_maps=hash:/etc/postfix/sasl_passwd
smtp_sasl_mechanism_filter = plain
# also tried AUTH LOGIN in the line above
smtp_sasl_security_options =
smtp_use_tls=yes
smtp_tls_security_level=encrypt
tls_random_source = dev:/dev/urandom

我在網絡設置中的默認 DNS 是 8.8.8.8 - 標准的 Google DNS。

我做了我的sasl_passwdpostmap (ing), postfix重新加載......第一次通過以下方式發送電子郵件后:

sudo echo "testing testing test email" | mail -s test <someTargetEmail>

在我的 gmail 帳戶中使用sasl_passwd時,我收到了SASL Authorization error

然后找到有關需要在 gmail 帳戶中啟用的信息,例如"ACCESS OF ANOTHER SOURCES" 然后將我的原始電子郵件從sasl_passwd 更改為來自@bk.ru 域的另一封電子郵件。

在我發送電子郵件時再次重做/重新啟動之后 - 沒有發生錯誤,我在mailq中獲得了電子郵件 ID 和描述:

"-Queue ID-  --Size-- ----Arrival Time---- -Sender/Recipient-------
B7BD6301AB98DC*     305 Fri Jun 17 23:23:49  mac@Mac.local
                                         <targetEmail>"

但是到處都沒有在targetEmail帳戶中找到任何消息。 有人可以幫助我了解情況並解決問題,謝謝。

最后我自己解決了。


我在...main.cf的自定義設置中添加/編輯了這個:

mydomain = localhost
myorigin = $mydomain
smtp_sasl_security_options = noanonymous
inet_protocols = ipv4

在 Google Gmail 帳戶中添加了輔助應用密碼和 2 因素身份驗證。 sasl_passwd中連接生成的密碼。

mailq中,有時郵件會在一秒鍾內被卡住或留下,但尚未收到。 一旦問題出現在發件人驗證中,然后是 ipv6 和空安全選項。 重做然后postmap和重新加載postfix然后就完成了工作,突然間一切都開始工作了。

並在這里找到了非常有用的信息

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM