Re: what hours correspondent is most active in?

2010-08-23 Thread E. Prom
On Tuesday, 10 August 2010, 00:48:16 +0300,
Dennis Yurichev den...@conus.info wrote:
 Is there any plugin or script which is able to collect time stamps of
 all emails from some specific email address and to draw a statistical
 chart answering to question: what hours correspondent is most active in?

mailliststat.

Graphs in text mode, for mbox only. Stats about MUA also, and much more.


Re: what hours correspondent is most active in?

2010-08-23 Thread Patrick Shanahan
* Dennis Yurichev den...@conus.info [01-01-70 11:34]:
 
 Is there any plugin or script which is able to collect time stamps of
 all emails from some specific email address and to draw a statistical
 chart answering to question: what hours correspondent is most active in?
 

I have a perl script that won't draw charts but will give hourly traffic
and is for postfix rather than reading a particular maildir/mh/mdir/...
type, by James S. Seymour
 
 http://wahoo.no-ip.org/~pat/pflogsumm.pl
-- 
Patrick Shanahan Plainfield, Indiana, USAHOG # US1244711
http://wahoo.no-ip.org Photo Album:  http://wahoo.no-ip.org/gallery2
Registered Linux User #207535@ http://counter.li.org


Re: what hours correspondent is most active in?

2010-08-09 Thread Chip Camden
Quoth Dennis Yurichev on Tuesday, 10 August 2010:
 -BEGIN PGP SIGNED MESSAGE-
 Hash: SHA1
 
 Hi.
 
 Is there any plugin or script which is able to collect time stamps of
 all emails from some specific email address and to draw a statistical
 chart answering to question: what hours correspondent is most active in?
 
Are you using mbox or maildir?

-- 
Sterling (Chip) Camden| sterl...@camdensoftware.com | 2048D/3A978E4F
http://camdensoftware.com | http://chipstips.com| http://chipsquips.com


pgpxybD31XnQl.pgp
Description: PGP signature


Re: what hours correspondent is most active in?

2010-08-09 Thread Chip Camden
Quoth Dennis Yurichev on Tuesday, 10 August 2010:
 -BEGIN PGP SIGNED MESSAGE-
 Hash: SHA1
 
 On 10-Aug-10 01:15, Chip Camden wrote:
  Is there any plugin or script which is able to collect time stamps of
  all emails from some specific email address and to draw a statistical
  chart answering to question: what hours correspondent is most active in?
 
  Are you using mbox or maildir?
 
 I'm considering to switch to whatever can help me :-)
 
Okay then, this will give you the raw data for mbox.  If you want to know
the times that f...@example.com sent you mail that's in your Inbox, type:

mailfrom.rb -f f...@example.com ~/Mail/Inbox

Then you can pipe that to something that computes whatever stats from
those times you want.


#!/usr/bin/env ruby
# usage: mailfrom.rb -f from file...
#
# where from is a regular expression for the From: header field value.
#
require optparse

pat = nil
optparse = OptionParser.new do |opts|
  opts.banner = 'usage: mailfrom.rb [-f regexp] file...'

  opts.on('-f', '--from REGEXP', 'Specify From: header field filter') do |from|
