Mercurial > p > roundup > code
comparison roundup/mailgw.py @ 334:256776bfdfc5
fixed [SF#474749] Indentations lost
| author | Richard Jones <richard@users.sourceforge.net> |
|---|---|
| date | Sun, 28 Oct 2001 23:22:28 +0000 |
| parents | d0d6feb17d2f |
| children | 8cd545738d8e |
comparison
equal
deleted
inserted
replaced
| 333:4609a1ea94ff | 334:256776bfdfc5 |
|---|---|
| 70 set() method to add the message to the item's spool; in the second case we | 70 set() method to add the message to the item's spool; in the second case we |
| 71 are calling the create() method to create a new node). If an auditor raises | 71 are calling the create() method to create a new node). If an auditor raises |
| 72 an exception, the original message is bounced back to the sender with the | 72 an exception, the original message is bounced back to the sender with the |
| 73 explanatory message given in the exception. | 73 explanatory message given in the exception. |
| 74 | 74 |
| 75 $Id: mailgw.py,v 1.24 2001-10-23 22:57:52 richard Exp $ | 75 $Id: mailgw.py,v 1.25 2001-10-28 23:22:28 richard Exp $ |
| 76 ''' | 76 ''' |
| 77 | 77 |
| 78 | 78 |
| 79 import string, re, os, mimetools, cStringIO, smtplib, socket, binascii, quopri | 79 import string, re, os, mimetools, cStringIO, smtplib, socket, binascii, quopri |
| 80 import traceback | 80 import traceback |
| 406 ''' The message body is divided into sections by blank lines. | 406 ''' The message body is divided into sections by blank lines. |
| 407 Sections where the second and all subsequent lines begin with a ">" or "|" | 407 Sections where the second and all subsequent lines begin with a ">" or "|" |
| 408 character are considered "quoting sections". The first line of the first | 408 character are considered "quoting sections". The first line of the first |
| 409 non-quoting section becomes the summary of the message. | 409 non-quoting section becomes the summary of the message. |
| 410 ''' | 410 ''' |
| 411 sections = blank_line.split(content) | 411 # strip off leading carriage-returns / newlines |
| 412 i = 0 | |
| 413 for i in range(len(content)): | |
| 414 if content[i] not in '\r\n': | |
| 415 break | |
| 416 if i > 0: | |
| 417 sections = blank_line.split(content[i:]) | |
| 418 else: | |
| 419 sections = blank_line.split(content) | |
| 420 | |
| 412 # extract out the summary from the message | 421 # extract out the summary from the message |
| 413 summary = '' | 422 summary = '' |
| 414 l = [] | 423 l = [] |
| 415 for section in sections: | 424 for section in sections: |
| 416 section = section.strip() | 425 #section = section.strip() |
| 417 if not section: | 426 if not section: |
| 418 continue | 427 continue |
| 419 lines = eol.split(section) | 428 lines = eol.split(section) |
| 420 if lines[0] and lines[0][0] in '>|': | 429 if lines[0] and lines[0][0] in '>|': |
| 421 continue | 430 continue |
| 430 l.append(section) | 439 l.append(section) |
| 431 return summary, '\n\n'.join(l) | 440 return summary, '\n\n'.join(l) |
| 432 | 441 |
| 433 # | 442 # |
| 434 # $Log: not supported by cvs2svn $ | 443 # $Log: not supported by cvs2svn $ |
| 444 # Revision 1.24 2001/10/23 22:57:52 richard | |
| 445 # Fix unread->chatting auto transition, thanks Roch'e | |
| 446 # | |
| 435 # Revision 1.23 2001/10/21 04:00:20 richard | 447 # Revision 1.23 2001/10/21 04:00:20 richard |
| 436 # MailGW now moves 'unread' to 'chatting' on receiving e-mail for an issue. | 448 # MailGW now moves 'unread' to 'chatting' on receiving e-mail for an issue. |
| 437 # | 449 # |
| 438 # Revision 1.22 2001/10/21 03:35:13 richard | 450 # Revision 1.22 2001/10/21 03:35:13 richard |
| 439 # bug #473125: Paragraph in e-mails | 451 # bug #473125: Paragraph in e-mails |
