<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
</head>
<body>
<p>Hello,</p>
<p>When extracting client_id information from the client connection
(i.e. setting imap_id_log = *) the information is directly logged
by Dovecot as such:<br>
ID sent: name=Thunderbird, version=91.5.0<br>
<br>
My question is, Is it possible to export/set this information in a
checkpassword script or a postlogin script?</p>
<table class="docutils align-default" style="text-align: center;
margin: 10px auto; border: 1px solid rgb(136, 136, 136);
border-collapse: collapse; box-shadow: rgb(238, 238, 238) 2px 2px
4px; 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-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;">
<tbody>
<tr class="row-odd">
<td style="text-align: left; padding: 0.25em 0.7em; border:
1px solid rgb(136, 136, 136);">
<p style="margin-top: 0px; margin-bottom: 0px; hyphens:
auto; line-height: 1.4em;">client_id</p>
</td>
<td style="text-align: left; padding: 0.25em 0.7em; border:
1px solid rgb(136, 136, 136);">
<p style="margin-top: 0px; hyphens: auto; line-height:
1.4em;">If<span> </span><a class="reference internal"
href="https://doc.dovecot.org/settings/core/#core_setting-imap_id_retain"
title="core_setting-imap_id_retain" style="color: rgb(0,
75, 107); text-decoration: none; border-bottom: 1px
dotted rgb(0, 75, 107);"><code class="xref dovecot_core
dovecot_core-ref docutils literal notranslate"
style="font-family: Consolas, Menlo, "DejaVu Sans
Mono", "Bitstream Vera Sans Mono",
monospace; font-size: 0.9em; background-color:
rgb(251, 251, 251); color: rgb(34, 34, 34);
font-weight: bold; border-bottom: 1px solid rgb(255,
255, 255);"><span class="pre" style="hyphens: none;">imap_id_retain</span></code></a><span> </span>is
enabled this variable is populated with the client ID
request as IMAP arglist.</p>
</td>
</tr>
</tbody>
</table>
<p>I've enabled both checkpassword and postlogin on a test server,
as well as 'imap_id_retain' set to 'yes'. I wrote a simple Perl
script that dumps everything in %ENV as well as @ARGV for
checkpassword and postlogin, but I don't see any occurrences of ID
information. I've also tried to see if I could supply that
variable in dovecot.conf by setting 'client_id' as a parameter,
but that didn't seem to do the trick either.<br>
</p>
<pre>passdb {</pre>
<pre>...</pre>
<pre> # Doesn't work
args = /usr/local/bin/checkpassword.pl client_id
# Doesn't work
args = /usr/local/bin/checkpassword.pl %{client_id}
</pre>
<pre>...</pre>
<pre>}
</pre>
<p>What am I missing? Is it possible to get these variables into an
external script that checkpassword or postlogin executes?</p>
<p>Thanks.<br>
</p>
</body>
</html>