Sending remote IP address to Dovecot IMAP
In version 9.7.7, we've added a feature that allows WebMail Lite to send actual user's IP address to Dovecot IMAP server, rather than IP addres of WebMail Lite installation. Technically that means sending the following command to the server:
ID ("x-originating-ip" "y.y.y.y")
To enable this feature, set ImapSendOriginatingIP to true in data/settings/modules/Mail.config.json file.
You'll also need to add WebMail Lite installation's IP to login_trusted_networks configuration option of Dovecot. For example in case of Dovecot 2.3:
# Example; replace with WebMail Lite server IP address
login_trusted_networks = 192.0.2.10
Only specific WebMail Lite server should be trusted, even 127.0.0.1 address should be explicitly added if Dovecot and WebMail Lite are on the same system.
After these changes, debug logs of WebMail Lite should now have ID command, and Dovecot logs would contain user's IP address in rip.