It is indeed crazy, as you already pointed out ;-)
Receiving email is only possible using an SMTP server (which is communicating with the smtp protocol), and as such, it only can be found in mail servers like postfix or exchange. If you want a server-side script or executable receive emails, you have two options (i can think about in this second).
Implement a pop3 email client in your code, make it connect to the email server periodically, and read the mails from the remote server's mailbox. This requires that your executable or script is periodically called or executed by crontab or scheduled tasks.
Some mail servers support executable accounts (such an account which does not actually have a mailbox, you can not connect to this account by email clients, but each time a mail arrives to this mailbox, a program is executed by the mail server). This is much better for your problem, but if you are using a mail server which does not support such an account (the name of this type of account is certainly different for each mail server), then this option is not for you.