Use properly formatted fallback email address instead of just the
username.
Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
import re
import shutil
import smtplib
+import socket
import subprocess
import sys
import tempfile
raise ReportError("Neither plain text nor html body specified")
full_name = pwd.getpwuid(os.getuid()).pw_gecos.split(',')[0]
- email = os.environ.get('EMAIL', os.getlogin())
+ email = os.environ.get('EMAIL',
+ '{}@{}'.format(os.getlogin(), socket.getfqdn()))
msg['From'] = "{} <{}>".format(full_name, email)
msg['To'] = ', '.join(recipients)
msg['Subject'] = subject