
Estou usando o Alpine Linux rodando em um contêiner docker para executar um webapp. O webapp deve enviar e-mails usando o comando mail da linha de comando.
Para suportar isso, instalei o email da seguinte maneira:
apk add mailx
Quando tento enviar uma mensagem recebo o seguinte erro:
bash-4.3# mail [email protected]
Subject: test
EOT
Null message body; hope that's ok
bash-4.3# send-mail: applet not found
Não tenho certeza do que estou fazendo de errado. Qualquer ajuda é muito apreciada.
Responder1
Não há MTA padrão disponível no Alpine. Além do mailx, você também precisará instalar e configurar um MTA (Mail Transfer Agent), como o postfix:
# apk add postfix
(1/3) Installing db (5.3.28-r0)
(2/3) Installing libsasl (2.1.26-r8)
(3/3) Installing postfix (3.1.3-r0)
Executing postfix-3.1.3-r0.pre-install
Executing busybox-1.25.1-r0.trigger
OK: 8 MiB in 16 packages
Iniciar postfix:
~ # postfix start
postfix/postfix-script: warning: not owned by root: /var/spool/postfix/.
postfix/postfix-script: warning: not owned by root: /var/spool/postfix/pid
postfix/postfix-script: starting the Postfix mail system
Envie a mensagem de teste:
~ # mail -s "Test" [email protected]
.
EOT
Null message body; hope that's ok