[Tutor] Real time reading

Liam Clarke cyresse at gmail.com
Sun Dec 5 12:22:54 CET 2004


You could just get Python to see if the maillog has increased in size,
and if so then open it, or you could get the 'last modified date' and
so forth... os module will do this.

Or, all changes to the maillog could be passed through Python, which writes it?
http://www.python.org/doc/2.3/lib/module-StringIO.html

???

Good luck,

Liam Clarke


On Sun, 5 Dec 2004 11:31:32 +0100 (CET), Øyvind <python at kapitalisten.no> wrote:
> I would like to analyze a maillog. The maillog is automatically generated
> and every mail sent is added to the log. I would like to check if someone
> send more than 5 mails pr minute (spams) and if so, get Python to send a
> warningmail to the mailmaster.
> 
> How would I in the best way read the log? To open the file and close it
> every second sounds like a bad idea? Is there some function to analyze the
> file, and automatically extract additions to the file?
> 
> Thanks in advance.
> 
> --
> This email has been scanned for viruses & spam by Decna as - www.decna.no
> Denne e-posten er sjekket for virus & spam av Decna as - www.decna.no
> 
> _______________________________________________
> Tutor maillist  -  Tutor at python.org
> http://mail.python.org/mailman/listinfo/tutor
> 


-- 
'There is only one basic human right, and that is to do as you damn well please.
And with it comes the only basic human duty, to take the consequences.


More information about the Tutor mailing list