Commit 0af343a7 authored by Nicolas Delaby's avatar Nicolas Delaby

2008-07-17 nicolas

Get Forwarded data from attachments if required

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@22520 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent c9f253c5
...@@ -83,6 +83,7 @@ if subject is not None and \':\' in subject:\n ...@@ -83,6 +83,7 @@ if subject is not None and \':\' in subject:\n
if subject.startswith(mark+\':\'):\n if subject.startswith(mark+\':\'):\n
forwarded_mail = True\n forwarded_mail = True\n
break\n break\n
\n
if forwarded_mail is True:\n if forwarded_mail is True:\n
# find original recipient\n # find original recipient\n
source = context.getSource()\n source = context.getSource()\n
...@@ -95,14 +96,22 @@ if forwarded_mail is True:\n ...@@ -95,14 +96,22 @@ if forwarded_mail is True:\n
from_header_length = len(from_header)\n from_header_length = len(from_header)\n
Base_getEntityListFromFromHeader = context.Base_getEntityListFromFromHeader\n Base_getEntityListFromFromHeader = context.Base_getEntityListFromFromHeader\n
line = \'\'\n line = \'\'\n
entity_list = []\n
for line in body.split(\'\\n\'):\n for line in body.split(\'\\n\'):\n
if line.startswith(from_header):\n if line.startswith(from_header):\n
break\n break\n
if line:\n if line:\n
from_text = line[from_header_length:]\n from_text = line[from_header_length:]\n
entity_list = Base_getEntityListFromFromHeader(from_text)\n entity_list.extend(Base_getEntityListFromFromHeader(from_text))\n
if entity_list:\n if not entity_list:\n
context.setSource(entity_list[0].getRelativeUrl())\n #Get data from attachments\n
for attachment in context.getAttachmentInformationList():\n
if \'From\' in attachment:\n
entity_list.extend(Base_getEntityListFromFromHeader(attachment[\'From\']))\n
break\n
if entity_list:\n
source = entity_list[0].getRelativeUrl()\n
context.setSource(source)\n
</string> </value> </string> </value>
</item> </item>
<item> <item>
...@@ -169,8 +178,9 @@ if forwarded_mail is True:\n ...@@ -169,8 +178,9 @@ if forwarded_mail is True:\n
<string>from_header_length</string> <string>from_header_length</string>
<string>Base_getEntityListFromFromHeader</string> <string>Base_getEntityListFromFromHeader</string>
<string>line</string> <string>line</string>
<string>from_text</string>
<string>entity_list</string> <string>entity_list</string>
<string>from_text</string>
<string>attachment</string>
</tuple> </tuple>
</value> </value>
</item> </item>
......
2008-07-17 nicolas
Get Forwarded data from attachments if required
2008-07-17 nicolas 2008-07-17 nicolas
Quote url_string parameter Quote url_string parameter
......
288 292
\ No newline at end of file \ No newline at end of file
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment