Commit 74c53c59 authored by anarcat's avatar anarcat
Browse files

handle missing MTA better, see #39

parent 8a0bae14
Loading
Loading
Loading
Loading
+6 −1
Original line number Diff line number Diff line
@@ -402,7 +402,12 @@ expects an EmailFactory email, but will not mail if nomail is set"""
                if self.options.dryrun: return True
                command = [x % {'to': msg.mailto}
                           for x in shlex.split(self.options.mta)]
                try:
                    p = subprocess.Popen(command, stdin=subprocess.PIPE)  # nosec
                except OSError as e:
                    self.warn(_('cannot find MTA %s, try --mta or --smtp: %s')
                              % (command, e))
                    return False
                p.communicate(msg.as_string().encode('utf-8'))
                self.warn(_('sent message to %(destination)s with %(command)s')
                          % {'destination': msg.mailto,