pat = Regexp.new(^From:\s*#{from})
  end
end

begin
  optparse.parse!
rescue OptionParser::InvalidOption, OptionParser::MissingArgument = e
  puts e
  puts optparse
  exit 1
end
in_hdr=false
date = nil
pick = nil
$.each do |line|
  case line
when /^From /
  in_hdr = true
  date = nil
  pick = nil
when /^Date: (.*)/
  if in_hdr
date = $1
puts date if pick
  end
when pat
  if in_hdr
puts date if date
pick = true
  end
when /^\s*$/
  in_hdr = false
  end
end

-- 
Sterling (Chip) Camden| sterl...@camdensoftware.com | 2048D/3A978E4F
http://camdensoftware.com | http://chipstips.com| http://chipsquips.com


pgpAdrpmeSyEm.pgp
Description: PGP signature


Re: what hours correspondent is most active in?

2010-08-09 Thread Chip Camden
Quoth Chip Camden on Monday, 09 August 2010:
 Quoth Dennis Yurichev on Tuesday, 10 August 2010:
  -BEGIN PGP SIGNED MESSAGE-
  Hash: SHA1
  
  On 10-Aug-10 01:15, Chip Camden wrote:
   Is there any plugin or script which is able to collect time stamps of
   all emails from some specific email address and to draw a statistical
   chart answering to question: what hours correspondent is most active in?
  
   Are you using mbox or maildir?
  
  I'm considering to switch to whatever can help me :-)
  
 Okay then, this will give you the raw data for mbox.  If you want to know
 the times that f...@example.com sent you mail that's in your Inbox, type:
 
 mailfrom.rb -f f...@example.com ~/Mail/Inbox
 
 Then you can pipe that to something that computes whatever stats from
 those times you want.
 
 
 #!/usr/bin/env ruby
 # usage: mailfrom.rb -f from file...
 #
 # where from is a regular expression for the From: header field value.
 #
 require optparse
 
 pat = nil
 optparse = OptionParser.new do |opts|
   opts.banner = 'usage: mailfrom.rb [-f regexp] file...'
 
   opts.on('-f', '--from REGEXP', 'Specify From: header field filter') do 
 |from|
 pat = Regexp.new(^From:\s*#{from})
   end
 end
 
 begin
   optparse.parse!
 rescue OptionParser::InvalidOption, OptionParser::MissingArgument = e
   puts e
   puts optparse
   exit 1
 end
 in_hdr=false
 date = nil
 pick = nil
 $.each do |line|
   case line
 when /^From /
   in_hdr = true
   date = nil
   pick = nil
 when /^Date: (.*)/
   if in_hdr
 date = $1
 puts date if pick
   end
 when pat
   if in_hdr
 puts date if date
   pick = true
   end
 when /^\s*$/
   in_hdr = false
   end
 end
 
 -- 
 Sterling (Chip) Camden| sterl...@camdensoftware.com | 2048D/3A978E4F
 http://camdensoftware.com | http://chipstips.com| 
 http://chipsquips.com

actually, correct line 13 of the above script to read:

pat = Regexp.new(^From:.*#{from}, Regexp::IGNORECASE)

That way you don't need the whole From: value, just a piece of it, and
you don't have to worry about uppercase.

-- 
Sterling (Chip) Camden| sterl...@camdensoftware.com | 2048D/3A978E4F
http://camdensoftware.com | http://chipstips.com| http://chipsquips.com


pgpOodSR3jpKq.pgp
Description: PGP signature


Re: what hours correspondent is most active in?

2010-08-09 Thread Omen Wild
On 10-Aug-10 01:15, Chip Camden wrote:
 Is there any plugin or script which is able to collect time stamps of
 all emails from some specific email address and to draw a statistical
 chart answering to question: what hours correspondent is most active in?

I went for the simple shell only command:
egrep -h ^Delivery-date:  ~/Maildir/inbox/cur/* | cut -d: -f2 | cut -d  
-f6| sort | uniq -c | sort -n -k2

Delivery-date may be Exim4 specific, adjust to suite your MTA.  Should
work for both Maildir and mbox by adjusting which file(s) the egrep
runs against.  It doesn't actually graph, but it shows the number of
emails delivered by hour (00 - 23).

-- 
Blessed is the man who is too busy to worry in
the daytime and too sleepy to worry at night.


signature.asc
Description: Digital signature


Re: what hours correspondent is most active in?

2010-08-09 Thread Monte Stevens
On Tue, Aug 10, 2010 at 12:48:16AM +0300, Dennis Yurichev wrote:
 
 Is there any plugin or script which is able to collect time stamps of
 all emails from some specific email address and to draw a statistical
 chart answering to question: what hours correspondent is most active in?

The following will give you a text file that contains the date header
for each message from cor in the current folder, one date per line.

T ~f c...@respond.ent
;| grep '^Date: '  file.txt

That's based on my mappings which are:
T = tag-pattern
; = tag-prefix
| = pipe-message

I'm using maildir, but I assume it will work with any format.

-- 
Monte