[Dovecot] Dovecot Proxy and environment variables
Dear list,
First of all, I am French so excuse my bad english.
I am currently using dovecot proxy feature, using sql backend.
I "proxy" the imap/pop requests to another server, let's say server2.
On server2, I use a script to keep up to date a "pop before smtp auth" database.
I used mail_executable = /path/to/this/script.sh ...
My problem is: the $IP environment variable on server2 is the proxy's IP.
How could I give a variable from proxy to server2, or simply get the real client public IP ?
Thanks a lot in advance for your answers
Pierre.
PS: let me also thank very much dovecot developers and community !
Hi List,
Sorry to bother you again but nobody would have any solution ?
I just want to get real IP on a dovecot behind a dovecot proxy.
I am using dovecot 1.2.4 but can change version if a solution exists.
Thanks a lot in advance, Pierre
On Fri, 27 Nov 2009 16:25:53 +0100, BaQs <serarien@baqs.net> wrote:
Dear list,
First of all, I am French so excuse my bad english.
I am currently using dovecot proxy feature, using sql backend.
I "proxy" the imap/pop requests to another server, let's say server2.
On server2, I use a script to keep up to date a "pop before smtp auth" database.
I used mail_executable = /path/to/this/script.sh ...
My problem is: the $IP environment variable on server2 is the proxy's IP.
How could I give a variable from proxy to server2, or simply get the real client public IP ?
Thanks a lot in advance for your answers
Pierre.
PS: let me also thank very much dovecot developers and community !
If you have Dovecot v1.2 in both proxy and destination servers, you can just set in dest server login_trusted_networks to include the proxy's IP.
On Nov 30, 2009, at 3:50 AM, BaQs wrote:
Hi List,
Sorry to bother you again but nobody would have any solution ?
I just want to get real IP on a dovecot behind a dovecot proxy.
I am using dovecot 1.2.4 but can change version if a solution exists.
Thanks a lot in advance, Pierre
On Fri, 27 Nov 2009 16:25:53 +0100, BaQs <serarien@baqs.net> wrote:
Dear list,
First of all, I am French so excuse my bad english.
I am currently using dovecot proxy feature, using sql backend.
I "proxy" the imap/pop requests to another server, let's say server2.
On server2, I use a script to keep up to date a "pop before smtp auth" database.
I used mail_executable = /path/to/this/script.sh ...
My problem is: the $IP environment variable on server2 is the proxy's IP.
How could I give a variable from proxy to server2, or simply get the real client public IP ?
Thanks a lot in advance for your answers
Pierre.
PS: let me also thank very much dovecot developers and community !
Seems to work great!
Thanks a lot, enormous!
On Mon, 30 Nov 2009 10:37:02 -0500, Timo Sirainen <tss@iki.fi> wrote:
If you have Dovecot v1.2 in both proxy and destination servers, you can just set in dest server login_trusted_networks to include the proxy's IP.
On Nov 30, 2009, at 3:50 AM, BaQs wrote:
Hi List,
Sorry to bother you again but nobody would have any solution ?
I just want to get real IP on a dovecot behind a dovecot proxy.
I am using dovecot 1.2.4 but can change version if a solution exists.
Thanks a lot in advance, Pierre
On Fri, 27 Nov 2009 16:25:53 +0100, BaQs <serarien@baqs.net> wrote:
Dear list,
First of all, I am French so excuse my bad english.
I am currently using dovecot proxy feature, using sql backend.
I "proxy" the imap/pop requests to another server, let's say server2.
On server2, I use a script to keep up to date a "pop before smtp auth" database.
I used mail_executable = /path/to/this/script.sh ...
My problem is: the $IP environment variable on server2 is the proxy's IP.
How could I give a variable from proxy to server2, or simply get the real client public
IP
?
Thanks a lot in advance for your answers
Pierre.
PS: let me also thank very much dovecot developers and community !
Hi all!
I now use dovecot 1.2.9 on proxy, and 1.2.4 on destination server. Then, it seems that login_trusted_networks doesn't work any more, and I've got private proxy's ip opensmtp database.
---destination server More details may help: mail_executable = /usr/local/libexec/dovecot/opensmtp.sh /usr/local/libexec/dovecot/courier2dovecot.sh
opensmtp.sh: echo "replace into opensmtp(ip,domain) VALUES('$IP','$DOMAIN');" | mysql ---destination server
---proxy password_query = SELECT NULL AS password, host, 'Y' AS nologin, 'Y' AS nodelay, 'Y' AS nopassword, 'Y' AS proxy,'%u' as user FROM proxy WHERE domain = '%d' ---proxy
On Mon, 30 Nov 2009 17:05:40 +0100, BaQs <serarien@baqs.net> wrote:
Seems to work great!
Thanks a lot, enormous!
On Mon, 30 Nov 2009 10:37:02 -0500, Timo Sirainen <tss@iki.fi> wrote:
If you have Dovecot v1.2 in both proxy and destination servers, you can just set in dest server login_trusted_networks to include the proxy's IP.
On Nov 30, 2009, at 3:50 AM, BaQs wrote:
Hi List,
Sorry to bother you again but nobody would have any solution ?
I just want to get real IP on a dovecot behind a dovecot proxy.
I am using dovecot 1.2.4 but can change version if a solution exists.
Thanks a lot in advance, Pierre
On Fri, 27 Nov 2009 16:25:53 +0100, BaQs <serarien@baqs.net> wrote:
Dear list,
First of all, I am French so excuse my bad english.
I am currently using dovecot proxy feature, using sql backend.
I "proxy" the imap/pop requests to another server, let's say server2.
On server2, I use a script to keep up to date a "pop before smtp auth" database.
I used mail_executable = /path/to/this/script.sh ...
My problem is: the $IP environment variable on server2 is the proxy's IP.
How could I give a variable from proxy to server2, or simply get the real client public
IP
?
Thanks a lot in advance for your answers
Pierre.
PS: let me also thank very much dovecot developers and community !
On 2010-01-15, BaQs (serarien@baqs.net) wrote:
I now use dovecot 1.2.9 on proxy, and 1.2.4 on destination server.
Not that this will necessarily fix your problem (though it might) - if you are using dovecot proxy with multiple dovecot servers, you really should keep them all the same version...
Ok, found what happens
I only catch public IP when using imap, not pop3.
Any way to catch public IP using pop3 as well ?
On Fri, 15 Jan 2010 11:33:11 -0500, Charles Marcus <CMarcus@Media-Brokers.com> wrote:
On 2010-01-15, BaQs (serarien@baqs.net) wrote:
I now use dovecot 1.2.9 on proxy, and 1.2.4 on destination server.
Not that this will necessarily fix your problem (though it might) - if you are using dovecot proxy with multiple dovecot servers, you really should keep them all the same version...
On Fri, 2010-01-15 at 17:27 +0100, BaQs wrote:
Ok, found what happens
I only catch public IP when using imap, not pop3.
Any way to catch public IP using pop3 as well ?
No. Hmm. I hadn't thought about this for a while. It would require some new XFORWARD command that sends it. But when to use it? There would be a couple of possibilities:
a) Send it only when XFORWARD is listed in capabilities. This requires POP3 proxy to ask for CAPA, which it currently doesn't, so it adds an extra round trip = latency.
b) Just always send the XFORWARD command and if it fails, just ignore the error.
c) Send it when banner string contains something special, such as "Dovecot" string.
d) Send it when configured by config file / passdb.
I don't really like any of them. Perhaps b) wouldn't be too bad.
participants (3)
-
BaQs
-
Charles Marcus
-
Timo Sirainen