Is it possible to run a bash script for authentication where a 0 exit code indicates success and a non-zero is failure? What I'm trying to do is create a shadow IMAP server that authenticates against a different server. That way my server will use the same passwords as an existing server.
So what I would need is for dovecot to pass the username and password to my script, I attempt to log in remotely and if I succeed I allow access on my side. My side will be used to configure black lists and where spam is dragged from their side to my side. (I'm a spam filtering company)
On 2018-05-16 21:18, Marc Perkel wrote:
Is it possible to run a bash script for authentication where a 0 exit code indicates success and a non-zero is failure? What I'm trying to do is create a shadow IMAP server that authenticates against a different server. That way my server will use the same passwords as an existing server.
So what I would need is for dovecot to pass the username and password to my script, I attempt to log in remotely and if I succeed I allow access on my side. My side will be used to configure black lists and where spam is dragged from their side to my side. (I'm a spam filtering company) Have you looked at the checkpassword [1] and imap [2] authdatbase descriptions in the wiki?
[1] https://wiki2.dovecot.org/AuthDatabase/CheckPassword [2] https://wiki2.dovecot.org/PasswordDatabase/IMAP
-- Christian Kivalo
On 16 May 2018, at 22.18, Marc Perkel <marc@perkel.com> wrote:
Is it possible to run a bash script for authentication where a 0 exit code indicates success and a non-zero is failure? What I'm trying to do is create a shadow IMAP server that authenticates against a different server. That way my server will use the same passwords as an existing server.
So what I would need is for dovecot to pass the username and password to my script, I attempt to log in remotely and if I succeed I allow access on my side. My side will be used to configure black lists and where spam is dragged from their side to my side. (I'm a spam filtering company)
Lua passdb https://wiki.dovecot.org/AuthDatabase/Lua <https://wiki.dovecot.org/AuthDatabase/Lua> on dovecot 2.3 can be used or if you can make your external server act as auth policy server, then you could use https://wiki.dovecot.org/Authentication/Policy <https://wiki.dovecot.org/Authentication/Policy> available since dovecot 2.2.25
Sami
participants (4)
-
Aki Tuomi
-
Christian Kivalo
-
Marc Perkel
-
Sami Ketola