Modify

Opened 15 years ago

Closed 12 years ago

#155 closed enhancement (fixed)

better description for strip_signature

Reported by: tom@… Owned by: bas
Priority: minor Milestone: strip signature/quotes
Component: email2trac Version: 1.0.0
Keywords: strip, signature, strip_signature Cc:

Description

I tryed to get the strip signature working - the description is not that good

you wrote: It scans the message for a line containing the string --. All lines after this line will be skipped.

but mail2trac is searching for a string that looks like this dash dash space line-return

so i think a better description in the documentation would be like this: It scans the message for a line containing the string -- . All lines after this line will be skipped. The exact String is - dash dash space line-return

-- 

kind regards
ToM

Attachments (0)

Change History (9)

comment:1 Changed 15 years ago by bas

  • Status changed from new to assigned

Thanks for reporting. You can also change the documentation. You must fill in a username instead of anonymous

comment:2 Changed 15 years ago by tom@…

Okay Thanks: I will do so - But I wrote myself a batch for this problem now.
It strips not only the -- but also every most regularly used signature.
Maybe you like to embed it in the next release.

Including German greetings
Kind Regards from Vienna
ToM

	def strip_signature(self, text):
		"""
		Strip signature from message, inspired by Mailman software
		"""
		body = []
		for line in text.splitlines():
			linetest = str(line)
			if linetest[0:3] == '-- ':
				break 
			if linetest[0:2] == '--':
				break 
			if linetest[0:2].lower() == 'lg':
				break
			if linetest[0:3].lower() == 'mfg':
				break
			if linetest[0:12].lower() == 'best regards':
				break
			if linetest[0:12].lower() == 'kind regards':
				break
			if linetest[0:8].lower() == 'liebe gr':
				break
			if linetest[0:6].lower() == 'thanks':
				break
			if linetest[0:5].lower() == 'danke':
				break
			if linetest[0:16].lower() == 'mit freundlichen':
				break
			if linetest[0:11].lower() == 'viele liebe':
				break
			if linetest[0:11].lower() == 'alles liebe':
				break
			body.append(line)
		return ('\n'.join(body))

comment:3 Changed 15 years ago by bas

  • Milestone set to strip signature/quotes

Thanks for the patch. I will look into it, maybe add a configuration option instead of hardcoded

comment:4 Changed 15 years ago by bas

  • Status changed from assigned to new

comment:5 Changed 15 years ago by bas

  • Status changed from new to assigned

comment:6 Changed 15 years ago by tom@…

good Idea

or maybe an administration panel plugin

comment:7 Changed 15 years ago by basv@…


On 13 okt 2009, at 10:55, email2trac wrote:


good Idea

or maybe an administration panel plugin

email2trac is not an trac plugin. It is just a standalone script.
Somebody does all email2trac settings in trac.ini, because email2trac
uses the trac-parser. I there is a plugin on trac hacks where you can
edit/change trac.ini via the admin panel

Regards

--
Bas van der Vlies
basv@sara.nl<mailto:basv@sara.nl>


comment:8 Changed 12 years ago by bas

see #296. Implemented via a new option:

  • strip_signature_regex

comment:9 Changed 12 years ago by bas

  • Resolution set to fixed
  • Status changed from assigned to closed

(In [606]) added strip_signature_regex option, closes #296, #155

Add Comment

Modify Ticket

Change Properties
Action
as closed The owner will remain bas.
The resolution will be deleted. Next status will be 'reopened'.
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.