Multiple scripts with postlogin
Dan Conway
darkc0de at archnix6.net
Wed Mar 1 18:39:38 UTC 2023
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.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://dovecot.org/pipermail/dovecot/attachments/20230301/0d047b7e/attachment.htm>
More information about the dovecot
mailing list