大网数据广告活动
服务器运维问答

Sending mail from inside docker container

· 52CE 我爱测

I am completely new do Docker, and a total n00b to linux, so apologies if this sounds silly. I have gotten a docker system up and running on Digital Ocean, and its working nicely. I am using a pre-built Mirth Connect docker and t…

问题原文

原帖链接 · Crudler · CC BY-SA 3.0

I am completely new do Docker, and a total n00b to linux, so apologies if this sounds silly.

I have gotten a docker system up and running on Digital Ocean, and its working nicely.

I am using a pre-built Mirth Connect docker and this runs beautifully and I can do all sorts of cool things. One of the things I want my Mirth to do for me is to send an email (SMTP sender) from inside the container but it seems that a Docker Container cannot send emails (I get an error about connecting to my mail server). I have tried mapping port 25 to 25 when running that did nothing.

docker run -d --name mirth1 -p 8080:8080  -p 8443:8443 -p 25:25 -p 8585:8585 brandonstevens/mirth-connect

The linux server can telnet into my mail server on port 25, so I know its not a firewall / Digital Ocean issue. Its also not a Mirth issue because Ive dont this a billion times before. Its something inside the container

So I guess there is more to this than I thought. Googling reveals a lot of links about adding sendmail to my container, but thats for php systems?

已采纳解答

原帖链接 · Alex H · CC BY-SA 3.0

You only need 25 outbound and you need to have a default mail software for the container. You do not need the port 25 mapped for outbound connections but you do need a default mail software installed in the container like postfix or sendmail .Just add it after you started the container, test if it works, then add it to the docker file.

Please remember that containers are minimal so do not expect any extra functionality in them.

摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。

资料来源与适用范围

资料来源
Server Fault
适用范围
以原帖系统、软件版本与发布日期为准(2016-07-08)
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY-SA 3.0

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。