Greylisting .. nice ..

James Gray james at grayonline.id.au
Wed Nov 8 00:14:10 GMT 2006


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 08/11/2006, at 7:12 AM, mikea wrote:
> $ grep graylist /var/log/maillog | wc -l
>     2807
> $ grep "accepted for delivery" /var/log/maillog | wc -l
>     2308
>
> Just now, at 1409 local:
> grep "accepted for delivery" /var/log/maillog | wc -l && grep  
> graylist /var/log/maillog | wc -l
>     2642
>     3115

Just a quick observation that has nothing to do with grey listing :)   
Most *nix admins I know have broken old habits and no longer do the  
old (and unnecessary) "cat <file> | less" in lieu of the more terse  
"less <file>" along with other redundant pipes.  Similarly "grep" can  
count matching lines without the need of piping through "wc" (at  
least I can confirm this with Gnu grep...not sure of the others).

grep <pattern> <file> | wc -l

is effectively the same as

grep -c <pattern> <file>

"man grep" reveals:

- -c, --count
       Suppress normal output; instead print a count of matching  lines
       for  each  input  file.  With the -v, --invert-match option (see
       below), count non-matching lines.

Not sure how BSD/Solaris/AIX/etc grep does things, but the "-c"  
option has been around for ages in Gnu-land and gnu-grep is the  
standard on Mac OSX along with all the Linuxes.

Usual disclaimers apply and YYMV :)

Cheers,

James
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.3 (Darwin)

iD8DBQFFUSFWwBHpdJO7b9ERApL5AKDC6PDIvvkmvveQ5/EuPgIZ/mJGfACdGI7S
JfLQ8xiN8e9g5qNy6veecQ0=
=tRr0
-----END PGP SIGNATURE-----


More information about the MailScanner mailing list