<!doctype html>
<html>
<head>
<meta charset="UTF-8">
</head>
<body>
<div>
<br>
</div>
<blockquote type="cite">
<div>
On 7 April 2019 17:26 André Rodier via dovecot <
<a href="mailto:dovecot@dovecot.org">dovecot@dovecot.org</a>> wrote:
</div>
<div>
<br>
</div>
<div>
<br>
</div>
<div>
Dear Dovecot users,
</div>
<div>
<br>
</div>
<div>
I am running Dovecot 2.2.27 on Debian Stretch, no issue so far.
</div>
<div>
<br>
</div>
<div>
I wonder if there is a way to pass the remote IP address, in an
</div>
<div>
environment variable, in the post login script.
</div>
<div>
<br>
</div>
<div>
My Post login scripts are working well, except that when the server is
</div>
<div>
accessed through a webmail (Roundcube or SOGo), the remote IP address
</div>
<div>
is systematically 127.0.0.1.
</div>
<div>
<br>
</div>
<div>
The other question I have is, is it possible to pass the user agent of
</div>
<div>
the email client used to access the server? I know this can be easily
</div>
<div>
forged, but I would like to log it.
</div>
<div>
<br>
</div>
<div>
Thanks for your insight.
</div>
<div>
<br>
</div>
<div>
--
</div>
<div>
André Rodier
</div>
</blockquote>
<div>
<br>
</div>
<div>
You can use IMAP ID command to pass e.g. x-originating-ip. See https://github.com/dovecot/core/blob/master/src/imap-login/imap-login-cmd-id.c
</div>
<div class="io-ox-signature">
<pre>---<br>Aki Tuomi</pre>
</div>
</body>
</html>