Как говорится в заголовке/тегах, я запускаю sSMTP для Linux для сервера PHP.sSMTP больше не работает - 'Неверный ответ: 501 5.5.4 HELO/EHLO аргумент [email protected] недействительный, закрывающее соединение.'
Всякий раз, когда я пытаюсь отправить по электронной почте, я получаю эти ошибки (которые не отображается в PHP, только в журналах/«Суда служба Sendmail статуса» или «Суда служба php5-FPM статус»)
От /var/log/mail.log
Mar 31 03:34:34 ip-172-31-22-38 sSMTP[2004]: Creating SSL connection to host
Mar 31 03:34:34 ip-172-31-22-38 sSMTP[2004]: Invalid response: 501 5.5.4 HELO/ELO argument [email protected] invalid, closing connection. v74sm9147441pfa.7- gsmtp ([email protected])
Mar 31 03:34:34 ip-172-31-22-38 sSMTP[2004]: SSL connection using (null)
Mar 31 03:34:34 ip-172-31-22-38 sSMTP[2004]: Cannot open smtp.gmail.com:587
От /var/log/mail.err и mail.warn
Mar 31 03:34:10 ip-172-31-22-38 sSMTP[1997]: Cannot open smtp.gmail.com:587
Mar 31 03:34:34 ip-172-31-22-38 sSMTP[2004]: Invalid response: 501 5.5.4 HELO/EHLO argument [email protected] invalid, closing connection. v74sm9147441pfa.7 - gsmtp ([email protected])
Mar 31 03:34:34 ip-172-31-22-38 sSMTP[2004]: Cannot open smtp.gmail.com:587
Мой /etc/ssmtp/ssmtp.conf
#
# Config file for sSMTP sendmail
#
# The person who gets all mail for userids < 1000
# Make this empty to disable rewriting.
[email protected]
# The place where the mail goes. The actual machine name is required no
# MX records are consulted. Commonly mailhosts are named mail.domain.com
mailhub=smtp.gmail.com:587
# Where will the mail seem to come from?
#rewriteDomain=
# The full hostname
[email protected]
[email protected]
AuthPass=[removed]
UseSTARTTLS=YES
# Are users allowed to set their own From: address?
# YES - Allow the user to specify their own From: address
# NO - Use the system generated From: address
FromLineOverride=YES
Мои revaliases
root:[email protected]:smtp.gmail.com:587
localusername:[email protected]:smtp.gmail.com:587
Это было решение для меня, а также на Java. Мне пришлось использовать props.put («mail.smtp.localhost», «localhost»); – kgiannakakis