[FR] Let us choose which log file to use for Dovecot

interfasys

Verified User
Joined
Oct 31, 2003
Messages
1,821
Location
Switzerland
We're not using maillog for Dovecot as we prefer to have separate log files for each app, if possible.
This is now a problem when using DA, because DA is only looking in maillog for IMAP/POP3 BW usage.

Would it be possible to let us specify which file to use to calculate the BW usage?
 
Is there a particular reason for using da-popb4smtp to log bandwidth usage? It seems logs are not parsed if it's not running (we'd rather have user authenticate when sending emails).
 
Last edited:
Hello,

We use da-popb4smtp because it's already parsing the logs and reduced having to parse an often very large maillog file during the tally (as rotation time and size limit is not guaranteed, so can often span a huge amount of data)
The da-popb4smtp is always running and is not affected by resets or tallies, etc.. so it never loses it's space (unless it's restarted or the box is rebooted)
To disable the use of popb4smtp with exim, simply comment out the pophosts file from the /etc/exim.conf.
That way, bandwidth is still logged.

John
 
This doesn't seem to be working. dovecot.bytes files are not being created even though da-popb4smtp is working:
40596 ?? Ss 0:09.80 /usr/local/directadmin/da-popb4smtp f /var/log/dovecot/infolog
 
Try:
Code:
/usr/local/directadmin/da-popb4smtp s f /var/log/dovecot/infolog
to run in standalone (debug) mode.
We want to see: "Using set log file: /var/log/dovecot/infolog"

There should also be a log with info:
/var/log/directadmin/da-popb4smtp.log

John
 
Here is what I get:
Bus error: 10 (core dumped)

I do have a few "Using set log file: /var/log/dovecot/infolog" in the logs though.
 
Last edited:
If possible, let us know what gdb tells us, eg:
Code:
cd /usr/local/directadmin
gdb da-popb4smtp
run s f /var/log/dovecot/infolog
and when it dies, type:
Code:
bt full
and paste us the info from it.[/code]Does the binary work ok with the usual /var/log/maillog file? (without the f option)

John
 
I did try that but the backtrace isn't very meaningful:
Code:
Program received signal SIGBUS, Bus error.
0x0000000000467356 in strlen ()
(gdb) bt full
#0  0x0000000000467356 in strlen ()
No symbol table info available.
#1  0x000000000046014a in __vfprintf ()
No symbol table info available.
#2  0x0000000000461260 in vfprintf ()
No symbol table info available.
#3  0x0000000000422243 in log ()
No symbol table info available.
#4  0x000000000042363b in main ()
No symbol table info available.

Interestingly, there is no issue when doing "run s". Here is the message:
"Log has been updated, scanning from 0"
 
Hello,

Hmm, ok thanks.
I can tell from the above output exactly where the issue is, but I'm just not yet sure why.
It's almost as if the argv[i+1] (where 'i' is the count of 'f') is blank... but if it were, then there would have been a segfault sooner.

While I was checking over the code, I did find that no va_end was called after the va_start, which could possibly be playing a role.. even though the issue doesn't seem to be showing up on our test box (CentOS 4, 32).
Let me know which OS version you're running and I'll test there. I'll also upload the pre-release binaries with the missing va_end call.. but I'm not sure if it will make any difference.

John
 
The good news is that I was able to duplicate the issue on our FreeBSD 8 box.
The bad news is.. there isn't any bad news.

Caused was that apparently, one shouldn't be using a va_list more than once, so I simply created a new one with a 2nd va_start for the debug print (without the debug, it should have worked)

In any case, I'm compiling up a new set of binaries for FreeBSD 8 now, should be available in the pre-release section within 30 minutes.

John
 
OK, this time the binary doesn't crash and I see this in debug mode:
Code:
Using set log file: /var/log/dovecot/infolog
Log has been updated, scanning from 0
However, after having started the process and after having sent/received emails, there is still no trace of dovecot.bytes files.

Here is a bytes entry in the log:
Code:
May 03 13:51:44 imap-login: Info: Login: user=<[email protected]>, method=PLAIN, rip=178.239.83.189, lip=192.168.1.1, mpid=24145, TLS
May 03 13:51:53 imap([email protected]): Info: Disconnected: Logged out in=112 [B]out=5702097[/B]
 
Last edited:
Back
Top