Alpine Linux에서 메일 명령을 사용할 때 "send-mail: 애플릿을 찾을 수 없습니다"

Alpine Linux에서 메일 명령을 사용할 때 "send-mail: 애플릿을 찾을 수 없습니다"

웹앱을 실행하기 위해 도커 컨테이너에서 실행되는 알파인 리눅스를 사용하고 있습니다. webapp은 명령줄에서 mail 명령을 사용하여 이메일을 보내도록 되어 있습니다.

이를 지원하기 위해 다음과 같이 메일을 설치했습니다.

apk add mailx

메시지를 보내려고 하면 다음 오류가 발생합니다.

bash-4.3# mail [email protected]
Subject: test
EOT
Null message body; hope that's ok
bash-4.3# send-mail: applet not found

내가 뭘 잘못하고 있는지 잘 모르겠습니다. 어떤 도움이라도 높이 평가됩니다.

답변1

Alpine에는 기본 MTA가 없습니다. mailx 외에도 postfix와 같은 MTA(메일 전송 에이전트)를 설치하고 구성해야 합니다.

# 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

접미사 시작:

~ # 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

테스트 메시지를 보냅니다.

~ # mail -s "Test" [email protected]
.
EOT
Null message body; hope that's ok

관련 정보