[CentOS] sendmail and rbl blocking - generating statistics
debian at herakles.homelinux.org
Wed Mar 14 22:13:24 UTC 2007
Will McDonald wrote:
> On 14/03/07, Ryan Simpkins <centos at ryansimpkins.com> wrote:
>> Mar 14 09:31:36 io sendmail: ruleset=check_relay,
>> arg2=127.0.0.2, relay=[126.96.36.199], reject=554 5.7.1 Rejected
>> 188.8.131.52 found in
>> Try doing a simple 'cat /var/log/maillog | grep -c check_relay'
> You can avoid the unnecessary 'cat' by just passing the filename to
> grep directly:
> # grep -c check_relay /var/log/maillog
> This *should* be quicker, especially in looping constructs.
>> For my server:
>> cat /var/log/maillog | grep checK_relay | grep -c spamhaus
> # grep -c 'checK_relay.*spamhaus' /var/log/maillog
> # grep -c 'checK_relay.*spamcop' /var/log/maillog
> # grep -c 'checK_relay.*njabl' /var/log/maillog
> Would probably be more efficient and faster, you can test with 'time'
> to verify this. You're spawning one process 'grep', instead of three
> seperate processes, 'cat, 'grep' and 'grep' again.
It might be quicker, but that doesn't make it more efficient;-)
I often "evolve" my commandlines (I commonly use one that's 500+
characters long) and if I don't start with a cat I often wish I did:-/
1aaaaaaa at coco.merseine.nu Z1aaaaaaa at coco.merseine.nu
Please do not reply off-list
More information about the CentOS