I use Mail postfix and dovecot, so I want to make an external call (Bash, SH) to verify email and ip has permit to access or not. if permit, the external server return OK code, and the server mail process next step. otherwise the mail server return a message as "pass wrong" or "your account was denied."
User login via App mail as Outlook, ThunderBird, iOS Mail, ...
This is a server config to call, not a programing project.
I can write code shell/sh/bash to call external, you just config for call.