Index: roundup/mailgw.py =================================================================== --- roundup/mailgw.py (revision 71301) +++ roundup/mailgw.py (working copy) @@ -1525,25 +1525,28 @@ if not section: continue lines = eol.split(section) - if (lines[0] and lines[0][0] in '>|') or (len(lines) > 1 and - lines[1] and lines[1][0] in '>|'): - # see if there's a response somewhere inside this section (ie. - # no blank line between quoted message and response) - for line in lines[1:]: - if line and line[0] not in '>|': - break + quote_1st = lines[0] and lines[0][0] in '>|' + quote_2nd = len(lines) > 1 and lines[1] and lines[1][0] in '>|' + if quote_1st or quote_2nd: + # we keep quoted bits if specified in the config + if keep_citations: + l.append(section) + # nothing else to do + continue else: - # we keep quoted bits if specified in the config - if keep_citations: - l.append(section) - continue - # keep this section - it has reponse stuff in it - lines = lines[lines.index(line):] - section = '\n'.join(lines) - # and while we're at it, use the first non-quoted bit as - # our summary - summary = section + # see if there's a response somewhere inside this section (ie. + # no blank line between quoted message and response) + for line in lines[1:]: + if line and line[0] not in '>|': + break + # keep this section - it has reponse stuff in it + lines = lines[lines.index(line):] + section = '\n'.join(lines) + # and while we're at it, use the first non-quoted bit as + # our summary + summary = section + if not summary: # if we don't have our summary yet use the first line of this # section