Implementing an answer mail was tricky

A project log for mail2code

Mail your code to my microcontroller and see what happens via webcam. One hardware setup for many students, availability: Worldwide 24/7

norbert-heinzNorbert Heinz 06/04/2023 at 07:420 Comments

Starring at a homepage, waiting for a post to appear is a waste of time, so I have implemented an answer mail that is sent by my server as soon as the code file was compiled and the video recorded. Can't be that hard or can it?

Adding the code lines to generate all files needed for an answer mail was done relatively quickly and first successful test runs made me think of what I could do the rest of the day. But then I sent mails from computing devices different from my Linux machine that I wrote the code on and the results became somehow odd :-( and my coding day ended late in the night...

I was aware that sending mails automatically is what spammers do, so mail providers implemented more or less creative ways to keep spammers out. One way is to implement an authentications named DKIMS which wasn't an issue as long as I sent the mails from my domain to my domain. After sending a first test from my smartohone, the trouble begun:

My domain hoster obviously did not implement that correctly, so the answer mails failed when sending them to certain email providers. What should I do: Start a long discussion with the service team or simply switch to a free mail account of a prominent mail provider? On a weekend, the later solution seemed to be the quickest. Unfortunately is wasn't a quick one either: I could not get ssmtp working with the mail provider of my choice and after a lot of research and test runs I ended up with msmtp.

A benefit of being able to configure the system to use any email address for sending an answer is, that if your mail gets marked as spam by too many providers, you can quickly switch to a new one. Sort of real cloud computing ;-)

Long story short: You now get an answer mail including your code lines, the compiler output and the video file attached.

Feel welcome to send a test mail on the mail2code page:

...and hopefully that won't result in another error message that ruins my daily schedule. ;-)