Re: [Dovecot] /usr/lib/dovecot/imap ignores log settings?

2011-12-29 Thread Timo Sirainen
On 28.12.2011, at 20.31, Asheesh Laroia wrote:

 Hi Dovecot peeps,
 
 I'm enjoying running /usr/lib/dovecot/imap directly as a PREAUTH IMAP pipe.
 
 I find that it outputs log messages whose severity is INFO to stdout. I'm 
 running it as follows:
 
   /usr/lib/dovecot/imap -c /tmp/dovecot.conf
 
 and I see the following messages output to stdout:

stderr actually.

 I'd like that message to actually not be printed, which is why I set log_path 
 to syslog.

Not possible currently. Either do:

/usr/lib/dovecot/imap 2 ~/imap.log

Or patch the source:

diff -r 056934abd2ef src/imap/main.c
--- a/src/imap/main.c   Wed Dec 21 14:40:29 2011 +0200
+++ b/src/imap/main.c   Thu Dec 29 14:51:12 2011 +0200
@@ -320,6 +320,7 @@
 
if (IS_STANDALONE()) {
service_flags |= MASTER_SERVICE_FLAG_STANDALONE |
+   MASTER_SERVICE_FLAG_DONT_LOG_TO_STDERR |
MASTER_SERVICE_FLAG_STD_CLIENT;
} else {
service_flags |= MASTER_SERVICE_FLAG_KEEP_CONFIG_OPEN;



Re: [Dovecot] /usr/lib/dovecot/imap ignores log settings?

2011-12-29 Thread Asheesh Laroia

On Thu, 29 Dec 2011, Timo Sirainen wrote:


On 28.12.2011, at 20.31, Asheesh Laroia wrote:


Hi Dovecot peeps,

I'm enjoying running /usr/lib/dovecot/imap directly as a PREAUTH IMAP pipe.

I find that it outputs log messages whose severity is INFO to stdout. I'm 
running it as follows:

/usr/lib/dovecot/imap -c /tmp/dovecot.conf

and I see the following messages output to stdout:


stderr actually.


Right. Thanks for that; I saw it was file descriptor 2 in the strace after 
I hit send.



I'd like that message to actually not be printed, which is why I set log_path 
to syslog.


Not possible currently. Either do:

/usr/lib/dovecot/imap 2 ~/imap.log

Or patch the source:


[snip]

Great! That should be okay for now.

-- Asheesh.


[Dovecot] /usr/lib/dovecot/imap ignores log settings?

2011-12-28 Thread Asheesh Laroia

Hi Dovecot peeps,

I'm enjoying running /usr/lib/dovecot/imap directly as a PREAUTH IMAP pipe.

I find that it outputs log messages whose severity is INFO to stdout. I'm 
running it as follows:


/usr/lib/dovecot/imap -c /tmp/dovecot.conf

and I see the following messages output to stdout:

* PREAUTH [CAPABILITY IMAP4rev1 LITERAL+ SASL-IR LOGIN-REFERRALS ID ENABLE IDLE 
SORT SORT=DISPLAY THREAD=REFERENCES THREAD=REFS MULTIAPPEND UNSELECT CHILDREN 
NAMESPACE UIDPLUS LIST-EXTENDED I18NLEVEL=1 CONDSTORE QRESYNC ESEARCH ESORT 
SEARCHRES WITHIN CONTEXT=SEARCH LIST-STATUS] Logged in as paulproteus

imap(paulproteus): Info: Connection closed bytes=0/305

Naturally, the first line is great.

My /tmp/dovecot.conf is:

cut here
# single-dbox
mail_location = sdbox:~/Maildir/dbox

log_path = syslog
info_log_path = /dev/null
/cut

I'm also attaching strace output, created by running this command:

echo | strace /usr/lib/dovecot/imap -c /tmp/dovecot.conf   /tmp/straced 21

(The point of the echo |  is to provide a newline and then EOF to 
/usr/lib/dovecot/imap.)


You can see in the strace output that /usr/lib/dovecot/imap outputs the 
Connection closed message to file descriptor 2. I'd like that message to 
actually not be printed, which is why I set log_path to syslog.


-- Asheesh.execve(/usr/lib/dovecot/imap, [/usr/lib/dovecot/imap, -c, 
/tmp/dovecot.conf], [/* 31 vars */]) = 0
brk(0)  = 0x1eb8000
access(/etc/ld.so.nohwcap, F_OK)  = -1 ENOENT (No such file or directory)
mmap(NULL, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 
0x7ff03ee31000
access(/etc/ld.so.preload, R_OK)  = -1 ENOENT (No such file or directory)
open(/usr/lib/dovecot/tls/x86_64/libdovecot-storage.so.0, O_RDONLY) = -1 
ENOENT (No such file or directory)
stat(/usr/lib/dovecot/tls/x86_64, 0x7fff1a7c24f0) = -1 ENOENT (No such file 
or directory)
open(/usr/lib/dovecot/tls/libdovecot-storage.so.0, O_RDONLY) = -1 ENOENT (No 
such file or directory)
stat(/usr/lib/dovecot/tls, 0x7fff1a7c24f0) = -1 ENOENT (No such file or 
directory)
open(/usr/lib/dovecot/x86_64/libdovecot-storage.so.0, O_RDONLY) = -1 ENOENT 
(No such file or directory)
stat(/usr/lib/dovecot/x86_64, 0x7fff1a7c24f0) = -1 ENOENT (No such file or 
directory)
open(/usr/lib/dovecot/libdovecot-storage.so.0, O_RDONLY) = 3
read(3, 
\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0\0\1\0\0\0\340\313\2\0\0\0\0\0..., 832) = 
832
fstat(3, {st_mode=S_IFREG|0644, st_size=898088, ...}) = 0
mmap(NULL, 2993560, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 
0x7ff03e939000
mprotect(0x7ff03ea0d000, 2093056, PROT_NONE) = 0
mmap(0x7ff03ec0c000, 32768, PROT_READ|PROT_WRITE, 
MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0xd3000) = 0x7ff03ec0c000
close(3)= 0
open(/usr/lib/dovecot/libdovecot.so.0, O_RDONLY) = 3
read(3, 
\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0\0\1\0\0\0\200\217\1\0\0\0\0\0..., 832) = 
832
fstat(3, {st_mode=S_IFREG|0644, st_size=533816, ...}) = 0
mmap(NULL, 2639392, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 
0x7ff03e6b4000
mprotect(0x7ff03e734000, 2093056, PROT_NONE) = 0
mmap(0x7ff03e933000, 12288, PROT_READ|PROT_WRITE, 
MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x7f000) = 0x7ff03e933000
mmap(0x7ff03e936000, 9760, PROT_READ|PROT_WRITE, 
MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x7ff03e936000
close(3)= 0
open(/usr/lib/dovecot/libdl.so.2, O_RDONLY) = -1 ENOENT (No such file or 
directory)
open(/etc/ld.so.cache, O_RDONLY)  = 3
fstat(3, {st_mode=S_IFREG|0644, st_size=127929, ...}) = 0
mmap(NULL, 127929, PROT_READ, MAP_PRIVATE, 3, 0) = 0x7ff03ee11000
close(3)= 0
access(/etc/ld.so.nohwcap, F_OK)  = -1 ENOENT (No such file or directory)
open(/lib/x86_64-linux-gnu/libdl.so.2, O_RDONLY) = 3
read(3, \177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0\0\1\0\0\0\340\r\0\0\0\0\0\0..., 
832) = 832
fstat(3, {st_mode=S_IFREG|0644, st_size=14768, ...}) = 0
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 
0x7ff03ee1
mmap(NULL, 2109696, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 
0x7ff03e4b
mprotect(0x7ff03e4b2000, 2097152, PROT_NONE) = 0
mmap(0x7ff03e6b2000, 8192, PROT_READ|PROT_WRITE, 
MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x2000) = 0x7ff03e6b2000
close(3)= 0
open(/usr/lib/dovecot/librt.so.1, O_RDONLY) = -1 ENOENT (No such file or 
directory)
access(/etc/ld.so.nohwcap, F_OK)  = -1 ENOENT (No such file or directory)
open(/lib/x86_64-linux-gnu/librt.so.1, O_RDONLY) = 3
read(3, \177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0\0\1\0\0\0\220!\0\0\0\0\0\0..., 
832) = 832
fstat(3, {st_mode=S_IFREG|0644, st_size=31744, ...}) = 0
mmap(NULL, 2128856, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 
0x7ff03e2a8000
mprotect(0x7ff03e2af000, 2093056, PROT_NONE) = 0
mmap(0x7ff03e4ae000, 8192, PROT_READ|PROT_WRITE, 
MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x6000) = 0x7ff03e4ae000
close(3)