[Dovecot] Dovecot + Cygwin the 2nd
Hi,
i still try to get dovecot to run under cygwin. After a post on the cygwin list i am able tu run dovecot. Under Cygwin you have to run dovecot by inetd. Starting the binary "dovecot.exe" does not work.
Well the server is running but answers with a fatal error.
Account: 'localhost', Server: 'localhost', Protokoll: POP3, Serveranswer: 'Fatal: EOF while reading environment from master', Port: 110, Secure (SSL): No, error on server: 0x800CCC90, Fehlernummer: 0x800CCC90
This error is from Outlook, Thunderbird just says there is an error without any error message.
So maybe you can help me to bring my story to a hapy end ;-)
Cheers Ronny
Sorry i forgot:
$ dovecot -n # 1.0.9: /etc/dovecot.conf base_dir: /var/run/dovecot/ log_path: /var/log/dovecot.log info_log_path: /var/log/dovecot.log protocols: imap pop3 ssl_disable: yes disable_plaintext_auth: no login_dir: /var/run/dovecot//login login_executable(default): /usr/libexec/dovecot/imap-login login_executable(imap): /usr/libexec/dovecot/imap-login login_executable(pop3): /usr/libexec/dovecot/pop3-login login_user: Administrator mail_location: maildir:~/Maildir mail_executable(default): /usr/libexec/dovecot/imap mail_executable(imap): /usr/libexec/dovecot/imap mail_executable(pop3): /usr/libexec/dovecot/pop3 mail_plugin_dir(default): /usr/lib/dovecot/imap mail_plugin_dir(imap): /usr/lib/dovecot/imap mail_plugin_dir(pop3): /usr/lib/dovecot/pop3 pop3_uidl_format(default): pop3_uidl_format(imap): pop3_uidl_format(pop3): %08Xu%08Xv auth default: user: Administrator process_size: 0 passdb: driver: passwd-file args: /etc/passwd.dovecot passdb: driver: pam userdb: driver: passwd
On 18.12.2007 15:15, Ronny wrote:
Hi,
i still try to get dovecot to run under cygwin. After a post on the cygwin list i am able tu run dovecot. Under Cygwin you have to run dovecot by inetd. Starting the binary "dovecot.exe" does not work.
Well the server is running but answers with a fatal error.
Account: 'localhost', Server: 'localhost', Protokoll: POP3, Serveranswer: 'Fatal: EOF while reading environment from master', Port: 110, Secure (SSL): No, error on server: 0x800CCC90, Fehlernummer: 0x800CCC90
This error is from Outlook, Thunderbird just says there is an error without any error message.
So maybe you can help me to bring my story to a hapy end ;-)
Cheers Ronny
Can you get greeting text if you simply telnet to server?
Can you get greeting text if you simply telnet to server?
I get the same error:
$ telnet localhost 143 Trying 127.0.0.1... Connected to zoidberg. Escape character is '^]'. Fatal: EOF while reading environment from master Connection closed by foreign host.
$ telnet localhost 110 Trying 127.0.0.1... Connected to zoidberg. Escape character is '^]'. Fatal: EOF while reading environment from master Connection closed by foreign host.
By the way, after trying to login i have to clean the directory /var/run/dovecot. Otherwise i get this error:
$ telnet localhost 110 Trying 127.0.0.1... Connected to zoidberg. Escape character is '^]'. Fatal: write_full(master_fd) failed: Transport endpoint is not connected Connection closed by foreign host.
Cheers Ronny
On 18.12.2007 22:57, Ronny wrote:
Can you get greeting text if you simply telnet to server?
I get the same error:
$ telnet localhost 143 Trying 127.0.0.1... Connected to zoidberg. Escape character is '^]'. Fatal: EOF while reading environment from master Connection closed by foreign host.
$ telnet localhost 110 Trying 127.0.0.1... Connected to zoidberg. Escape character is '^]'. Fatal: EOF while reading environment from master Connection closed by foreign host.
By the way, after trying to login i have to clean the directory /var/run/dovecot. Otherwise i get this error:
$ telnet localhost 110 Trying 127.0.0.1... Connected to zoidberg. Escape character is '^]'. Fatal: write_full(master_fd) failed: Transport endpoint is not connected Connection closed by foreign host.
Cheers Ronny Can't sure about this but maybe this problem because different types of EOF symbols used in Unix and Windows systems. So it trying to read from master but unable to do so, because receive EOF symbol from beginning.
Can't sure about this but maybe this problem because different types of EOF symbols used in Unix and Windows systems. So it trying to read from master but unable to do so, because receive EOF symbol from beginning.
Cygwin uses Ctrl-D for EOF like all POSIX. (from Cygwin list)
On Tue, 2007-12-18 at 13:15 +0100, Ronny wrote:
Account: 'localhost', Server: 'localhost', Protokoll: POP3, Serveranswer: 'Fatal: EOF while reading environment from master', Port: 110, Secure (SSL): No, error on server: 0x800CCC90, Fehlernummer: 0x800CCC90
What happens when you change this: diff -r d81c10f9b8ec src/login-common/main.c --- a/src/login-common/main.c Tue Dec 11 21:00:14 2007 +0200 +++ b/src/login-common/main.c Thu Dec 20 18:52:15 2007 +0200 @@ -359,7 +359,7 @@ int main(int argc __attr_unused__, char int i, fd = -1, master_fd = -1; bool ssl = FALSE; - is_inetd = getenv("DOVECOT_MASTER") == NULL; + //is_inetd = getenv("DOVECOT_MASTER") == NULL; #ifdef DEBUG if (!is_inetd && getenv("GDB") == NULL)
What happens when you change this:
diff -r d81c10f9b8ec src/login-common/main.c --- a/src/login-common/main.c Tue Dec 11 21:00:14 2007 +0200 +++ b/src/login-common/main.c Thu Dec 20 18:52:15 2007 +0200 @@ -359,7 +359,7 @@ int main(int argc __attr_unused__, char int i, fd = -1, master_fd = -1; bool ssl = FALSE;
- is_inetd = getenv("DOVECOT_MASTER") == NULL; + //is_inetd = getenv("DOVECOT_MASTER") == NULL;
#ifdef DEBUG if (!is_inetd && getenv("GDB") == NULL)
$ telnet localhost 143 Trying 127.0.0.1... Connected to zoidberg. Escape character is '^]'. FBUG: PROCESS_UID environment not given Connection closed by foreign host.
On Thu, 2007-12-20 at 19:10 +0100, Ronny wrote:
What happens when you change this:
diff -r d81c10f9b8ec src/login-common/main.c --- a/src/login-common/main.c Tue Dec 11 21:00:14 2007 +0200 +++ b/src/login-common/main.c Thu Dec 20 18:52:15 2007 +0200 @@ -359,7 +359,7 @@ int main(int argc __attr_unused__, char int i, fd = -1, master_fd = -1; bool ssl = FALSE;
- is_inetd = getenv("DOVECOT_MASTER") == NULL; + //is_inetd = getenv("DOVECOT_MASTER") == NULL;
#ifdef DEBUG if (!is_inetd && getenv("GDB") == NULL)
$ telnet localhost 143 Trying 127.0.0.1... Connected to zoidberg. Escape character is '^]'. FBUG: PROCESS_UID environment not given Connection closed by foreign host.
OK, so the problem is Dovecot master process isn't passing environment variables to child processes it creates. Does this change anything: diff -r d81c10f9b8ec src/master/main.c --- a/src/master/main.c Tue Dec 11 21:00:14 2007 +0200 +++ b/src/master/main.c Thu Dec 20 20:15:55 2007 +0200 @@ -69,7 +69,7 @@ void child_process_init_env(void) int facility; /* remove all environment, we don't need them */ - env_clean(); + //env_clean(); /* we'll log through master process */ env_put("LOG_TO_MASTER=1"); @@ -866,7 +866,7 @@ int main(int argc, char *argv[]) home = getenv("HOME"); /* clean up the environment of everything */ - env_clean(); + //env_clean(); /* put back the TZ */ if (env_tz != NULL)
OK, so the problem is Dovecot master process isn't passing environment variables to child processes it creates. Does this change anything: No, still $ telnet localhost 143 Trying 127.0.0.1... Connected to zoidberg. Escape character is '^]'. FBUG: PROCESS_UID environment not given Connection closed by foreign host.
OK, so the problem is Dovecot master process isn't passing environment variables to child processes it creates. Well,
i added some code to env_put() to log all the environment variables passed to it.
void env_put(const char *env) { ...
printf("env_put()\n"); FILE *file; file = fopen("/tmp/dov.env", "a");
fprintf(file, "%s\n", env);
fclose(file);
}
after running "telnet localhost 143" there are these variables:
$ telnet.exe localhost 143 Trying 127.0.0.1... Connected to zoidberg. Escape character is '^]'. FBUG: PROCESS_UID environment not given env_put() env_put() env_put() env_put() env_put() env_put() env_put() Connection closed by foreign host.
Administrator@zoidberg ~/dovecot-1.0.9 $ cat /tmp/dov.env RESTRICT_USER= RESTRICT_CHROOT= RESTRICT_SETUID= RESTRICT_SETGID= RESTRICT_SETEXTRAGROUPS= RESTRICT_GID_FIRST= RESTRICT_GID_LAST=
So PROCESS_UID is never set using env_put() till the point where it is looked for!
Cheers Ronny
On Thu, 2007-12-27 at 02:08 +0100, Ronny wrote:
So PROCESS_UID is never set using env_put() till the point where it is looked for!
The code path to set it is in src/master/login-process.c:
login_processes_init() -> login_processes_start_missing() timeout -> login_group_start_missings() -> create_login_process() -> fork, login_process_init_env().
Aren't those called?
participants (3)
-
Nikolay Shopik
-
Ronny
-
Timo Sirainen