Hello,
I'm having trouble understanding how to execute separate scripts
with postlogin. According to the documentation, it should be as
simple as:
You can run multiple post-login scripts by just giving multiple scripts as parameters to script-login
, for example:
executable = script-login rawlog /usr/local/bin/postlogin.sh /usr/local/bin/postlogin2.sh
Given this information, I supplied two scripts to service imap-postlogin below:
service imap { executable = imap imap-postlogin } service imap-postlogin { executable = script-login -d rawlog /usr/local/bin/postlogin.pl /usr/local/bin/postlogin2.pl user = $default_internal_user unix_listener imap-postlogin { } }
Both scripts simply print "Script 1" and "Script 2" to STDERR. Here is what they look like:
#!/usr/bin/perl use strict; use warnings; print STDERR "Script 1\n"; system("/usr/lib/dovecot/script-login");
After logging in, only the first script is executed. The second
one is ignored. I tried not executing
"/usr/lib/dovecot/script-login" in the first script, in hopes that
it would execute the second script, but it only denies the
connection after printing "Script 1"
imap-postlogin: Error: Script 1 imap(<user>): Error: Post-login script denied access to user <user>
Am I missing something?
Thanks.