Discussion:
[Erp5-dev] EmailDocument more generic filename extensions recognition
Łukasz Nowak
2008-09-24 09:28:09 UTC
Permalink
Hello,

File name attachments in emails might be in double quotes ("), single
quotes (') or without quotes.

I do not know standard, but eg. Evolution is using no quotes, and it is
not possible to extract those file names.

Patch for regular expressions, which is recognising more file names
quoting attached.

Regards,
Luke

PS. Where it shall be tested? I figured it out analysing
TestIngestion.test_11_EmailIngestion, but I think it is too high level
to prove that change.
--
?ukasz Nowak R&D Ventis http://www.ventis.com.pl/
tel: +48 32 768 16 85 fax: +48 32 392 10 61
``Use the Source, Luke...'' I am only craftsman.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: ERP5-Document-EmailDocument.py-no-and-single-quotes-filename-in-attachement.patch
Type: text/x-patch
Size: 398 bytes
Desc: not available
URL: <http://mail.tiolive.com/pipermail/erp5-dev/attachments/20080924/c84712a8/attachment.bin>
Łukasz Nowak
2008-09-25 08:45:28 UTC
Permalink
Hello,
Post by Łukasz Nowak
Hello,
File name attachments in emails might be in double quotes ("), single
quotes (') or without quotes.
I do not know standard, but eg. Evolution is using no quotes, and it is
not possible to extract those file names.
Patch for regular expressions, which is recognising more file names
quoting attached.
Regards,
Luke
PS. Where it shall be tested? I figured it out analysing
TestIngestion.test_11_EmailIngestion, but I think it is too high level
to prove that change.
And that is where I propose those tests.

Test documents (targzipeed) and testIngestion patch attached.

Regards,

Luke
--
?ukasz Nowak R&D Ventis http://www.ventis.com.pl/
tel: +48 32 768 16 85 fax: +48 32 392 10 61
``Use the Source, Luke...'' I am only craftsman.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: email_from_quotes.tar.gz
Type: application/x-compressed-tar
Size: 12043 bytes
Desc: not available
URL: <http://mail.tiolive.com/pipermail/erp5-dev/attachments/20080925/a5f1e59c/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: testIngestion.py-single-and-no-quotes-test.patch
Type: text/x-patch
Size: 4498 bytes
Desc: not available
URL: <http://mail.tiolive.com/pipermail/erp5-dev/attachments/20080925/a5f1e59c/attachment-0001.bin>
Loading...