AnemoneLabs / nymphemeral

Ephemeral pseudonym client
GNU General Public License v3.0
5 stars 1 forks source link

Mixmaster output from subprocess call is not handled properly #19

Open felipedau opened 9 years ago

felipedau commented 9 years ago

It looks like Mixmaster output from subprocess.Popen(...).communicate(...) is not appropriate and nymphemeral is not detecting errors (e.g., connection refused). If Mixmaster is returning the same output for both success and failure, try to use --verbose. Another option (which does not look good) is to capture the stdout.

felipedau commented 9 years ago

Tests (Mixmaster 3.0.3b)

Sending a dummy message when the connection to the SMTP server is open, which supposedly works:

>>> p = subprocess.Popen(['mixmaster', '--mail', target],
...                      stdin=subprocess.PIPE,
...                      stdout=subprocess.PIPE)
>>> out, err = p.communicate(message)
>>> out, err
('', None)

Sending a dummy message when the connection to the SMTP server is closed:

>>> p = subprocess.Popen(['mixmaster', '--mail', target],
...                      stdin=subprocess.PIPE,
...                      stdout=subprocess.PIPE)
>>> out, err = p.communicate(message)
Error: [4405] SMTP relay not ready. 
Error: [4405] SMTP relay not ready. 
Error: [4405] Unable to execute sendmail. Check path!
>>> out, err
('', None)

Adding --verbose will only print the chain to be used (for both cases). Same outputs for different scenarios.