I an running CentOS7 in a docker container. I need to send email from that container so I installed sendmail and then I run:
m4 /etc/mail/sendmail.mc > /etc/mail/sendmail.cf` and when I try and send mail it fails with:
larry.martll@gmail.com... Connecting to [127.0.0.1] via relay... larry.martll@gmail.com... Deferred: Connection refused by [127.0.0.1]
Anyone know how I can configure sendmail so that I can send mail?
On 2 October 2017 at 17:21, Larry Martell larry.martell@gmail.com wrote:
I an running CentOS7 in a docker container. I need to send email from that container so I installed sendmail and then I run:
m4 /etc/mail/sendmail.mc > /etc/mail/sendmail.cf` and when I try and send mail it fails with:
larry.martll@gmail.com... Connecting to [127.0.0.1] via relay... larry.martll@gmail.com... Deferred: Connection refused by [127.0.0.1]
Anyone know how I can configure sendmail so that I can send mail?
Does this help any?
https://stackoverflow.com/questions/26215021/configure-sendmail-inside-a-doc...
CentOS mailing list CentOS@centos.org https://lists.centos.org/mailman/listinfo/centos
On Mon, Oct 2, 2017 at 5:29 PM, Stephen John Smoogen smooge@gmail.com wrote:
On 2 October 2017 at 17:21, Larry Martell larry.martell@gmail.com wrote:
I an running CentOS7 in a docker container. I need to send email from that container so I installed sendmail and then I run:
m4 /etc/mail/sendmail.mc > /etc/mail/sendmail.cf` and when I try and send mail it fails with:
larry.martll@gmail.com... Connecting to [127.0.0.1] via relay... larry.martll@gmail.com... Deferred: Connection refused by [127.0.0.1]
Anyone know how I can configure sendmail so that I can send mail?
Does this help any?
https://stackoverflow.com/questions/26215021/configure-sendmail-inside-a-doc...
That post is a bit overwhelming. It has 20+ answers and all are different.
I have another container running debian buster and in there I do"
yes yes | sendmailconfig
and then I can send mail. But I don't see sendmailconfig in CentOS7. Is there an equivalent?
On 2 October 2017 at 18:03, Larry Martell larry.martell@gmail.com wrote:
On Mon, Oct 2, 2017 at 5:29 PM, Stephen John Smoogen smooge@gmail.com wrote:
On 2 October 2017 at 17:21, Larry Martell larry.martell@gmail.com wrote:
I an running CentOS7 in a docker container. I need to send email from that container so I installed sendmail and then I run:
m4 /etc/mail/sendmail.mc > /etc/mail/sendmail.cf` and when I try and send mail it fails with:
larry.martll@gmail.com... Connecting to [127.0.0.1] via relay... larry.martll@gmail.com... Deferred: Connection refused by [127.0.0.1]
Anyone know how I can configure sendmail so that I can send mail?
Does this help any?
https://stackoverflow.com/questions/26215021/configure-sendmail-inside-a-doc...
That post is a bit overwhelming. It has 20+ answers and all are different.
I have another container running debian buster and in there I do"
yes yes | sendmailconfig
and then I can send mail. But I don't see sendmailconfig in CentOS7. Is there an equivalent?
Sendmail is not the standard email server for EL7 so I am a bit rusty here. The item that caught my attention was the following:
------ I figured out a way myself, although not the most elegant solution. I configured the sendmail inside my docker so as to Relay the request via host's ip. Add the following line to the file "/etc/mail/access
Connect:<host_ip_here> RELAY Also, in the host as well as docker, comment out the following line in the file "/etc/mail/sendmail.mc" by prefixing it with "dnl #" and suffixing with "dnl".
DAEMON_OPTIONS(`Port=smtp,Addr=127.0.0.1, Name=MTA') I passed the host ip as an environment variable to the docker container, so that it is configurable. Now the docker's sendmail will relay it's sendmail's smtp request via host machine.
-------
Beyond that I am not going to be much help as I have not had much experience with docker.
On Mon, Oct 2, 2017 at 6:26 PM Stephen John Smoogen smooge@gmail.com wrote:
On 2 October 2017 at 18:03, Larry Martell larry.martell@gmail.com wrote:
On Mon, Oct 2, 2017 at 5:29 PM, Stephen John Smoogen smooge@gmail.com
wrote:
On 2 October 2017 at 17:21, Larry Martell larry.martell@gmail.com
wrote:
I an running CentOS7 in a docker container. I need to send email from that container so I installed sendmail and then I run:
m4 /etc/mail/sendmail.mc > /etc/mail/sendmail.cf` and when I try and send mail it fails with:
larry.martll@gmail.com... Connecting to [127.0.0.1] via relay... larry.martll@gmail.com... Deferred: Connection refused by [127.0.0.1]
Anyone know how I can configure sendmail so that I can send mail?
Does this help any?
https://stackoverflow.com/questions/26215021/configure-sendmail-inside-a-doc...
That post is a bit overwhelming. It has 20+ answers and all are
different.
I have another container running debian buster and in there I do"
yes yes | sendmailconfig
and then I can send mail. But I don't see sendmailconfig in CentOS7. Is there an equivalent?
Sendmail is not the standard email server for EL7 so I am a bit rusty here. The item that caught my attention was the following:
I figured out a way myself, although not the most elegant solution. I configured the sendmail inside my docker so as to Relay the request via host's ip. Add the following line to the file "/etc/mail/access
Connect:<host_ip_here> RELAY Also, in the host as well as docker, comment out the following line in the file "/etc/mail/sendmail.mc" by prefixing it with "dnl #" and suffixing with "dnl".
DAEMON_OPTIONS(`Port=smtp,Addr=127.0.0.1, Name=MTA') I passed the host ip as an environment variable to the docker container, so that it is configurable. Now the docker's sendmail will relay it's sendmail's smtp request via host machine.
Beyond that I am not going to be much help as I have not had much experience with docker
Ok thanks I will try this. But I am not married to sendmail. I will use anything that allows me to send mail from the container.
On Mon, Oct 2, 2017 at 3:40 PM, Larry Martell larry.martell@gmail.com wrote:
Ok thanks I will try this. But I am not married to sendmail. I will use anything that allows me to send mail from the container.
Try ssmtp if you are only interest is outbound emails, through some kind of SMTP relay service (mailgun/sendgrid etc.).
-- Arun Khan
On Mon, Oct 2, 2017 at 7:25 PM, Pete Biggs pete@biggs.org.uk wrote:
On Mon, 2017-10-02 at 23:18 +0000, Larry Martell wrote:
On Mon, Oct 2, 2017 at 6:26 PM Stephen John Smoogen
Sendmail is not the standard email server for EL7
What is the the standard email server?
Postfix
Thanks. I was able to get postfix working in the docker container.
Here is my complete setup with Docker for example.
what I use: CentOS and Mate Desktop,systemd and VNC. It provides additional OpenVPN and Tor. Mate works better as gnome desktop. If somebody is interested.
Downloaded adobe and nux repo for VLC (needs to be hacked to run as root).
https://github.com/CentOS/sig-cloud-instance-images/tree/66add29c188e42d4d85... https://github.com/CentOS/sig-cloud-instance-images/tree/66add29c188e42d4d855f4d4acdb2b73d547edb6/docker
Everything runs as root as a test case.
Cheers
Andy
Sample setup:
FROM scratch ADD centos-7.4.1708-docker.tar.xz /
LABEL name="CentOS Base Image" \ vendor="CentOS" \ license="GPLv2" \ build-date="20170911"
COPY adobe-release-x86_64-1.0-1.noarch.rpm /root/adobeflash.rpm COPY nux-dextop-release-0-5.el7.nux.noarch.rpm /root/nux.rpm
RUN yum -y install /root/adobeflash.rpm; \ yum -y install epel-release; \ yum -y install /root/nux.rpm; \ rm -f /root/adobeflash.rpm /root/nux.rpm; \ yum -y update; \ yum install -y tigervnc-server xterm ; \ yum install -y mate-applets mate-backgrounds.noarch mate-control-center mate-control-center-filesystem mate-desktop mate-desktop-libs mate-icon-theme mate-menus mate-menus-libs mate-notification-daemon mate-panel mate-panel-libs mate-polkit mate-session-manager mate-settings-daemon mate-system-monitor mate-terminal mate-themes mate-user-guide caja-open-terminal caja-wallpaper pluma engrampa unrar p7zip; \ yum -y install gnome-icon-theme.noarch gnome-keyring gnome-themes-standard;
RUN yum install -y bind-utils net-tools traceroute tor openvpn openssh-server openssh-clients;
RUN yum install -y firefox thunderbird vlc eog ; sed -i 's/geteuid/getppid/' /usr/bin/vlc;
RUN rm -f /etc/localtime;cd /etc; ln -s ln -s ../usr/share/zoneinfo/Europe/Amsterdam localtime
RUN yum -y install ntp; systemctl enable ntpd
RUN (cd /lib/systemd/system/sysinit.target.wants/; for i in *; do [ $i == systemd-tmpfiles-setup.service ] || rm -f $i; done); \ rm -f /lib/systemd/system/multi-user.target.wants/*;\ rm -f /etc/systemd/system/*.wants/*;\ rm -f /lib/systemd/system/local-fs.target.wants/*; \ rm -f /lib/systemd/system/sockets.target.wants/*udev*; \ rm -f /lib/systemd/system/sockets.target.wants/*initctl*; \ rm -f /lib/systemd/system/basic.target.wants/*;\ rm -f /lib/systemd/system/anaconda.target.wants/*; \ systemctl enable tor; systemctl enable sshd
VOLUME [ "/sys/fs/cgroup" ]
RUN echo -e 'vncpassword\vncpassword\n' | vncpasswd
RUN cp /lib/systemd/system/vncserver@.service /etc/systemd/system/vncserver@:0.service RUN sed 's/<USER>/root/g' -i /etc/systemd/system/vncserver@:0.service
RUN sed 's//usr/bin/vncserver %i//usr/bin/vncserver %i -geometry 1280x1024/g' -i /etc/systemd/system/vncserver@:0.service
RUN sed 's//home/root//root/g' -i /etc/systemd/system/vncserver@:0.service
RUN systemctl enable vncserver@:0.service
RUN echo "#!/bin/sh" > /root/.vnc/xstartup RUN echo "unset SESSION_MANAGER" >> /root/.vnc/xstartup RUN echo "unset DBUS_SESSION_BUS_ADDRESS" >> /root/.vnc/xstartup RUN echo "#exec /etc/X11/xinit/xinitrc" >> /root/.vnc/xstartup RUN echo "/usr/bin/mate-session" >> /root/.vnc/xstartup RUN chmod +x /root/.vnc/xstartup
EXPOSE 5900
CMD ["/usr/sbin/init"]
# docker build --squash --rm --no-cache -t 'centos/mate‘ .
#example of runs versions... # docker run --privileged --device=/dev/tun0:/dev/net/tun -p 24:22 -p 5901:5900 -d 'centos/mate' # docker run --rm -it --net=host --name docker-myimage -v /sys/fs/cgroup:/sys/fs/cgroup:ro -d 'centos7.4.1708/systemd' -p 5901:5901
--On Monday, October 02, 2017 6:21 PM -0400 Larry Martell larry.martell@gmail.com wrote:
I an running CentOS7 in a docker container. I need to send email from that container so I installed sendmail and then I run:
m4 /etc/mail/sendmail.mc > /etc/mail/sendmail.cf` and when I try and send mail it fails with:
larry.martll@gmail.com... Connecting to [127.0.0.1] via relay... larry.martll@gmail.com... Deferred: Connection refused by [127.0.0.1]
Anyone know how I can configure sendmail so that I can send mail?
I don't know about docker, but in regular CentOS, you type make in /etc/mail to rebuild all configuration binary files (including sendmail.cf) from configuration sources, and then you need to start the sendmail service with systemctl. Enable the service if you want it to start at boot time.