mailcvt 0.2.9 → 0.2.10

Sign up to get free protection for your applications and to get access to all the features.
data/bin/runmailcvt CHANGED
@@ -27,8 +27,9 @@ dailydir=$(cd $2 && pwd)/$(date +"%Y%m%d")
27
27
 
28
28
  echo "[$(now)] runmailcvt started."
29
29
  wdir=$(pwd)
30
- isize=$(du -h $maildir)
31
- echo "[$(now)] working dir = $wdir, input = $isize, output = $dailydir"
30
+ isize=$(du -h $maildir | sed "s/\t.*$//g")
31
+ icount=$(find $maildir -type f -print | wc -l)
32
+ echo "[$(now)] working dir = $wdir, input = $maildir($isize, $icount), output = $dailydir"
32
33
 
33
34
  if [ ! -d $dailydir ]; then
34
35
  echo "[$(now)] create daily output directory $dailydir"
@@ -42,8 +43,8 @@ fi
42
43
 
43
44
  copyonly1 $maildir
44
45
  grepexp="^Date: |^Message-ID: |^Subject: |^From: |^To: |^Cc: |^Content-Disposition: attachment;"
45
- echo "[$(now)] find $maildir | xargs grep -i -E -A9 \"$grepexp\" > $grepout"
46
- find $maildir | xargs grep -i -E -A9 "$grepexp" > $grepout
46
+ echo "[$(now)] find $maildir -type f -print0 | xargs -0 grep -i -E -A9 \"$grepexp\" > $grepout"
47
+ find $maildir -type f -print0 | xargs -0 grep -i -E -A9 "$grepexp" > $grepout
47
48
 
48
49
  bindir=$(cd $(dirname $0) && pwd)
49
50
  rubydir=$(cd $(dirname $(dirname $(dirname $bindir))) && pwd)
@@ -58,8 +59,8 @@ mailcvt clean $dailydir $timestamp
58
59
  dtocc="$dailydir/dtocc$timestamp"
59
60
  if [ -d $dtocc ]; then
60
61
  copyonly1 $dtocc
61
- echo "[$(now)] find $dtocc | xargs grep -i -E -A300 \"^To: |^Cc: \" > $grepout.tocc"
62
- find $dtocc | xargs grep -i -E -A300 "^To: |^Cc: " > "$grepout.tocc"
62
+ echo "[$(now)] find $dtocc -type f -print0 | xargs -0 grep -i -E -A300 \"^To: |^Cc: \" > $grepout.tocc"
63
+ find $dtocc -type f -print0 | xargs -0 grep -i -E -A300 "^To: |^Cc: " > "$grepout.tocc"
63
64
 
64
65
  echo "[$(now)] mailcvt parsetocc $dailydir $timestamp"
65
66
  mailcvt parsetocc $dailydir $timestamp
data/lib/base_parser.rb CHANGED
@@ -50,7 +50,12 @@ class BaseParser
50
50
  end
51
51
  lines << line
52
52
  end
53
- convert curfile, lines
53
+ if curfile and lines.length > 0
54
+ convert curfile, lines
55
+ else
56
+ puts "$grep is empty or malformated."
57
+ end
58
+
54
59
  end
55
60
 
56
61
  def convert(curfile, lines)
@@ -1,3 +1,3 @@
1
1
  module Mailcvt
2
- VERSION = '0.2.9'
2
+ VERSION = '0.2.10'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mailcvt
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.9
4
+ version: 0.2.10
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -121,7 +121,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
121
121
  version: '0'
122
122
  segments:
123
123
  - 0
124
- hash: 4318484599299501152
124
+ hash: 2519518715147880699
125
125
  required_rubygems_version: !ruby/object:Gem::Requirement
126
126
  none: false
127
127
  requirements:
@@ -130,7 +130,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
130
130
  version: '0'
131
131
  segments:
132
132
  - 0
133
- hash: 4318484599299501152
133
+ hash: 2519518715147880699
134
134
  requirements: []
135
135
  rubyforge_project:
136
136
  rubygems_version: 1.8.25