[Dovecot] v2.0 post-login scripts
Post-login scripts work a bit differently in v2.0, because the old way just couldn't work anymore. I suppose at some point I should fork the wiki to v1.x and v2.x and start writing these things there, but for now I'll just write it here:
First you'll need to tell imap service that it should connect to postlogin service:
service imap { executable = imap imap-postlogin }
Then you'll need the imap-postlogin service:
# The service name below doesn't actually matter. service imap-postlogin { executable = script rawlog /tmp/test.sh unix_listener imap-postlogin { } }
The "script" executable does all the magic. If you want multiple scripts, just make them a chain, like above script first executes rawlog, and rawlog then executes /tmp/test.sh:
#!/bin/sh
echo "* OK Hello $USER ($IP -> $LOCAL_IP)" export MAIL=maildir:/tmp/test export USERDB_KEYS="$USERDB_KEYS mail"
exec $*
So it's pretty similar to how it works before, except now you'll also need to update $USERDB_KEYS to contain all environments that you want to pass to imap process.
participants (1)
-
Timo Sirainen