[Dovecot] environment variables not set
hi, all!
I try to use relay-ctrl with dovecot's imap, but with no luck. I think that the problem is with environment variables. Here are some information:
dovecot --version 2.1.12
dovecot -n # 2.1.12: /usr/local/etc/dovecot/dovecot.conf # OS: Linux 3.2.29-smp i686 Slackware 14.0 auth_mechanisms = plain login debug_log_path = /var/log/dovecot-debug.log disable_plaintext_auth = no first_valid_uid = 89 info_log_path = /var/log/dovecot-info.log listen = * log_path = /var/log/dovecot.log mail_location = maildir:~/Maildir passdb { driver = shadow } protocols = imap service imap { executable = /usr/local/bin/envdir /etc/relay-ctrl /usr/local/bin/relay-ctrl-chdir /usr/local/bin/dovecot-settcpremoteip /usr/local/bin/relay-ctrl-allow /usr/local/libexec/dovecot/imap } ssl = no userdb { driver = passwd }
/usr/local/bin/dovecot-settcpremoteip:
#!/bin/sh # # Wrapper for relay-ctrl-allow that sets TCPREMOTEIP. TCPREMOTEIP="${IP}"; export TCPREMOTEIP exec "$@"
Sorry for double posting. :(
So, when I export environment variables, received in dovecot-settcpremoteip, there are no USER, IP etc., but only standard SLACKWARE variables.
I don't know whether it is related, but dovecot.log is full of such errors (in fact on every login):
Dec 19 17:36:51 imap: Error: relay-ctrl-allow[29611]: Warning: Could not rename '.1355931411.409875:29611' to '': No such file or directory. Dec 19 17:37:51 imap: Error: relay-ctrl-allow[29615]: Warning: Could not rename '.1355931471.411497:29615' to '': No such file or directory. Dec 19 17:38:51 imap: Error: relay-ctrl-allow[29619]: Warning: Could not rename '.1355931531.415611:29619' to '': No such file or directory.
What is wrong?
Best regards, Nikolai Tsvetkov
On 19.12.2012, at 17.37, Nikolai Tsvetkov koko@cybcom.net wrote:
I try to use relay-ctrl with dovecot's imap, but with no luck. I think that the problem is with environment variables. Here are some information:
dovecot --version 2.1.12
service imap { executable = /usr/local/bin/envdir /etc/relay-ctrl /usr/local/bin/relay-ctrl-chdir /usr/local/bin/dovecot-settcpremoteip /usr/local/bin/relay-ctrl-allow /usr/local/libexec/dovecot/imap }
Use the v2.x way of running post-login scripts: http://wiki2.dovecot.org/PostLoginScripting
Thank you! I tried, but only with first line and it didn't work. Now everything is fine.
Here is a snippet if anyone gets in trouble like me:
............................. service imap { executable = imap relayctl } service relayctl { executable = script-login /usr/local/bin/envdir /etc/relay-ctrl /usr/local/bin/relay-ctrl-chdir /usr/local/bin/dovecot-settcpremoteip /usr/local/bin/relay-ctrl-allow user = $default_internal_user unix_listener relayctl { } } ...........................
Thanks again!
On 19.12.2012 г. 17:46 ч., Timo Sirainen wrote:
On 19.12.2012, at 17.37, Nikolai Tsvetkov koko@cybcom.net wrote:
I try to use relay-ctrl with dovecot's imap, but with no luck. I think that the problem is with environment variables. Here are some information:
dovecot --version 2.1.12
service imap { executable = /usr/local/bin/envdir /etc/relay-ctrl /usr/local/bin/relay-ctrl-chdir /usr/local/bin/dovecot-settcpremoteip /usr/local/bin/relay-ctrl-allow /usr/local/libexec/dovecot/imap } Use the v2.x way of running post-login scripts: http://wiki2.dovecot.org/PostLoginScripting
participants (2)
-
Nikolai Tsvetkov
-
Timo Sirainen