I can send email by typing this command manually into the command line:
echo "test email" | mailx -s "test email" someone@somewhere.net
I get the email in my inbox, works.
It does not work with subprocess though:
import subprocess
recipients = ['someone@somewhere.net']
args = [
'echo', '"%s"' % 'test email', '|',
'mailx',
'-s', '"%s"' % 'test email',
] + recipients
LOG.info(' '.join(args))
subprocess.Popen(args=args, stdout=subprocess.PIPE).communicate()[0]
No errors, but I never receive the email in my inbox.
Any ideas?