#1  
Old 27th November 2008, 20:13
ivoks ivoks is offline
Junior Member
 
Join Date: Nov 2008
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default Bug in mail_logs.php

Hi!

I've noticed a bug in mail_logs.php which generates mail traffic stats. Line in my mail.log:

Nov 15 14:19:04 xxxx postfix/smtpd[27493]: NOQUEUE: reject: RCPT from
xxxxxxxxxxxxxx[xxxxxxxxxxx]: 450 4.1.8
<prvs=1203725193=xxxxxxx@xxxxxxx>: Sender address rejected:
Domain not found; from=<prvs=1203725193=xxxxxxxxx@xxxxxxxxx>
to=<xxxx@xxxx> proto=ESMTP helo=<xxxxxxxxxxx>

resulted in '1203725193' being counted as a mail traffic. This was caused by a line in '/root/ispconfig/scripts/shell/mail_logs.php':

exec("grep -iw ".$mod->system->server_conf["server_mta"]." $dist_mail_log.$datum | grep -iw from | grep -iw $domain | grep -iw $monat_kurz | cut -f2 -d, | cut -f2 -d= > $dist_mail_log.$vhost");

This is wrong. You guys should really use awk or something. I found that:

exec("grep -iw ".$mod->system->server_conf["server_mta"]." $dist_mail_log.$datum | grep -iw from | grep -iw $domain | grep -iw $monat_kurz | grep size= | awk -F', size=' '{print $2}' | cut -d\, -f1 > $dist_mail_log.$vhost");

works much better in my setup (postfix).

Take care.

Last edited by ivoks; 27th November 2008 at 20:18.
Reply With Quote
Sponsored Links
  #2  
Old 28th November 2008, 12:53
falko falko is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 41,701
Thanks: 1,900
Thanked 2,735 Times in 2,571 Posts
Default

I've added this to our bugtracker.
__________________
Falko
--
Download the ISPConfig 3 Manual! | Check out the ISPConfig 3 Billing Module!

FB: http://www.facebook.com/howtoforge

nginx-Webhosting: Timme Hosting | Follow me on:
Reply With Quote
  #3  
Old 26th January 2010, 21:02
jmroth jmroth is offline
ISPConfig Developer
 
Join Date: Sep 2005
Posts: 191
Thanks: 1
Thanked 6 Times in 6 Posts
 
Exclamation fix in r1109 FS#333

I see there is a potential fix for the mail size logging.
However
1) when awk is not available, the old (potentially flawed) code is used.
2) additionally, when there is more logging to the mail.log like
Code:
Jan 26 18:19:24 mark5 postfix-policyd: rcpt=10111, throttle=clear(a), host=iii.iii.iii.iii, from=xxx, to=yyy, size=0/999999999, quota=0/100000000, count=1/512(450), rcpt=1/3600(1757), threshold=0%|0%|0%
additional matches that should not happen do happen.

In the postfix case one should only consider lines with 'postfix/qmgr'.
In the sendmail case I wouldn't know what to do, since I don't use sendmail...

If the problem is that one does not know whether grep/awk etc. exists (with the desired features) on potentially ancient systems like Debian 3.0 etc. one should maybe include the required tools with the installation package.
__________________
[ISPC 2 / Debian Lenny]
Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
DNSManager Bug or Feature Request jasonathowtoforge Developers' Forum 2 26th August 2008 20:37
ISPConfig 2.2.24 | mailuser app bug? Hans General 19 4th August 2008 15:18
BUG: Forward email? edge General 3 1st June 2007 16:49
I have a bug with mysql lionnet Installation/Configuration 1 20th December 2006 10:33
Little cosmetic bug in check_disk.plugin.php martinfst Tips/Tricks/Mods 1 12th December 2006 14:04


All times are GMT +2. The time now is 21:41.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.