Koozali.org: home of the SME Server

Smtp log size

Offline mikalof

  • **
  • 27
  • +0/-0
Smtp log size
« on: February 16, 2012, 09:09:10 AM »
Hello,
I need more backtracking in the qpsmtpd logs, how do I increase logfile size and/or number of saved logfiles?
Is there a db setting for this or maybe a contrib?


Offline mmccarn

  • *
  • 2,656
  • +10/-0
Re: Smtp log size
« Reply #1 on: February 16, 2012, 12:36:58 PM »
qpsmtpd (in-bound emails):
Code: [Select]
config setprop qpsmtpd KeepLogFiles 20
sv stop qpsmtpd
kill -HUP `cat /var/service/qpsmtpd/log/supervise/pid`
sv start qpsmtpd

sqpsmtpd (mostly authenticated relay from remote users):
Code: [Select]
config setprop sqpsmtpd KeepLogFiles 20
sv t sqpsmtpd
kill -HUP `cat /var/service/sqpsmtpd/log/supervise/pid`
sv start qpsmtpd

The default is 10.

You're setting the number of @....... logfiles to keep in /var/log/qpsmtpd (or /var/log/sqpsmtpd).

When you're done, ps auxwww |grep multilog.*qpsmtpd should show the new number of logfiles you've set:
smelog    1703  0.0  0.0   1624   312 ?        S    Feb15   0:00 /usr/local/bin/multilog t s5000000 n10 /var/log/sqpsmtpd
smelog   30287  0.0  0.0   1756   376 ?        S    06:32   0:00 /usr/local/bin/multilog t s5000000 n20 !/usr/local/bin/qplogsumm.pl /var/log/qpsmtpd

Offline mmccarn

  • *
  • 2,656
  • +10/-0
Re: Smtp log size
« Reply #2 on: February 16, 2012, 01:11:18 PM »
FYI -

I've added an explanation of the qpsmtpd/sqpsmtpd KeepLogFiles db setting to this wiki page:
http://wiki.contribs.org/Mail_log_file_analysis#View_log_files

And updated Bug 6293 (which requested documentation of the KeepLogFiles option added in Bug 2862).

Offline mikalof

  • **
  • 27
  • +0/-0
Re: Smtp log size
« Reply #3 on: February 16, 2012, 01:49:39 PM »
For some reason the code doesn't seem to work:

[root@sme.inveon.fi ~]# ps auxwww |grep multilog.*qpsmtpd
smelog    3609  0.0  0.0  2008  324 ?        S    14:35   0:00 /usr/local/bin/multilog t s5000000 !/usr/local/bin/qplogsumm.pl /var/log/qpsmtpd
smelog    3747  0.0  0.0  3160  324 ?        S    14:36   0:00 /usr/local/bin/multilog t s5000000 /var/log/sqpsmtpd
root      3907  0.0  0.0  4936  596 pts/0    S+   14:37   0:00 grep multilog.*qpsmtpd

shows multilog didn't act upon new setting. Where exactly is this multilog setting stored? Is it possible I need to reboot?

Offline mikalof

  • **
  • 27
  • +0/-0
Re: Smtp log size
« Reply #4 on: February 16, 2012, 02:09:14 PM »
After some research I noticed I have a differrent version of qpsmtp than what is discussed in bug 2862.

[root@sme.inveon.fi ~]# rpm -q smeserver-qpsmtpd
smeserver-qpsmtpd-2.0.0-7.el4.sme

However Yum doesn't report any updates available. Is this possibly only a feature of SME8? I have 7.5.1.

Offline mmccarn

  • *
  • 2,656
  • +10/-0
Re: Smtp log size
« Reply #5 on: February 16, 2012, 07:37:37 PM »
It looks like you're right (my testing this morning was done on SME8beta7).

It looks like the only way to do this in SME7 is still as described here:
http://forums.contribs.org/index.php/topic,32853.msg139334.html#msg139334

basically, open /var/service/qpsmtpd/log/run and add n50 (or whatever) after s5000000

Sadly, /var/service/qpsmtpd/log/run is not templated, so any sme update that includes smeserver-qpsmtpd.noarch will overwrite your customization.

Offline mikalof

  • **
  • 27
  • +0/-0
Re: Smtp log size
« Reply #6 on: February 16, 2012, 08:07:42 PM »
I'm glad to hear it's going to be available in SME8 since our incoming log gets quite quickly filled. Meanwhile I'll continue to check the logfiles from backups until SME8 will hopefully soon be released.

Offline CharlieBrady

  • *
  • 6,918
  • +3/-0
Re: Smtp log size
« Reply #7 on: February 16, 2012, 08:23:08 PM »
Hello,I need more backtracking in the qpsmtpd logs, how do I increase logfile size and/or number of saved logfiles?

Before you do that, I'd suggest you change the LogLevel so that it is more concise with its logging.

Offline mikalof

  • **
  • 27
  • +0/-0
Re: Smtp log size
« Reply #8 on: February 16, 2012, 08:36:22 PM »
Hello Charlie,
I understand LogLevel increases verbosity, which is good when looking for problems, but as a downside one needs even greater logfiles. Or older backups. At some point when we had some troubles I tried LogLevel=8 but found then I only had a couple of days worth of logs.

Offline CharlieBrady

  • *
  • 6,918
  • +3/-0
Re: Smtp log size
« Reply #9 on: February 16, 2012, 08:46:42 PM »
I understand LogLevel increases verbosity, ...

My understanding is that it can increase or decrease it, depending on the value chosen.

Offline mikalof

  • **
  • 27
  • +0/-0
Re: Smtp log size
« Reply #10 on: February 16, 2012, 08:51:01 PM »
Which makes me think that it would be a greater benefit to be able to adjust the log retention time instead of size. This way I could be sure I have backtracking ability to a specific time in the past. Can multilog do this?

Offline CharlieBrady

  • *
  • 6,918
  • +3/-0
Re: Smtp log size
« Reply #11 on: February 17, 2012, 04:34:46 AM »