7

I am using alpine linux running in a docker container to run a webapp. The webapp is supposed to send emails using the mail command from the command line.

To support this, I have installed mail as follows:

apk add mailx

When I try to send a message I get the following error:

bash-4.3# mail foo@bar.com
Subject: test
EOT
Null message body; hope that's ok
bash-4.3# send-mail: applet not found

Not sure what I am doing wrong. Any help is highly appreciated.

1 Answer 1

4

There is no default MTA available in Alpine. Besides mailx, you will also need to install and configure a MTA (Mail Transfer Agent), such as 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

Start 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

Send the test message:

~ # mail -s "Test" test@boo.com
.
EOT
Null message body; hope that's ok
3
  • great. This is very helpful. I am still getting a warning: bash-4.3# send-mail: warning: smtputf8_enable is true, but EAI support is not compiled in postdrop: warning: smtputf8_enable is true, but EAI support is not compiled in, and not receiving the email. Wondering why that is.
    – user152468
    Apr 11, 2017 at 13:34
  • 1
    postconf "smtputf8_enable = no" , should do the trick, followed by a restart of Postfix
    – d3ag0s
    Apr 11, 2017 at 13:37
  • correct. Fixed.
    – user152468
    Apr 11, 2017 at 13:46

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.