corbosman / dovecot_ident Goto Github PK
View Code? Open in Web Editor NEWRoundcube Ident Plugin
Roundcube Ident Plugin
Hi i've problem i've setup 10.0.0.5 and 10.0.0.6 roundcube clients which connects to server 10.0.0.4 for example tried to add in dovecot.conf 127.0.1, ::1 or 10.0.0.0/24 or 10.0.0.5 or 10.0.0.5/32 or 10.0.0.5::1 or just mix and still same resault just see roundcube client ip
Hi Corbosman
Thanks for the plugin, but unfortunately the plugin just works correct if I add --> $config['imap_debug'] = true; <-- to the Roundcube config.inc.php . Without this imap_debug, I get the wrong ip (127.0.0.1) with the postlogin script
Friendly greets
Burzel
Hi,
Thank you for your code!
It works, I can see the ip addresses in the log, when a user logged in Roundcube. But when I download an attachment, the attachment (for example .doc) is wrong, the Word can't open it. I realized, that there is a plus white character at the begining of the file. If I delete this character, the Word can open it.
How can I correct this probelm in my system?
I use 1.1.12 RC with these plugins: filesystem_attachments 1.0, jqueryui 1.10.4, managesieve 8.3, password 3.5.
Thank you
Hello,
this plugin does not work anymore with version 1.5 of Roundcube, see roundcube/roundcubemail#7860
This is a little patch. I don't know how to check the version of roundcube, otherwise you could use an 'if' to handle different versions.
--- dovecot_ident.php.orig 2021-07-05 10:31:19.104942320 +0200
+++ dovecot_ident.php 2021-07-05 10:20:20.425873102 +0200
@@ -17,7 +17,7 @@
function add_ident($args)
{
- $args['ident'] = $args['ident'] ? array_merge($args['ident'], array('x-originating-ip' => $_SERVER['REMOTE_ADDR']))
+ $args['preauth_ident'] = $args['preauth_ident'] ? array_merge($args['preauth_ident'], array('x-originating-ip' => $_SERVER['REMOTE_ADDR']))
: array('x-originating-ip' => $_SERVER['REMOTE_ADDR']);
return $args;
}
Hi,
first of all thanks for sharing your work.
But it doesn't work for me. When I login, it still shows the IP of localhost.
I'm using the latest stable version RC 1.1.0 with this plugin.
Edit:
Forgot to mention that I'm using a IPv6 address. Is that a problem?
ERROR: Failed to load plugin file ..../plugins/dovecot_ident/dovecot_ident.php
My webserver is behind a proxy server. In this case REMOTE_ADDR is proxy server IP not visitor's IP. I checked you code which is pretty basic. In my case X_FORWARD_FOR keeps the real visitor's IP address. In the code bellow do I have to change both REMOTE_ADDR values to X_FORWARD_FOR? I did that and it is working as expected but I would like to know your opinion.
Thank you.
<?php
/**
* Plugin to add imap id
*
* @version 1.0
* @author Cor Bosman
*/
class dovecot_ident extends rcube_plugin
{
function init()
{
$this->add_hook('storage_connect', array($this, 'add_ident'));
}
function add_ident($args)
{
$args['ident'] = $args['ident'] ? array_merge($args['ident'], array('x-originating-ip' => $_SERVER['REMOTE_ADDR']))
: array('x-originating-ip' => $_SERVER['REMOTE_ADDR']);
return $args;
}
}
?>
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.