Trying to send mail from cron job using an smtp contianer

Spread the love
  •  
  •  
  •  
  •  
  •  
  •  
  •  
  •  
  •  
  •  

Hi, I am trying to send an email from a cron job, using an smtp container (namshi/smtp). The intention is to create the message in a script, using output from other commands and then pass the message to the container and send the email. I want to run the container using docker run –rm, since it would only need to send the email at the end of the script and then disappear. Does anyone have an idea on how I can accomplish this? I have tried the following as a simple test – not even passing a variable with the message – but it does not work: docker run –rm -v /run/systemd/resolve/resolv.conf:/etc/resolv.conf:ro -e [email protected] -e GMAIL_PASSWORD=mypassw0rd -e DISABLE_IPV6=1 namshi/smtp /bin/bash -c ‘sleep 20 && echo “Subject: hello” | /usr/lib/sendmail -v [email protected]’ The only output I receive is: + sed -ri ‘ s/^#?(dc_local_interfaces)=.*/1=”'[0.0.0.0]:25 ; [::0]:25”’/; s/^#?(dc_other_hostnames)=.*/1=”””/; s/^#?(dc_relay_nets)=.*/1=”’10.10.0.2/24”’/; s/^#?(dc_eximconfig_configtype)=.*/1=”’smarthost”’/; s/^#?(dc_smarthost)=.*/1=”’smtp.gmail.com::587”’/; s/^#?(dc_relay_domains)=.*/1=”””/; ‘ /etc/exim4/update-exim4.conf.conf + update-exim4.conf -v using non-split configuration scheme from /etc/exim4/exim4.conf.template LOG: MAIN <= [email protected] U=root P=local S=305 Normally, you should see some more elaborate logging: connecting to gmail etc… Any help would be greatly appreciated! submitted by /u/_frostie_ [link] [comments]

X ITM Cloud News

Patricia

Leave a Reply

Next Post

Open Source Vault on NFS with achieve HA

Tue Sep 15 , 2020
Spread the love          Have written an article explaining how to deploy the Open Source Vault on Consul using NFS Persistence storage and achieve HA. https://medium.com/@github.gkarthiks/how-to-make-opensource-vault-highly-available-on-nfs-5af0c68070d8 submitted by /u/gkarthiks [link] [comments] X ITM Cloud News
X- ITM

Cloud Computing – Consultancy – Development – Hosting – APIs – Legacy Systems

X-ITM Technology helps our customers across the entire enterprise technology stack with differentiated industry solutions. We modernize IT, optimize data architectures, and make everything secure, scalable and orchestrated across public, private and hybrid clouds.

This image has an empty alt attribute; its file name is x-itmdc.jpg

The enterprise technology stack includes ITO; Cloud and Security Services; Applications and Industry IP; Data, Analytics and Engineering Services; and Advisory.

Watch an animation of  X-ITM‘s Enterprise Technology Stack

We combine years of experience running mission-critical systems with the latest digital innovations to deliver better business outcomes and new levels of performance, competitiveness and experiences for our customers and their stakeholders.

X-ITM invests in three key drivers of growth: People, Customers and Operational Execution.

The company’s global scale, talent and innovation platforms serve 6,000 private and public-sector clients in 70 countries.

X-ITM’s extensive partner network helps drive collaboration and leverage technology independence. The company has established more than 200 industry-leading global Partner Network relationships, including 15 strategic partners: Amazon Web Services, AT&T, Dell Technologies, Google Cloud, HCL, HP, HPE, IBM, Micro Focus, Microsoft, Oracle, PwC, SAP, ServiceNow and VMware

.

X ITM