<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
</head>
<body>
<p>Hello,</p>
<p>I'm having trouble understanding how to execute separate scripts
with postlogin. According to the documentation, it should be as
simple as:<br>
</p>
<div class="highlight-none notranslate" style="clear: both; margin:
1em 0px; color: rgb(62, 67, 73); font-family: Roboto; font-size:
17px; font-style: normal; font-variant-ligatures: normal;
font-variant-caps: normal; font-weight: 400; letter-spacing:
normal; orphans: 2; text-align: start; text-indent: 0px;
text-transform: none; white-space: normal; widows: 2;
word-spacing: 0px; -webkit-text-stroke-width: 0px;
background-color: rgb(255, 255, 255); text-decoration-thickness:
initial; text-decoration-style: initial; text-decoration-color:
initial;">
<div class="highlight" style="background: rgb(255, 255, 255);
position: relative;">
<pre id="codecell1" style="line-height: 1.3em; overflow: auto hidden; clear: both; font-family: Consolas, Menlo, "DejaVu Sans Mono", "Bitstream Vera Sans Mono", monospace; font-size: 0.9em; background: rgb(238, 238, 238); padding: 7px 30px; margin: 0px;">You can run multiple post-login scripts by just giving multiple scripts as parameters to<span> </span><code class="docutils literal notranslate" style="font-family: Consolas, Menlo, "DejaVu Sans Mono", "Bitstream Vera Sans Mono", monospace; font-size: 0.9em; background-color: rgb(236, 240, 243); color: rgb(34, 34, 34);"><span class="pre" style="hyphens: none;">script-login</span></code>, for example:
<span></span>executable = script-login rawlog /usr/local/bin/postlogin.sh /usr/local/bin/postlogin2.sh</pre>
</div>
</div>
<p></p>
<p>Given this information, I supplied two scripts to service
imap-postlogin below:</p>
<pre id="codecell0" style="line-height: 1.3em; overflow: auto hidden; clear: both; font-family: Consolas, Menlo, "DejaVu Sans Mono", "Bitstream Vera Sans Mono", monospace; font-size: 0.9em; background: rgb(238, 238, 238); padding: 7px 30px; margin: 0px; color: rgb(62, 67, 73); font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration-thickness: initial; text-decoration-style: initial; text-decoration-color: initial;">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 {
}
}</pre>
<p></p>
<p>Both scripts simply print "Script 1" and "Script 2" to STDERR.
Here is what they look like:</p>
<pre id="codecell0" style="line-height: 1.3em; overflow: auto hidden; clear: both; font-family: Consolas, Menlo, "DejaVu Sans Mono", "Bitstream Vera Sans Mono", monospace; font-size: 0.9em; background: rgb(238, 238, 238); padding: 7px 30px; margin: 0px; color: rgb(62, 67, 73); font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration-thickness: initial; text-decoration-style: initial; text-decoration-color: initial;">#!/usr/bin/perl
use strict;
use warnings;
print STDERR "Script 1\n";
system("/usr/lib/dovecot/script-login");</pre>
<p></p>
<p>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"<br>
</p>
<pre id="codecell0" style="line-height: 1.3em; overflow: auto hidden; clear: both; font-family: Consolas, Menlo, "DejaVu Sans Mono", "Bitstream Vera Sans Mono", monospace; font-size: 0.9em; background: rgb(238, 238, 238); padding: 7px 30px; margin: 0px; color: rgb(62, 67, 73); font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration-thickness: initial; text-decoration-style: initial; text-decoration-color: initial;">imap-postlogin: Error: Script 1
imap(<user>): Error: Post-login script denied access to user <user></pre>
<p>Am I missing something?</p>
<p>Thanks.<br>
</p>
<p><br>
</p>
<p><br>
</p>
</body>
</html>