From: Lauchlin W. <lau...@in...> - 2005-05-11 05:55:36
|
Hi, have found a small problem with bw.pl (at least on our systems). Am running the latest stable version of webmin+virtualmin. We are using amavis to do virus scanning using the the postfix after queue filtering method. As such all our postfix deliverie logs are of the format May 11 15:32:42 server postfix/smtp[28066]: ID: to=<us...@re...>, orig_to=<som...@so...>, relay=amavishost, delay=1, status=sent (250 2.6.0 Ok, id=28777-09, from MTA: 250 Ok: queued as ID) With the way feature-mail.pl tracks things at the moment it only ever looks at the to= part not the orig_to= part so no mail gets tracked for any domains. I have changed sub bandwidth_mail in feature-mail.pl to use: (/^(\S+)\s+(\d+)\s+(\d+):(\d+):(\d+)\s+(\S+)\s+(\S+):\s+(\S+):\s+to= (\S+),\sorig_to=(\S+),/) instead of: (/^(\S+)\s+(\d+)\s+(\d+):(\d+):(\d+)\s+(\S+)\s+(\S+):\s+(\S+):\s+to= (\S+),/) and also changed: local $user = $10; rather than $9 These small changes seem to now make monitoring work properly. Am not sure how you'd go about intergrating this into webmin, maybe as part of the config you can have a check box that says "use orig_to= rather than to=" or something similar. I am guessing that quite a few people would have the same issue, unless of course I am running our servers in some bizzare unheard of set up! Hope this helps, Cheers, Lauchlin |
From: Jamie C. <jca...@we...> - 2005-05-11 06:17:29
|
On Wed, 2005-05-11 at 15:42, Lauchlin Wilkinson wrote: > Hi, > > have found a small problem with bw.pl (at least on our systems). Am > running the latest stable version of webmin+virtualmin. We are using > amavis to do virus scanning using the the postfix after queue > filtering method. As such all our postfix deliverie logs are of the > format > > May 11 15:32:42 server postfix/smtp[28066]: ID: > to=<us...@re...>, > orig_to=<som...@so...>, relay=amavishost, > delay=1, status=sent (250 2.6.0 Ok, id=28777-09, from MTA: 250 Ok: > queued as ID) > > With the way feature-mail.pl tracks things at the moment it only ever > looks at the to= part not the orig_to= part so no mail gets tracked > for any domains. > > I have changed sub bandwidth_mail in feature-mail.pl to use: > > (/^(\S+)\s+(\d+)\s+(\d+):(\d+):(\d+)\s+(\S+)\s+(\S+):\s+(\S+):\s+to= > (\S+),\sorig_to=(\S+),/) > > instead of: > > (/^(\S+)\s+(\d+)\s+(\d+):(\d+):(\d+)\s+(\S+)\s+(\S+):\s+(\S+):\s+to= > (\S+),/) > > and also changed: > > local $user = $10; > > rather than $9 > > > These small changes seem to now make monitoring work properly. Am > not sure how you'd go about intergrating this into webmin, maybe as > part of the config you can have a check box that says "use orig_to= > rather than to=" or something similar. I am guessing that quite a > few people would have the same issue, unless of course I am running > our servers in some bizzare unheard of set up! Thanks for pointing out this log format - I will support it in the next Virtualmin release, in pretty much the same way you did. I presume that the orig_to= is always the address the mail was originally sent to, while the to= is the final Unix recipient? - Jamie |
From: Lauchlin W. <lau...@in...> - 2005-05-11 06:37:13
|
On 11 May 2005, at 16:17, Jamie Cameron wrote: > >> >> >> These small changes seem to now make monitoring work properly. Am >> not sure how you'd go about intergrating this into webmin, maybe as >> part of the config you can have a check box that says "use orig_to= >> rather than to=" or something similar. I am guessing that quite a >> few people would have the same issue, unless of course I am running >> our servers in some bizzare unheard of set up! >> > > Thanks for pointing out this log format - I will support it in the > next > Virtualmin release, in pretty much the same way you did. I presume > that > the orig_to= is always the address the mail was originally sent to, > while the to= is the final Unix recipient? > > - Jamie > Hi Jamie, that is correct. The orig_to= attribute is always the original e- mail address and the to= attribute is always the localunixuser@hostname . On return from our amavis host the e-mails are always addressed in the format to=localunixuser@hostname and does not contain the orig_to= attribute. I guess the easiest way to do it would be to look for orig_to= conditionally in the regular expression and if doesn't find it just use the to= part. The nice thing about always looking for orig_to= tho is that the expression never matches on e-mails coming back from our amavis host, as they never have an orig_to attribute, therefore saving a few cpu cycles on doing the split of the username and comparing the domain to maildomains. Cheers, Lauchlin |
From: Jamie C. <jca...@we...> - 2005-05-11 07:25:44
|
On Wed, 2005-05-11 at 16:36, Lauchlin Wilkinson wrote: > On 11 May 2005, at 16:17, Jamie Cameron wrote: > > > > >> > >> > >> These small changes seem to now make monitoring work properly. Am > >> not sure how you'd go about intergrating this into webmin, maybe as > >> part of the config you can have a check box that says "use orig_to= > >> rather than to=" or something similar. I am guessing that quite a > >> few people would have the same issue, unless of course I am running > >> our servers in some bizzare unheard of set up! > >> > > > > Thanks for pointing out this log format - I will support it in the > > next > > Virtualmin release, in pretty much the same way you did. I presume > > that > > the orig_to= is always the address the mail was originally sent to, > > while the to= is the final Unix recipient? > > > > - Jamie > > > > Hi Jamie, > > that is correct. The orig_to= attribute is always the original e- > mail address and the to= attribute is always the > localunixuser@hostname . On return from our amavis host the e-mails > are always addressed in the format to=localunixuser@hostname and does > not contain the orig_to= attribute. > > I guess the easiest way to do it would be to look for orig_to= > conditionally in the regular expression and if doesn't find it just > use the to= part. The nice thing about always looking for orig_to= > tho is that the expression never matches on e-mails coming back from > our amavis host, as they never have an orig_to attribute, therefore > saving a few cpu cycles on doing the split of the username and > comparing the domain to maildomains. Thanks for that info .. I will have Virtualmin look for orig_to= if it is there, and if not fall back to the to= attribute. - Jamie |