1

I want to run a fake SMTP server on my raspberry PI (rpi). I found a good fake server that I usually start with the following command:

sudo python -m smtpd -n -c DebuggingServer 0.0.0.0:25

I can easily send e-mail with a python client or telnet commands from the localhost and foreign computer (Linux, Windows). However, the scan2mail function of an older HP printer causes serious issues because it simply reports me an error: The e-mail could not be sent, try again later.

Is there a way that Pythons smtpd shows me every byte it receives? (So that I can track down the HP scan2mail issue.)

Pls let me know if you need more infos.

Ozgur Vatansever
  • 49,246
  • 17
  • 84
  • 119
Markus
  • 763
  • 7
  • 24
  • The SMTP gateway of the HP Printer has been successfully added/tested. – Markus May 01 '16 at 19:29
  • 1
    What output are you currently seing on the debug server? Any at all, or at least the incomming connection? If you don't see at least that, then the problem is probably somewhere else. If you see that, the `smtpd` library is very strict about line endings, if the scan2mail client uses `\n` instead of `\r\n`, then it will wait indefinitely for the initial helo/ehlo. Most smtp servers are not that strict. – mata May 01 '16 at 20:58
  • @Mata: There is not even an incoming connection visible at the `smptd`. The printer "immediately" (after max 3 secs) reports the error. Surprisingly, the inital setup works like a charm. – Markus May 02 '16 at 19:19
  • the smtpd debugging server prints the `Incoming connection` immediately when a client connects, even before it sends a single byte. So if you don't see that message, it means that the printer doesn't even open a connection, smtpd can't show you every byte because it doesn't recieve any. – mata May 02 '16 at 23:48

0 Answers0