Sendmail пытается переслать вашу электронную почту через SMTP-сервер, расположенный здесь: mail.example.com . Это встроенная конфигурация по умолчанию для sendmail на этом образе.
То, что вы хотите сделать, это передать конфигурацию google SMTP для sendmail, как это:
echo "Subject: test" | sendmail -v -f your@mail.com -au<your-gmail-account> -ap<your-gmail-password> -H 'openssl s_client -quiet -tls1 -connect smtp.gmail.com:465' your@mail.com
Практический пример для:
- учетная запись Gmail: your@gmail.com
- пароль Gmail: 123456
будет выглядеть так:
echo "Subject: test" | sendmail -v -f your@mail.com -auyour@gmail.com -ap123456 -H 'openssl s_client -quiet -tls1 -connect smtp.gmail.com:465' your@mail.com
sendmail --help
Для справки вот sendmail --help
. Вы можете получить это из изображения, которое вы используете с:
docker run --rm php:fpm-alpine sendmail --help
BusyBox v1.29.3 (2019-01-24 07:45:07 UTC) multi-call binary.
Usage: sendmail [-tv] [-f SENDER] [-amLOGIN 4<user_pass.txt | -auUSER -apPASS]
[-w SECS] [-H 'PROG ARGS' | -S HOST] [RECIPIENT_EMAIL]...
Read email from stdin and send it
Standard options:
-t Read additional recipients from message body
-f SENDER For use in MAIL FROM:<sender>. Can be empty string
Default: -auUSER, or username of current UID
-o OPTIONS Various options. -oi implied, others are ignored
-i -oi synonym, implied and ignored
Busybox specific options:
-v Verbose
-w SECS Network timeout
-H 'PROG ARGS' Run connection helper. Examples:
openssl s_client -quiet -tls1 -starttls smtp -connect smtp.gmail.com:25
openssl s_client -quiet -tls1 -connect smtp.gmail.com:465
$SMTP_ANTISPAM_DELAY: seconds to wait after helper connect
-S HOST[:PORT] Server (default $SMTPHOST or 127.0.0.1)
-amLOGIN Log in using AUTH LOGIN (-amCRAM-MD5 not supported)
-auUSER Username for AUTH
-apPASS Password for AUTH
If no -a options are given, authentication is not done.
If -amLOGIN is given but no -au/-ap, user/password is read from fd #4.
Other options are silently ignored; -oi is implied.
Use makemime to create emails with attachments.