On Fri, 2007-01-12 at 07:26 -0600, Rick Romero wrote:
vchkpw sets the 'connection-type' based on the variable TCPLOCALPORT If that's not set, it defaults to pop. What this does in my environment is cause someone who is denied POP access to also not be able to use IMAP (or webmail) because that variable is not set.
Is it possible to have Dovecot set that variable, based on the port the user connected to, prior to calling vchkpw?
Unfortunately Dovecot doesn't currently pass the port information to dovecot-auth, and I think it's a bit too large change to do for v1.0 release. Dovecot does set SERVICE=imap or SERVICE=pop3 though, so it would be possible for you to write a glue script as the checkpassword:
#!/bin/sh
if [ $SERVICE = imap ]; then export TCPLOCALPORT=143 else export TCPLOCALPORT=110 fi exec /usr/local/vpopmail/bin/vchkpw