I want to acknowledge: I was inspired and encouraged by Email to Joplin Gateway by @manolitto I was impressed by all the features, including OCR etc., however I was afraid that setting up all the dependencies could be tricky on the host where I wanted to run this.
Also I very much liked the idea of instant conversion (did not want to wait for cron + POP3).
As my host (standard Uberspace 7) already had qmail, node js and php in place, I decided to install Joplin terminal app and try to glue all of it together with a minimum of code. I was happy when I got it done with five lines