Changeset 2096 for trunk/gsdl/perllib/plugins
- Timestamp:
- 2001-03-01T13:44:42+13:00 (23 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/gsdl/perllib/plugins/EMAILPlug.pm
r1895 r2096 32 32 # 33 33 # Email plug reads email files. These are named with a simple 34 # number (i.e. as they appear in m h_mailfolders) or with the35 # extension . email34 # number (i.e. as they appear in maildir folders) or with the 35 # extension .mbx (for mbox mail file format) 36 36 # 37 37 # Document text: … … 74 74 sub get_default_process_exp { 75 75 my $self = shift (@_); 76 77 return q^\d+(\.email)?$^; 76 # mbx/email for mailbox file format, \d+ for maildir (each message is 77 # in a separate file, with a unique number for filename) 78 return q@[\\/]\d+|\.(mbx|email)$@; 78 79 } 79 80 80 81 # This plugin splits the mbox mail files at lines starting with From<sp> 81 82 sub get_default_split_exp { 82 return q^ From .*\n^;83 return q^\nFrom .*\n^; 83 84 } 84 85 … … 91 92 92 93 # Check that we're dealing with a valid mail file 93 return undef unless (($$textref =~ / From:/) || ($$textref =~ /To:/));94 return undef unless (($$textref =~ /^From:/m) || ($$textref =~ /^To:/m)); 94 95 95 96 # slightly more strict validity check, to prevent us from matching 96 97 # .so.x files ... 97 98 return undef unless (($$textref =~ /^From /) || 98 ($$textref =~ /^[-A-Za-z]{2,100}:/ ));99 ($$textref =~ /^[-A-Za-z]{2,100}:/m)); 99 100 100 101 print $outhandle "EMAILPlug: processing $file\n"
Note:
See TracChangeset
for help on using the changeset viewer.