email-reply-trimmer-0.1.6/0000755000175200017520000000000013114277423015551 5ustar abhijithabhijithemail-reply-trimmer-0.1.6/test/0000755000175200017520000000000013114277423016530 5ustar abhijithabhijithemail-reply-trimmer-0.1.6/test/elided/0000755000175200017520000000000013114277423017756 5ustar abhijithabhijithemail-reply-trimmer-0.1.6/test/elided/embedded_email_german_2.txt0000644000175200017520000000102013114277423025162 0ustar abhijithabhijithAm 03.02.2016 3:35 nachm. schrieb Max Mustermann : > Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. email-reply-trimmer-0.1.6/test/elided/embedded_email_dutch_1.txt0000644000175200017520000000055213114277423025030 0ustar abhijithabhijith> Op 2 feb. 2015 om 05:28 heeft VannillaSky het volgende geschreven: > > > VannillaSky > February 2 > Solved. Going forward... > > To respond, reply to this email or visit https://meta.discourse.org/t/import-posts-from-facebook-group-into-discourse/6089/33 in your browser. > > To unsubscribe from these emails, visit your user preferences. email-reply-trimmer-0.1.6/test/elided/forwarded_message.txt0000644000175200017520000000025613114277423024203 0ustar abhijithabhijith---------- Forwarded message ---------- From: Some One Date: Thu, Jan 28, 2016 at 4:00 PM Subject: Some subject that spans over 2 lines To: infod@discourse.org email-reply-trimmer-0.1.6/test/elided/embedded_email_quote_text.txt0000644000175200017520000000013113114277423025673 0ustar abhijithabhijithOn Mon, Aug 19, 2013 at 2:36 AM, SomeOne via Discourse Meta < info@discourse.org> wrote: email-reply-trimmer-0.1.6/test/elided/retains_spaces_and_formatting.txt0000644000175200017520000000000013114277423026564 0ustar abhijithabhijithemail-reply-trimmer-0.1.6/test/elided/embedded_email_german_1.txt0000644000175200017520000000144413114277423025173 0ustar abhijithabhijithcodinghorror via Discourse Meta schrieb: >codinghorror posted in 'Visually separate "Like it too" / "Undo like"' >on Discourse Meta: > >--- >So turns out this is sort of a complex change for something so small. >Our code at that location assumes all phrases end in periods. Changing >that conditionally to sometimes an em-dash, sometimes not, is kind of.. >a pain in the butt. > >Will keep an eye on it, but low priority given the work required. > >--- >To respond, reply to this email or visit >http://meta.discourse.org/t/visually-separate-like-it-too-undo-like/8464/3 >in your browser. > >To unsubscribe from these emails, visit your [user >preferences](http://meta.discourse.org/user_preferences). -- Diese Nachricht wurde von meinem Android-Mobiltelefon mit K-9 Mail gesendet. email-reply-trimmer-0.1.6/test/elided/embedded_email_polish.txt0000644000175200017520000000170213114277423024775 0ustar abhijithabhijith-- Łukasz Jan Niemier Dnia 14 lip 2015 o godz. 00:25 Michael Downey napisał(a): > > downey Michael Downey Senior Tester > July 13 > Sounds interesting. What is the license? > > To respond, reply to this email or visit https://meta.discourse.org/t/static-pages-plugin/31027/2 in your browser. > > Previous Replies > > hauleth > July 13 > WIP > > Location: https://github.com/hauleth/low_voltage > > Authors: @hauleth > > Simple plugin to add "static" pages to Discourse instance. For now usage is kind of complicated at it needs to fetch static pages from app/views/pages. Ideas for future implements: > > Create DB model to hold pages > Adding admin page that will allow editing that pages > Custom styles for static pages > Any help appreciated. > > To respond, reply to this email or visit https://meta.discourse.org/t/static-pages-plugin/31027/2 in your browser. > > To unsubscribe from these emails, visit your user preferences. email-reply-trimmer-0.1.6/test/elided/email_headers_2.txt0000644000175200017520000000027613114277423023527 0ustar abhijithabhijith________________________________________ From: Discourse <> (sent from a phone) (Sent from mobile device) 從我的 iPhone 傳送 email-reply-trimmer-0.1.6/test/elided/delimiters.txt0000644000175200017520000000007213114277423022657 0ustar abhijithabhijithᐧ -- *** #### ~~~~~ ====== _______ ++++++++ ------- email-reply-trimmer-0.1.6/test/elided/embedded_email_french_2.txt0000644000175200017520000000047413114277423025172 0ustar abhijithabhijithLe 2016-11-16 02:22, Erlend Sogge Heggen a écrit : > erlend_sh [1] Erlend Sogge Heggen [1] team > November 16 > > Hello French guy, > >> is the back office also available in french like the front end ? > > Oui! > > Sincerely, > > Erlend > > * > > Links: > ------ > [1] https://meta.discourse.org/users/erlend_sh email-reply-trimmer-0.1.6/test/elided/embedded_email_11.txt0000644000175200017520000000005313114277423023716 0ustar abhijithabhijith2016-03-03 17:21 GMT+01:00 Some One After email-reply-trimmer-0.1.6/test/elided/embedded_email_6.txt0000644000175200017520000000012213114277423023637 0ustar abhijithabhijithOn 28 Jan 2016, at 19:04, Some One wrote: > Did you write something interesting? email-reply-trimmer-0.1.6/test/elided/embedded_email_2.txt0000644000175200017520000000056713114277423023650 0ustar abhijithabhijith---- On Tue, 22 Dec 2015 14:17:36 +0530 Sam Saffron<info@discourse.org> wrote ---- sam Sam Saffron co-founder December 22 You are not using the right endpoint, go to user profile / badges, have a look at dev tools to see what it calls There is a discrete endpoint to get all the badges a user has To respond, reply to this email or visit the topic. email-reply-trimmer-0.1.6/test/elided/embedded_email_7.txt0000644000175200017520000000023313114277423023643 0ustar abhijithabhijithOn Tue, 2011-03-01 at 18:02 +0530, Some One wrote: > > This is another part of the embedded email. > > _______________________ And here's my signature. email-reply-trimmer-0.1.6/test/elided/email_headers_3.txt0000644000175200017520000000116013114277423023521 0ustar abhijithabhijithFrom: Some One > Reply-To: "For.bar" > Date: Monday, February 8, 2016 11:44 AM To: Discourse > Subject: VIS Here's an email with some very important stuff. ________________________________ Reply here or hit reply from your inbox to help members by sharing your ideas. Mute this topic to stop getting updates, we'll send you the next one. DO NOT FORWARD THIS EMAIL! email-reply-trimmer-0.1.6/test/elided/embedded_ception.txt0000644000175200017520000000115713114277423023775 0ustar abhijithabhijithOn Mon, Feb 1, 2016 at 6:32 PM, Jeff Atwood wrote: > This is Jeff's reply. > > On Mon, Feb 1, 2016 at 7:50 AM, Some One >> Great! >> >> Many thanks. >> >> ~s >> >> On Mon, Feb 1, 2016 at 5:05 AM Discourse Team wrote: >> >>> WAT? >>> >>> On Wed, Jan 27, 2016 at 10:48 PM, Some One < foo@bar.com> wrote: >>> >>>> Hi Team, >>>> >>>> How is it doing? >>>> >>>> Some One >>>> >>>> On Wed, Jan 27, 2016 at 10:10 AM Discourse Team wrote: >>>> >>>>> Hello :waves_hand: >>>>> >>>> >>> > -- Some One Community Manager foo@bar.com (123) 456-7890 email-reply-trimmer-0.1.6/test/elided/embedded_email_dutch_2.txt0000644000175200017520000000446013114277423025033 0ustar abhijithabhijithOp 16 aug. 2014 05:13 schreef "codinghorror" het volgende geschreven: > codinghorror > August 15 > > Hmm, if that is true we need to fix that somehow. > > To respond, reply to this email or visit > https://meta.discourse.org/t/configuring-google-oauth2-login-for-discourse/15858/38 > in your browser. > ------------------------------ > Previous Replies elberet > August 15 > > Are you using an ad blocker? Adblock Plus, for instance, removes the login > buttons. > bwvanmanen > August 15 > > The 'Sign in with Google' button does appear when I try to log in from > another pc. However the button does not appear on my pc using another > browser. > bwvanmanen > August 15 > > I followed the steps from the opening post, but I don't get a google login > option when users try to log in. There is just the normal user/password, > the word OR, and nothing next to that. Any clues? > > neil > August 1 > > Glad you got it fixed. It's good to have the resolution in this topic too. > I added a link to your topic in the first post. > jgehrcke > July 31 > > Sorry, that was kind of a cross-posting. Indeed, I got that fixed as you > say, as reported here: > jgehrcke said: > > I understand the solution you are proposing. The proper fix, without > customizing the disource.conf in the container, however, would be to inform > the web application about the protocol used via an HTTP header, as you are > also suggesting. The question is: does Discourse respect/support > X-Forwarded-Protocol? Then I can easily configure the nginx reverse proxy > with proxy_set_header X-Forwarded-Protocol $scheme; Edit: I can confirm > that properly setting the X-Forwarded-Proto header in the nginx … > > Thanks and sorry for not reporting back here! > ------------------------------ > > To respond, reply to this email or visit > https://meta.discourse.org/t/configuring-google-oauth2-login-for-discourse/15858/38 > in your browser. > > To unsubscribe from these emails, visit your user preferences > . > email-reply-trimmer-0.1.6/test/elided/embedded_email_1.txt0000644000175200017520000000027713114277423023645 0ustar abhijithabhijithOn Wed, Sep 25, 2013, at 03:57 PM, richard_clark wrote: > This is the embedded email This is after the embedded email and will not show up because 99% of the times this is the signature... email-reply-trimmer-0.1.6/test/elided/quote_and_text.txt0000644000175200017520000000000013114277423023530 0ustar abhijithabhijithemail-reply-trimmer-0.1.6/test/elided/normalize_line_endings.txt0000644000175200017520000000000013114277423025223 0ustar abhijithabhijithemail-reply-trimmer-0.1.6/test/elided/embedded_email_portuguese.txt0000644000175200017520000000065413114277423025706 0ustar abhijithabhijithEm 2 de fevereiro de 2015 10:58, discourse < info@discourse.org> escreveu: > discourse > February 2 > > Bom dia. Obrigado pela atenção > ------------------------------ > > To respond, reply to this email or visit > https://meta.discourse.org/ in your browser. > > To unsubscribe from these emails, visit your user preferences > . > email-reply-trimmer-0.1.6/test/elided/embedded_email_russian.txt0000644000175200017520000000164713114277423025173 0ustar abhijithabhijithпонедельник, 6 октября 2014 г. пользователь lidel написал: > lidel > October 6 > winterbox: > > Do you have any plan to make this plugin? > > discourse-locale-override > is just a hack, and > as @sam pointed out, it only works > if you update your instance via commandline. I created it to speed up my > work on pl_PL translation only. > > I see there is a need for a proper plugin (this and other threads), but > until such plugin appears this is a semi-working workaround. > ------------------------------ > > To respond, reply to this email or visit > https://meta.discourse.org/t/use-custom-translation-file/13786/41 in your > browser. > > To unsubscribe from these emails, visit your user preferences > . > email-reply-trimmer-0.1.6/test/elided/embedded_email_9.txt0000644000175200017520000000005713114277423023651 0ustar abhijithabhijith*-------- Original Message --------* THE END. email-reply-trimmer-0.1.6/test/elided/embedded_email_10.txt0000644000175200017520000000171213114277423023720 0ustar abhijithabhijithSent from Outlook Mobile On Sun, Feb 7, 2016 at 12:12 AM -0800, "Arpit Jalan" > wrote: Hi Some, https://meta.discourse.org is now running on latest Discourse version! Regards, Arpit On Fri, Feb 5, 2016 at 10:43 AM Arpit Jalan > wrote: Okay, sure! Arpit On Fri, 5 Feb 2016 at 10:42, Some One > wrote: Arpit, Yes that sounds good. Sent from Outlook Mobile _____________________________ From: Arpit Jalan > Sent: Thursday, February 4, 2016 10:05 AM Subject: Meta Discourse update To: Some One >, Discourse Team > Hi Some One, Time to update meta to the latest Discourse version! Do you want me to take care of it? Regards, Arpit email-reply-trimmer-0.1.6/test/elided/text_only.txt0000644000175200017520000000000013114277423022532 0ustar abhijithabhijithemail-reply-trimmer-0.1.6/test/elided/strip.txt0000644000175200017520000000000013114277423021646 0ustar abhijithabhijithemail-reply-trimmer-0.1.6/test/elided/email_headers_1.txt0000644000175200017520000000032213114277423023516 0ustar abhijithabhijith ------------------------------ *From:* Outlook user *Sent:* 2016-01-27 *To:* info@discourse.org *Subject:* Are you using Outlook? Just some random text wich is part of the embedded email... Outlook user email-reply-trimmer-0.1.6/test/elided/embedded_email_italian.txt0000644000175200017520000000122013114277423025113 0ustar abhijithabhijith> Il 26 marzo 2016 alle 13.16 Sam Saffron ha scritto: > > > > > > We need specific examples of failures, PM full source of emails to > @zogstrip > > Posted by sam on 03/26/2016 > > > > > > > --- > [Visit Topic](https://meta.discourse.org/t/email-reply-parsing/41597/2) > or reply to this email to respond > > To stop receiving notifications for this particular topic, [click > here](https://meta.discourse.org/t/email-reply-parsing/41597/unsubscribe). > To unsubscribe from these emails, change your [user > preferences](https://meta.discourse.org/my/preferences) -- Stefano Costa @stekosteko Editor, Journal of Open Archaeology Data email-reply-trimmer-0.1.6/test/elided/usenet.txt0000644000175200017520000000015113114277423022017 0ustar abhijithabhijith-- Mit lieben Grüßen John Doe http://blog.john.doe www.facebook.com/johndoe Mobil: +12 345 6789 012 email-reply-trimmer-0.1.6/test/elided/quote_only.txt0000644000175200017520000000000013114277423022703 0ustar abhijithabhijithemail-reply-trimmer-0.1.6/test/elided/embedded_email_spanish_1.txt0000644000175200017520000000237413114277423025372 0ustar abhijithabhijithEl jueves, 21 de noviembre de 2013, codinghorror escribió: > codinghorror > November 21 > > How are you creating this user? Describe it step by step. > > To respond, reply to this email or visit > http://meta.discourse.org/t/error-creating-new-users-pg-numericvalueoutofrange/11046/2in your browser. > ------------------------------ > Previous Replies PabloC > November 21 > > Hi guys, > > While I create a new user, I'm finding this error in the logs : > > Processing by UsersController#create as */* > Parameters: {"name"=>"Ps4 Support Forum", "email"=>"pablocorral+ps4@gmail.com ", "username"=>"PS4SupportForum", "password_confirmation"=>"[FILTERED]", "challenge"=>"11a4ebe83d9b2a9e0d45bc50b457ee17"} > PG::NumericValueOutOfRange: ERROR: value "2201945804" is out of range for type integer > > Any idea? > > Tks! > ------------------------------ > > To respond, reply to this email or visit > http://meta.discourse.org/t/error-creating-new-users-pg-numericvalueoutofrange/11046/2in your browser. > > To unsubscribe from these emails, visit your user preferences > . > email-reply-trimmer-0.1.6/test/elided/embedded_email_8.txt0000644000175200017520000000005513114277423023646 0ustar abhijithabhijith-------- Original Message -------- THE END. email-reply-trimmer-0.1.6/test/elided/embedded_email_4.txt0000644000175200017520000000104513114277423023642 0ustar abhijithabhijith2013/7/20 sam via Discourse Meta > sam replied to your post in 'Unable to create group' on Discourse Meta: > ------------------------------ > > Is this an error handling thing, if you name the group "test" and only > place yourself in it, does it persist? > ------------------------------ > > To respond, reply to this email or visit > http://meta.discourse.org/t/unable-to-create-group/8198/6 in your browser. > > To unsubscribe from these emails, visit your user preferences > . > email-reply-trimmer-0.1.6/test/elided/email_headers_4.txt0000644000175200017520000000201013114277423023515 0ustar abhijithabhijithDa: Sally54721 Risposta: Testy McTesterson / Test Data: giovedì 8 ottobre 2015 15:26 A: Testy McTesterson Oggetto: Test | Issue (#3) [@example](http://example.com/u/example) — Reply to this email directly or [view it on GitLab](http://git.example.com/example/Test/issues/3). {"@context":"[http://schema.org","@type":"EmailMessage","action":{"@type":"ViewAction","name":"View](http://schema.org%22,%22@type%22:%22EmailMessage%22,%22action%22:%7B%22@type%22:%22ViewAction%22,%22name%22:%22View) Issue","url":"[http://git.example.com/example/Test/issues/3"}](http://git.example.com/example/Test/issues/3%22%7D)} You're receiving this notification because you are a member of the Testy McTesterson / Test project team. -- Questo messaggio e' stato analizzato con Libra ESVA ed e' risultato non infetto. [Clicca qui per segnalarlo come spam.](http://esva.example.com/cgi-bin/learn-msg.cgi?id=1234567890.ABCDEF) [Clicca qui per metterlo in blacklist](http://esva.example.com/cgi-bin/learn-msg.cgi?blacklist=1&id=1234567890.ABCDEF) email-reply-trimmer-0.1.6/test/elided/embedded_email_12.txt0000644000175200017520000000027613114277423023726 0ustar abhijithabhijithOn Thu, 31 Mar 2016 at 11:16 Some One < mailto:Some One wrote: Two 2 On Thu, 31 Mar 2016 at 10:05 Jeff Atwood < mailto:Jeff Atwood wrote: Three 3 email-reply-trimmer-0.1.6/test/elided/embedded_email_5.txt0000644000175200017520000000013713114277423023644 0ustar abhijithabhijithSome One wrote: Something that will be considered as the embedded email. email-reply-trimmer-0.1.6/test/elided/embedded_email_3.txt0000644000175200017520000000101213114277423023633 0ustar abhijithabhijithOn Thu, Jun 20, 2013 at 4:18 PM, matt2 via Discourse Meta < info@discourse.org> wrote: > matt2 posted in 'Discourse on Ubuntu: Video Walkthrough' on Discourse Meta: > ------------------------------ > > Has anyone tried on AWS? a public AMI would be awesome. > ------------------------------ > > Please visit this link to respond: > http://meta.discourse.org/t/discourse-on-ubuntu-video-walkthrough/7478/4 > > To unsubscribe from these emails, visit your user preferences > . > email-reply-trimmer-0.1.6/test/elided/embedded_email_french_1.txt0000644000175200017520000000024713114277423025167 0ustar abhijithabhijithLe 4 janv. 2016 19:03, "Neil Lalonde" a écrit : > team > January 4 > > Discourse c'est top ! > > Neil > email-reply-trimmer-0.1.6/test/elided/embedded_email_spanish_2.txt0000644000175200017520000000060213114277423025363 0ustar abhijithabhijith-----Mensaje original----- De: "Miguel" Enviado: =E2=80=8E16/=E2=80=8E02/=E2=80=8E2016 14:53 Para: "discourse" Asunto: [MP]Parser del email Visita el tema o responde a este email para publicar. Para no recibir m=C3=A1s notificaciones de este tema en particular, haz cli= c aqu=C3=AD. Para darte de baja de estos emails, cambia tus preferencias = email-reply-trimmer-0.1.6/test/elided/dual_embedded.txt0000644000175200017520000000031313114277423023252 0ustar abhijithabhijithOn Mon, Feb 1, 2016 at 4:58 AM -0800, "Some One" wrote: This is the 2nd email. On Sun, Jan 31, 2016 at 9:58 PM -0800, "Another One" wrote: This is the 1st email. email-reply-trimmer-0.1.6/test/elided/embedded_email_german_3.txt0000644000175200017520000000030213114277423025165 0ustar abhijithabhijith-----Ursprüngliche Nachricht----- Von: Discourse Team Gesendet: Don 11 Februar 2016 11:23 An: Some One Betreff: Some Subject Hallo! Wie geht es Ihnen heute? email-reply-trimmer-0.1.6/test/before/0000755000175200017520000000000013114277423017772 5ustar abhijithabhijithemail-reply-trimmer-0.1.6/test/before/forwarded_message.txt0000644000175200017520000000000013114277423024202 0ustar abhijithabhijithemail-reply-trimmer-0.1.6/test/before/email_headers_2.txt0000644000175200017520000000003613114277423023535 0ustar abhijithabhijithThis is a reply from Outlook! email-reply-trimmer-0.1.6/test/before/email_headers_3.txt0000644000175200017520000000003213114277423023532 0ustar abhijithabhijithThis is the actual reply. email-reply-trimmer-0.1.6/test/before/embedded_email_10.txt0000644000175200017520000000106513114277423023735 0ustar abhijithabhijithThank you. Sent from Outlook Mobile On Sun, Feb 7, 2016 at 12:12 AM -0800, "Arpit Jalan" > wrote: Hi Some, https://meta.discourse.org is now running on latest Discourse version! Regards, Arpit On Fri, Feb 5, 2016 at 10:43 AM Arpit Jalan > wrote: Okay, sure! Arpit On Fri, 5 Feb 2016 at 10:42, Some One > wrote: Arpit, Yes that sounds good. Sent from Outlook Mobile email-reply-trimmer-0.1.6/test/before/email_headers_1.txt0000644000175200017520000000003613114277423023534 0ustar abhijithabhijithThis is a reply from Outlook! email-reply-trimmer-0.1.6/test/before/email_headers_4.txt0000644000175200017520000000000513114277423023533 0ustar abhijithabhijithtest email-reply-trimmer-0.1.6/test/before/embedded_email_spanish_2.txt0000644000175200017520000000006613114277423025403 0ustar abhijithabhijithIgual que siempre (inclusive ahora), sin nada raro :/ email-reply-trimmer-0.1.6/test/before/embedded_email_german_3.txt0000644000175200017520000000002013114277423025176 0ustar abhijithabhijithGruß Discourse email-reply-trimmer-0.1.6/test/test_email_reply_trimmer.rb0000644000175200017520000000427413114277423024164 0ustar abhijithabhijithrequire "minitest/autorun" require "email_reply_trimmer" class TestEmailReplyTrimmer < Minitest::Test EMAILS = Dir["test/emails/*.txt"].map { |path| File.basename(path) } TRIMMED = Dir["test/trimmed/*.txt"].map { |path| File.basename(path) } ELIDED = Dir["test/elided/*.txt"].map { |path| File.basename(path) } def test_all_emails_have_a_matching_reply assert_equal(EMAILS, TRIMMED, "Files in /emails and /trimmed folders should match 1-to-1.") end def test_all_emails_have_a_matching_elided assert_equal(EMAILS, ELIDED, "Files in /emails and /elided folders should match 1-to-1.") end def test_normalize_line_endings_email_has_windows_line_endings assert_match(/\r\n/, File.read("test/emails/normalize_line_endings.txt")) end EMAILS.each do |filename| name = File.basename(filename, ".txt") define_method("test_#{name}") do assert_equal(trim(filename), trimmed(filename), "[TRIMMED] EMAIL: #{filename}") assert_equal(elide(filename), elided(filename), "[ELIDED] EMAIL: #{filename}") end end EMBEDDED_EMAILS = %w{ email_headers_1 email_headers_2 email_headers_3 email_headers_4 embedded_email_10 embedded_email_german_3 embedded_email_spanish_2 forwarded_message } EMBEDDED_EMAILS.each do |name| filename = "#{name}.txt" define_method("test_embedded_extraction_for_#{name}") do e, b = extract_embedded_email(filename) assert_equal(e, embedded(filename), "[EMBEDDED] EMAIL: #{filename}") assert_equal(b, before(filename), "[BEFORE] EMAIL: #{filename}") end end def trim(filename) EmailReplyTrimmer.trim(email(filename)) end def elide(filename) EmailReplyTrimmer.trim(email(filename), true)[1] end def extract_embedded_email(filename) EmailReplyTrimmer.extract_embedded_email(email(filename)) end def email(filename) File.read("test/emails/#{filename}").strip end def trimmed(filename) File.read("test/trimmed/#{filename}").strip end def elided(filename) File.read("test/elided/#{filename}").strip end def embedded(filename) File.read("test/embedded/#{filename}").strip end def before(filename) File.read("test/before/#{filename}").strip end end email-reply-trimmer-0.1.6/test/embedded/0000755000175200017520000000000013114277423020261 5ustar abhijithabhijithemail-reply-trimmer-0.1.6/test/embedded/forwarded_message.txt0000644000175200017520000000026213114277423024503 0ustar abhijithabhijithFrom: Some One Date: Thu, Jan 28, 2016 at 4:00 PM Subject: Some subject that spans over 2 lines To: infod@discourse.org This is a forwarded email. And just that. email-reply-trimmer-0.1.6/test/embedded/email_headers_2.txt0000644000175200017520000000022513114277423024024 0ustar abhijithabhijithFrom: Discourse > Reply-To: "For.bar" > Date: Monday, February 8, 2016 11:44 AM To: Discourse > Subject: VIS Here's an email with some very important stuff. ________________________________ Reply here or hit reply from your inbox to help members by sharing your ideas. Mute this topic to stop getting updates, we'll send you the next one. DO NOT FORWARD THIS EMAIL! email-reply-trimmer-0.1.6/test/embedded/embedded_email_10.txt0000644000175200017520000000060213114277423024220 0ustar abhijithabhijithFrom: Arpit Jalan > Sent: Thursday, February 4, 2016 10:05 AM Subject: Meta Discourse update To: Some One >, Discourse Team > Hi Some One, Time to update meta to the latest Discourse version! Do you want me to take care of it? Regards, Arpit email-reply-trimmer-0.1.6/test/embedded/email_headers_1.txt0000644000175200017520000000026113114277423024023 0ustar abhijithabhijith*From:* Outlook user *Sent:* 2016-01-27 *To:* info@discourse.org *Subject:* Are you using Outlook? Just some random text wich is part of the embedded email... Outlook user email-reply-trimmer-0.1.6/test/embedded/email_headers_4.txt0000644000175200017520000000201013114277423024020 0ustar abhijithabhijithDa: Sally54721 Risposta: Testy McTesterson / Test Data: giovedì 8 ottobre 2015 15:26 A: Testy McTesterson Oggetto: Test | Issue (#3) [@example](http://example.com/u/example) — Reply to this email directly or [view it on GitLab](http://git.example.com/example/Test/issues/3). {"@context":"[http://schema.org","@type":"EmailMessage","action":{"@type":"ViewAction","name":"View](http://schema.org%22,%22@type%22:%22EmailMessage%22,%22action%22:%7B%22@type%22:%22ViewAction%22,%22name%22:%22View) Issue","url":"[http://git.example.com/example/Test/issues/3"}](http://git.example.com/example/Test/issues/3%22%7D)} You're receiving this notification because you are a member of the Testy McTesterson / Test project team. -- Questo messaggio e' stato analizzato con Libra ESVA ed e' risultato non infetto. [Clicca qui per segnalarlo come spam.](http://esva.example.com/cgi-bin/learn-msg.cgi?id=1234567890.ABCDEF) [Clicca qui per metterlo in blacklist](http://esva.example.com/cgi-bin/learn-msg.cgi?blacklist=1&id=1234567890.ABCDEF) email-reply-trimmer-0.1.6/test/embedded/embedded_email_spanish_2.txt0000644000175200017520000000054713114277423025676 0ustar abhijithabhijithDe: "Miguel" Enviado: =E2=80=8E16/=E2=80=8E02/=E2=80=8E2016 14:53 Para: "discourse" Asunto: [MP]Parser del email Visita el tema o responde a este email para publicar. Para no recibir m=C3=A1s notificaciones de este tema en particular, haz cli= c aqu=C3=AD. Para darte de baja de estos emails, cambia tus preferencias = email-reply-trimmer-0.1.6/test/embedded/embedded_email_german_3.txt0000644000175200017520000000023713114277423025477 0ustar abhijithabhijithVon: Discourse Team Gesendet: Don 11 Februar 2016 11:23 An: Some One Betreff: Some Subject Hallo! Wie geht es Ihnen heute? email-reply-trimmer-0.1.6/test/trimmed/0000755000175200017520000000000013114277423020171 5ustar abhijithabhijithemail-reply-trimmer-0.1.6/test/trimmed/embedded_email_german_2.txt0000644000175200017520000000000513114277423025377 0ustar abhijithabhijithHey:)email-reply-trimmer-0.1.6/test/trimmed/embedded_email_dutch_1.txt0000644000175200017520000000014213114277423025236 0ustar abhijithabhijithNice of you to pick it up! Could you make a PR? Then other people can use it too. Would be great. email-reply-trimmer-0.1.6/test/trimmed/forwarded_message.txt0000644000175200017520000000005213114277423024410 0ustar abhijithabhijithThis is a forwarded email. And just that. email-reply-trimmer-0.1.6/test/trimmed/embedded_email_quote_text.txt0000644000175200017520000000047713114277423026123 0ustar abhijithabhijith> This seems like a problem that would be better solved at the web server > level, rather than by the application. If nothing else, adding an instance > of Nginx as an SSL/TLS reverse-proxy would very quickly take care of this. > when I said looks possible, I pointed to rack because that's still the web server level email-reply-trimmer-0.1.6/test/trimmed/retains_spaces_and_formatting.txt0000644000175200017520000000012713114277423027011 0ustar abhijithabhijithFormatting and spaces - A - B - C should be retained - Item #1 - Item #2 email-reply-trimmer-0.1.6/test/trimmed/embedded_email_german_1.txt0000644000175200017520000000015413114277423025403 0ustar abhijithabhijithalright, no big deal - I assume in this case the code needs some refactoring to better support I18N anyway. email-reply-trimmer-0.1.6/test/trimmed/embedded_email_polish.txt0000644000175200017520000000003413114277423025205 0ustar abhijithabhijithOh, I've forgot to add. MIT email-reply-trimmer-0.1.6/test/trimmed/email_headers_2.txt0000644000175200017520000000003613114277423023734 0ustar abhijithabhijithThis is a reply from Outlook! email-reply-trimmer-0.1.6/test/trimmed/signatures.txt0000644000175200017520000000007313114277423023116 0ustar abhijithabhijithThis email was sent from way too much different devices ;) email-reply-trimmer-0.1.6/test/trimmed/delimiters.txt0000644000175200017520000000012613114277423023072 0ustar abhijithabhijithThis is not a ---------- delimiter. But there should be no delimiter after this line email-reply-trimmer-0.1.6/test/trimmed/embedded_email_french_2.txt0000644000175200017520000000003013114277423025371 0ustar abhijithabhijithThanks for your answer. email-reply-trimmer-0.1.6/test/trimmed/embedded_email_11.txt0000644000175200017520000000000713114277423024130 0ustar abhijithabhijithBefore email-reply-trimmer-0.1.6/test/trimmed/embedded_email_6.txt0000644000175200017520000000017013114277423024055 0ustar abhijithabhijithEnsuring that ON_DATE_SOMEONE_WROTE_REGEXES is not greedy. On this day I wrote something which was very interesting. email-reply-trimmer-0.1.6/test/trimmed/embedded_email_2.txt0000644000175200017520000000024013114277423024047 0ustar abhijithabhijithI have checked the available documentation/links to find out the end points. If there are some other endpoints, can you please tell the endpoints Best Regards email-reply-trimmer-0.1.6/test/trimmed/embedded_email_7.txt0000644000175200017520000000020113114277423024051 0ustar abhijithabhijithThis is a line before the embedded email. > Hello > > This is the embedded email. This is some text after the embedded email. email-reply-trimmer-0.1.6/test/trimmed/email_headers_3.txt0000644000175200017520000000003213114277423023731 0ustar abhijithabhijithThis is the actual reply. email-reply-trimmer-0.1.6/test/trimmed/embedded_ception.txt0000644000175200017520000000004513114277423024203 0ustar abhijithabhijithThis is the reply. Thanks, Some One email-reply-trimmer-0.1.6/test/trimmed/embedded_email_dutch_2.txt0000644000175200017520000000020013114277423025232 0ustar abhijithabhijithThe adblocker idea from @elberet might be it. Regretfully I only have time to test this in 2 weeks. I will let you know then... email-reply-trimmer-0.1.6/test/trimmed/embedded_email_1.txt0000644000175200017520000000004313114277423024047 0ustar abhijithabhijithThis is before the embedded email. email-reply-trimmer-0.1.6/test/trimmed/quote_and_text.txt0000644000175200017520000000005313114277423023753 0ustar abhijithabhijith> This is a quote. And this is some text. email-reply-trimmer-0.1.6/test/trimmed/normalize_line_endings.txt0000644000175200017520000000004013114277423025442 0ustar abhijithabhijithEmail with windows line endings email-reply-trimmer-0.1.6/test/trimmed/embedded_email_portuguese.txt0000644000175200017520000000004313114277423026111 0ustar abhijithabhijithOlá, Qualquer dúvida estamos ai. email-reply-trimmer-0.1.6/test/trimmed/embedded_email_russian.txt0000644000175200017520000000006313114277423025375 0ustar abhijithabhijithWhy don't you override particular strings with JS? email-reply-trimmer-0.1.6/test/trimmed/embedded_email_9.txt0000644000175200017520000000000413114277423024054 0ustar abhijithabhijithBar email-reply-trimmer-0.1.6/test/trimmed/embedded_email_10.txt0000644000175200017520000000001313114277423024124 0ustar abhijithabhijithThank you. email-reply-trimmer-0.1.6/test/trimmed/text_only.txt0000644000175200017520000000002613114277423022755 0ustar abhijithabhijithEmail with only text. email-reply-trimmer-0.1.6/test/trimmed/strip.txt0000644000175200017520000000005013114277423022066 0ustar abhijithabhijithStrip leading and trailing empty lines. email-reply-trimmer-0.1.6/test/trimmed/email_headers_1.txt0000644000175200017520000000003613114277423023733 0ustar abhijithabhijithThis is a reply from Outlook! email-reply-trimmer-0.1.6/test/trimmed/embedded_email_italian.txt0000644000175200017520000000007713114277423025337 0ustar abhijithabhijithOk, will do. As a test, this is a reply from a webmail client. email-reply-trimmer-0.1.6/test/trimmed/usenet.txt0000644000175200017520000000005613114277423022236 0ustar abhijithabhijithMal sehen was hier mit der Signatur passiert! email-reply-trimmer-0.1.6/test/trimmed/quote_only.txt0000644000175200017520000000003113114277423023122 0ustar abhijithabhijith> Email with only quote. email-reply-trimmer-0.1.6/test/trimmed/embedded_email_spanish_1.txt0000644000175200017520000000045713114277423025605 0ustar abhijithabhijithI've configured Twitter Authentication, so this error happends on the application, after twitter posts to my discourse install via the callback. In the front error I can get a correct message saying "Something waa wrong, check you usename and password" and in the backend I see that error in the logs. email-reply-trimmer-0.1.6/test/trimmed/embedded_email_8.txt0000644000175200017520000000000413114277423024053 0ustar abhijithabhijithFoo email-reply-trimmer-0.1.6/test/trimmed/embedded_email_4.txt0000644000175200017520000000012613114277423024054 0ustar abhijithabhijithIf I do exactly that, then the test group won't be saved after a refresh of the page. email-reply-trimmer-0.1.6/test/trimmed/email_headers_4.txt0000644000175200017520000000000513114277423023732 0ustar abhijithabhijithtest email-reply-trimmer-0.1.6/test/trimmed/embedded_email_12.txt0000644000175200017520000000000613114277423024130 0ustar abhijithabhijithOne 1 email-reply-trimmer-0.1.6/test/trimmed/embedded_email_5.txt0000644000175200017520000000007713114277423024062 0ustar abhijithabhijithI am testing the SOMEONE_EMAIL_WROTE_REGEX regular expression. email-reply-trimmer-0.1.6/test/trimmed/embedded_email_3.txt0000644000175200017520000000045613114277423024061 0ustar abhijithabhijithSure, [Bitnami](http://bitnami.com/stack/discourse) supports EC2 and there are several topics here about it. Our [official install guide]( https://github.com/discourse/discourse/blob/master/docs/INSTALL-ubuntu.md) also works great on an Amazon EC2 provisioned virtual machine with very little change. email-reply-trimmer-0.1.6/test/trimmed/embedded_email_french_1.txt0000644000175200017520000000001613114277423025374 0ustar abhijithabhijithC'est super ! email-reply-trimmer-0.1.6/test/trimmed/embedded_email_spanish_2.txt0000644000175200017520000000006613114277423025602 0ustar abhijithabhijithIgual que siempre (inclusive ahora), sin nada raro :/ email-reply-trimmer-0.1.6/test/trimmed/dual_embedded.txt0000644000175200017520000000002713114277423023467 0ustar abhijithabhijithThis is the 3rd email. email-reply-trimmer-0.1.6/test/trimmed/embedded_email_german_3.txt0000644000175200017520000000002013114277423025375 0ustar abhijithabhijithGruß Discourse email-reply-trimmer-0.1.6/test/emails/0000755000175200017520000000000013114277423020002 5ustar abhijithabhijithemail-reply-trimmer-0.1.6/test/emails/embedded_email_german_2.txt0000644000175200017520000000102713114277423025215 0ustar abhijithabhijithHey:) Am 03.02.2016 3:35 nachm. schrieb Max Mustermann : > Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.email-reply-trimmer-0.1.6/test/emails/embedded_email_dutch_1.txt0000644000175200017520000000071613114277423025056 0ustar abhijithabhijithNice of you to pick it up! Could you make a PR? Then other people can use it too. Would be great. > Op 2 feb. 2015 om 05:28 heeft VannillaSky het volgende geschreven: > > > VannillaSky > February 2 > Solved. Going forward... > > To respond, reply to this email or visit https://meta.discourse.org/t/import-posts-from-facebook-group-into-discourse/6089/33 in your browser. > > To unsubscribe from these emails, visit your user preferences. email-reply-trimmer-0.1.6/test/emails/forwarded_message.txt0000644000175200017520000000033213114277423024222 0ustar abhijithabhijith---------- Forwarded message ---------- From: Some One Date: Thu, Jan 28, 2016 at 4:00 PM Subject: Some subject that spans over 2 lines To: infod@discourse.org This is a forwarded email. And just that. email-reply-trimmer-0.1.6/test/emails/embedded_email_quote_text.txt0000644000175200017520000000063113114277423025724 0ustar abhijithabhijithOn Mon, Aug 19, 2013 at 2:36 AM, SomeOne via Discourse Meta < info@discourse.org> wrote: > This seems like a problem that would be better solved at the web server > level, rather than by the application. If nothing else, adding an instance > of Nginx as an SSL/TLS reverse-proxy would very quickly take care of this. > when I said looks possible, I pointed to rack because that's still the web server level email-reply-trimmer-0.1.6/test/emails/retains_spaces_and_formatting.txt0000644000175200017520000000012713114277423026622 0ustar abhijithabhijithFormatting and spaces - A - B - C should be retained - Item #1 - Item #2 email-reply-trimmer-0.1.6/test/emails/embedded_email_german_1.txt0000644000175200017520000000162313114277423025216 0ustar abhijithabhijithalright, no big deal - I assume in this case the code needs some refactoring to better support I18N anyway. codinghorror via Discourse Meta schrieb: >codinghorror posted in 'Visually separate "Like it too" / "Undo like"' >on Discourse Meta: > >--- >So turns out this is sort of a complex change for something so small. >Our code at that location assumes all phrases end in periods. Changing >that conditionally to sometimes an em-dash, sometimes not, is kind of.. >a pain in the butt. > >Will keep an eye on it, but low priority given the work required. > >--- >To respond, reply to this email or visit >http://meta.discourse.org/t/visually-separate-like-it-too-undo-like/8464/3 >in your browser. > >To unsubscribe from these emails, visit your [user >preferences](http://meta.discourse.org/user_preferences). -- Diese Nachricht wurde von meinem Android-Mobiltelefon mit K-9 Mail gesendet. email-reply-trimmer-0.1.6/test/emails/embedded_email_polish.txt0000644000175200017520000000173713114277423025031 0ustar abhijithabhijithOh, I've forgot to add. MIT -- Łukasz Jan Niemier Dnia 14 lip 2015 o godz. 00:25 Michael Downey napisał(a): > > downey Michael Downey Senior Tester > July 13 > Sounds interesting. What is the license? > > To respond, reply to this email or visit https://meta.discourse.org/t/static-pages-plugin/31027/2 in your browser. > > Previous Replies > > hauleth > July 13 > WIP > > Location: https://github.com/hauleth/low_voltage > > Authors: @hauleth > > Simple plugin to add "static" pages to Discourse instance. For now usage is kind of complicated at it needs to fetch static pages from app/views/pages. Ideas for future implements: > > Create DB model to hold pages > Adding admin page that will allow editing that pages > Custom styles for static pages > Any help appreciated. > > To respond, reply to this email or visit https://meta.discourse.org/t/static-pages-plugin/31027/2 in your browser. > > To unsubscribe from these emails, visit your user preferences. email-reply-trimmer-0.1.6/test/emails/email_headers_2.txt0000644000175200017520000000033413114277423023546 0ustar abhijithabhijithThis is a reply from Outlook! ________________________________________ From: Discourse <> (sent from a phone) (Sent from mobile device) 從我的 iPhone 傳送 email-reply-trimmer-0.1.6/test/emails/delimiters.txt0000644000175200017520000000022113114277423022677 0ustar abhijithabhijithThis is not a ---------- delimiter. But there should be no delimiter after this line ᐧ -- *** #### ~~~~~ ====== _______ ++++++++ ------- email-reply-trimmer-0.1.6/test/emails/embedded_email_french_2.txt0000644000175200017520000000052513114277423025213 0ustar abhijithabhijithLe 2016-11-16 02:22, Erlend Sogge Heggen a écrit : > erlend_sh [1] Erlend Sogge Heggen [1] team > November 16 > > Hello French guy, > >> is the back office also available in french like the front end ? > > Oui! > > Sincerely, > > Erlend > > * > > Links: > ------ > [1] https://meta.discourse.org/users/erlend_sh Thanks for your answer. email-reply-trimmer-0.1.6/test/emails/embedded_email_11.txt0000644000175200017520000000006313114277423023743 0ustar abhijithabhijithBefore 2016-03-03 17:21 GMT+01:00 Some One After email-reply-trimmer-0.1.6/test/emails/embedded_email_6.txt0000644000175200017520000000031313114277423023665 0ustar abhijithabhijithEnsuring that ON_DATE_SOMEONE_WROTE_REGEXES is not greedy. On this day I wrote something which was very interesting. On 28 Jan 2016, at 19:04, Some One wrote: > Did you write something interesting? email-reply-trimmer-0.1.6/test/emails/embedded_email_2.txt0000644000175200017520000000103313114277423023661 0ustar abhijithabhijithI have checked the available documentation/links to find out the end points. If there are some other endpoints, can you please tell the endpoints Best Regards ---- On Tue, 22 Dec 2015 14:17:36 +0530 Sam Saffron<info@discourse.org> wrote ---- sam Sam Saffron co-founder December 22 You are not using the right endpoint, go to user profile / badges, have a look at dev tools to see what it calls There is a discrete endpoint to get all the badges a user has To respond, reply to this email or visit the topic. email-reply-trimmer-0.1.6/test/emails/embedded_email_7.txt0000644000175200017520000000043413114277423023672 0ustar abhijithabhijithThis is a line before the embedded email. On Tue, 2011-03-01 at 18:02 +0530, Some One wrote: > Hello > > This is the embedded email. This is some text after the embedded email. > > This is another part of the embedded email. > > _______________________ And here's my signature. email-reply-trimmer-0.1.6/test/emails/email_headers_3.txt0000644000175200017520000000121313114277423023544 0ustar abhijithabhijithThis is the actual reply. From: Some One > Reply-To: "For.bar" > Date: Monday, February 8, 2016 11:44 AM To: Discourse > Subject: VIS Here's an email with some very important stuff. ________________________________ Reply here or hit reply from your inbox to help members by sharing your ideas. Mute this topic to stop getting updates, we'll send you the next one. DO NOT FORWARD THIS EMAIL! email-reply-trimmer-0.1.6/test/emails/embedded_ception.txt0000644000175200017520000000124213114277423024014 0ustar abhijithabhijithThis is the reply. Thanks, Some One On Mon, Feb 1, 2016 at 6:32 PM, Jeff Atwood wrote: > This is Jeff's reply. > > On Mon, Feb 1, 2016 at 7:50 AM, Some One > wrote: > >> Great! >> >> Many thanks. >> >> ~s >> >> On Mon, Feb 1, 2016 at 5:05 AM Discourse Team wrote: >> >>> WAT? >>> >>> On Wed, Jan 27, 2016 at 10:48 PM, Some One < >>> foo@bar.com> wrote: >>> >>>> Hi Team, >>>> >>>> How is it doing? >>>> >>>> Some One >>>> >>>> On Wed, Jan 27, 2016 at 10:10 AM Discourse Team >>>> wrote: >>>> >>>>> Hello :waves_hand: >>>>> >>>> >>> > -- Some One Community Manager foo@bar.com (123) 456-7890 email-reply-trimmer-0.1.6/test/emails/embedded_email_dutch_2.txt0000644000175200017520000000466013114277423025061 0ustar abhijithabhijithThe adblocker idea from @elberet might be it. Regretfully I only have time to test this in 2 weeks. I will let you know then... Op 16 aug. 2014 05:13 schreef "codinghorror" het volgende geschreven: > codinghorror > August 15 > > Hmm, if that is true we need to fix that somehow. > > To respond, reply to this email or visit > https://meta.discourse.org/t/configuring-google-oauth2-login-for-discourse/15858/38 > in your browser. > ------------------------------ > Previous Replies elberet > August 15 > > Are you using an ad blocker? Adblock Plus, for instance, removes the login > buttons. > bwvanmanen > August 15 > > The 'Sign in with Google' button does appear when I try to log in from > another pc. However the button does not appear on my pc using another > browser. > bwvanmanen > August 15 > > I followed the steps from the opening post, but I don't get a google login > option when users try to log in. There is just the normal user/password, > the word OR, and nothing next to that. Any clues? > > neil > August 1 > > Glad you got it fixed. It's good to have the resolution in this topic too. > I added a link to your topic in the first post. > jgehrcke > July 31 > > Sorry, that was kind of a cross-posting. Indeed, I got that fixed as you > say, as reported here: > jgehrcke said: > > I understand the solution you are proposing. The proper fix, without > customizing the disource.conf in the container, however, would be to inform > the web application about the protocol used via an HTTP header, as you are > also suggesting. The question is: does Discourse respect/support > X-Forwarded-Protocol? Then I can easily configure the nginx reverse proxy > with proxy_set_header X-Forwarded-Protocol $scheme; Edit: I can confirm > that properly setting the X-Forwarded-Proto header in the nginx … > > Thanks and sorry for not reporting back here! > ------------------------------ > > To respond, reply to this email or visit > https://meta.discourse.org/t/configuring-google-oauth2-login-for-discourse/15858/38 > in your browser. > > To unsubscribe from these emails, visit your user preferences > . > email-reply-trimmer-0.1.6/test/emails/embedded_email_1.txt0000644000175200017520000000034313114277423023663 0ustar abhijithabhijithThis is before the embedded email. On Wed, Sep 25, 2013, at 03:57 PM, richard_clark wrote: > This is the embedded email This is after the embedded email and will not show up because 99% of the times this is the signature... email-reply-trimmer-0.1.6/test/emails/quote_and_text.txt0000644000175200017520000000005313114277423023564 0ustar abhijithabhijith> This is a quote. And this is some text. email-reply-trimmer-0.1.6/test/emails/normalize_line_endings.txt0000644000175200017520000000004413114277423025257 0ustar abhijithabhijithEmail with windows line endings email-reply-trimmer-0.1.6/test/emails/embedded_email_portuguese.txt0000644000175200017520000000072013114277423025724 0ustar abhijithabhijithOlá, Qualquer dúvida estamos ai. Em 2 de fevereiro de 2015 10:58, discourse < info@discourse.org> escreveu: > discourse > February 2 > > Bom dia. Obrigado pela atenção > ------------------------------ > > To respond, reply to this email or visit > https://meta.discourse.org/ in your browser. > > To unsubscribe from these emails, visit your user preferences > . > email-reply-trimmer-0.1.6/test/emails/embedded_email_russian.txt0000644000175200017520000000173313114277423025213 0ustar abhijithabhijithWhy don't you override particular strings with JS? понедельник, 6 октября 2014 г. пользователь lidel написал: > lidel > October 6 > winterbox: > > Do you have any plan to make this plugin? > > discourse-locale-override > is just a hack, and > as @sam pointed out, it only works > if you update your instance via commandline. I created it to speed up my > work on pl_PL translation only. > > I see there is a need for a proper plugin (this and other threads), but > until such plugin appears this is a semi-working workaround. > ------------------------------ > > To respond, reply to this email or visit > https://meta.discourse.org/t/use-custom-translation-file/13786/41 in your > browser. > > To unsubscribe from these emails, visit your user preferences > . > email-reply-trimmer-0.1.6/test/emails/embedded_email_9.txt0000644000175200017520000000006413114277423023673 0ustar abhijithabhijithBar *-------- Original Message --------* THE END. email-reply-trimmer-0.1.6/test/emails/embedded_email_10.txt0000644000175200017520000000172613114277423023751 0ustar abhijithabhijithThank you. Sent from Outlook Mobile On Sun, Feb 7, 2016 at 12:12 AM -0800, "Arpit Jalan" > wrote: Hi Some, https://meta.discourse.org is now running on latest Discourse version! Regards, Arpit On Fri, Feb 5, 2016 at 10:43 AM Arpit Jalan > wrote: Okay, sure! Arpit On Fri, 5 Feb 2016 at 10:42, Some One > wrote: Arpit, Yes that sounds good. Sent from Outlook Mobile _____________________________ From: Arpit Jalan > Sent: Thursday, February 4, 2016 10:05 AM Subject: Meta Discourse update To: Some One >, Discourse Team > Hi Some One, Time to update meta to the latest Discourse version! Do you want me to take care of it? Regards, Arpit email-reply-trimmer-0.1.6/test/emails/text_only.txt0000644000175200017520000000002613114277423022566 0ustar abhijithabhijithEmail with only text. email-reply-trimmer-0.1.6/test/emails/strip.txt0000644000175200017520000000006113114277423021701 0ustar abhijithabhijith Strip leading and trailing empty lines. email-reply-trimmer-0.1.6/test/emails/email_headers_1.txt0000644000175200017520000000036213114277423023546 0ustar abhijithabhijithThis is a reply from Outlook! ------------------------------ *From:* Outlook user *Sent:* 2016-01-27 *To:* info@discourse.org *Subject:* Are you using Outlook? Just some random text wich is part of the embedded email... Outlook user email-reply-trimmer-0.1.6/test/emails/embedded_email_italian.txt0000644000175200017520000000132113114277423025141 0ustar abhijithabhijithOk, will do. As a test, this is a reply from a webmail client. > Il 26 marzo 2016 alle 13.16 Sam Saffron ha scritto: > > > > > > We need specific examples of failures, PM full source of emails to > @zogstrip > > Posted by sam on 03/26/2016 > > > > > > > --- > [Visit Topic](https://meta.discourse.org/t/email-reply-parsing/41597/2) > or reply to this email to respond > > To stop receiving notifications for this particular topic, [click > here](https://meta.discourse.org/t/email-reply-parsing/41597/unsubscribe). > To unsubscribe from these emails, change your [user > preferences](https://meta.discourse.org/my/preferences) -- Stefano Costa @stekosteko Editor, Journal of Open Archaeology Data email-reply-trimmer-0.1.6/test/emails/usenet.txt0000644000175200017520000000023013114277423022041 0ustar abhijithabhijithMal sehen was hier mit der Signatur passiert! -- Mit lieben Grüßen John Doe http://blog.john.doe www.facebook.com/johndoe Mobil: +12 345 6789 012 email-reply-trimmer-0.1.6/test/emails/quote_only.txt0000644000175200017520000000003113114277423022733 0ustar abhijithabhijith> Email with only quote. email-reply-trimmer-0.1.6/test/emails/embedded_email_spanish_1.txt0000644000175200017520000000305613114277423025414 0ustar abhijithabhijithI've configured Twitter Authentication, so this error happends on the application, after twitter posts to my discourse install via the callback. In the front error I can get a correct message saying "Something waa wrong, check you usename and password" and in the backend I see that error in the logs. El jueves, 21 de noviembre de 2013, codinghorror escribió: > codinghorror > November 21 > > How are you creating this user? Describe it step by step. > > To respond, reply to this email or visit > http://meta.discourse.org/t/error-creating-new-users-pg-numericvalueoutofrange/11046/2in your browser. > ------------------------------ > Previous Replies PabloC > November 21 > > Hi guys, > > While I create a new user, I'm finding this error in the logs : > > Processing by UsersController#create as */* > Parameters: {"name"=>"Ps4 Support Forum", "email"=>"pablocorral+ps4@gmail.com ", "username"=>"PS4SupportForum", "password_confirmation"=>"[FILTERED]", "challenge"=>"11a4ebe83d9b2a9e0d45bc50b457ee17"} > PG::NumericValueOutOfRange: ERROR: value "2201945804" is out of range for type integer > > Any idea? > > Tks! > ------------------------------ > > To respond, reply to this email or visit > http://meta.discourse.org/t/error-creating-new-users-pg-numericvalueoutofrange/11046/2in your browser. > > To unsubscribe from these emails, visit your user preferences > . > email-reply-trimmer-0.1.6/test/emails/embedded_email_8.txt0000644000175200017520000000006213114277423023670 0ustar abhijithabhijithFoo -------- Original Message -------- THE END. email-reply-trimmer-0.1.6/test/emails/embedded_email_4.txt0000644000175200017520000000117513114277423023672 0ustar abhijithabhijithIf I do exactly that, then the test group won't be saved after a refresh of the page. 2013/7/20 sam via Discourse Meta > sam replied to your post in 'Unable to create group' on Discourse Meta: > ------------------------------ > > Is this an error handling thing, if you name the group "test" and only > place yourself in it, does it persist? > ------------------------------ > > To respond, reply to this email or visit > http://meta.discourse.org/t/unable-to-create-group/8198/6 in your browser. > > To unsubscribe from these emails, visit your user preferences > . > email-reply-trimmer-0.1.6/test/emails/email_headers_4.txt0000644000175200017520000000201613114277423023547 0ustar abhijithabhijithtest Da: Sally54721 Risposta: Testy McTesterson / Test Data: giovedì 8 ottobre 2015 15:26 A: Testy McTesterson Oggetto: Test | Issue (#3) [@example](http://example.com/u/example) — Reply to this email directly or [view it on GitLab](http://git.example.com/example/Test/issues/3). {"@context":"[http://schema.org","@type":"EmailMessage","action":{"@type":"ViewAction","name":"View](http://schema.org%22,%22@type%22:%22EmailMessage%22,%22action%22:%7B%22@type%22:%22ViewAction%22,%22name%22:%22View) Issue","url":"[http://git.example.com/example/Test/issues/3"}](http://git.example.com/example/Test/issues/3%22%7D)} You're receiving this notification because you are a member of the Testy McTesterson / Test project team. -- Questo messaggio e' stato analizzato con Libra ESVA ed e' risultato non infetto. [Clicca qui per segnalarlo come spam.](http://esva.example.com/cgi-bin/learn-msg.cgi?id=1234567890.ABCDEF) [Clicca qui per metterlo in blacklist](http://esva.example.com/cgi-bin/learn-msg.cgi?blacklist=1&id=1234567890.ABCDEF) email-reply-trimmer-0.1.6/test/emails/embedded_email_12.txt0000644000175200017520000000031313114277423023742 0ustar abhijithabhijithOne 1 On Thu, 31 Mar 2016 at 11:16 Some One < mailto:Some One > wrote: Two 2 On Thu, 31 Mar 2016 at 10:05 Jeff Atwood < mailto:Jeff Atwood > wrote: Three 3 email-reply-trimmer-0.1.6/test/emails/embedded_email_5.txt0000644000175200017520000000023713114277423023671 0ustar abhijithabhijithI am testing the SOMEONE_EMAIL_WROTE_REGEX regular expression. Some One wrote: Something that will be considered as the embedded email. email-reply-trimmer-0.1.6/test/emails/embedded_email_3.txt0000644000175200017520000000147213114277423023671 0ustar abhijithabhijithSure, [Bitnami](http://bitnami.com/stack/discourse) supports EC2 and there are several topics here about it. Our [official install guide]( https://github.com/discourse/discourse/blob/master/docs/INSTALL-ubuntu.md) also works great on an Amazon EC2 provisioned virtual machine with very little change. On Thu, Jun 20, 2013 at 4:18 PM, matt2 via Discourse Meta < info@discourse.org> wrote: > matt2 posted in 'Discourse on Ubuntu: Video Walkthrough' on Discourse Meta: > ------------------------------ > > Has anyone tried on AWS? a public AMI would be awesome. > ------------------------------ > > Please visit this link to respond: > http://meta.discourse.org/t/discourse-on-ubuntu-video-walkthrough/7478/4 > > To unsubscribe from these emails, visit your user preferences > . > email-reply-trimmer-0.1.6/test/emails/embedded_email_french_1.txt0000644000175200017520000000026513114277423025213 0ustar abhijithabhijithC'est super ! Le 4 janv. 2016 19:03, "Neil Lalonde" a écrit : > team > January 4 > > Discourse c'est top ! > > Neil > email-reply-trimmer-0.1.6/test/emails/embedded_email_spanish_2.txt0000644000175200017520000000067113114277423025415 0ustar abhijithabhijithIgual que siempre (inclusive ahora), sin nada raro :/ -----Mensaje original----- De: "Miguel" Enviado: =E2=80=8E16/=E2=80=8E02/=E2=80=8E2016 14:53 Para: "discourse" Asunto: [MP]Parser del email Visita el tema o responde a este email para publicar. Para no recibir m=C3=A1s notificaciones de este tema en particular, haz cli= c aqu=C3=AD. Para darte de baja de estos emails, cambia tus preferencias = email-reply-trimmer-0.1.6/test/emails/dual_embedded.txt0000644000175200017520000000034413114277423023302 0ustar abhijithabhijithThis is the 3rd email. On Mon, Feb 1, 2016 at 4:58 AM -0800, "Some One" wrote: This is the 2nd email. On Sun, Jan 31, 2016 at 9:58 PM -0800, "Another One" wrote: This is the 1st email. email-reply-trimmer-0.1.6/test/emails/embedded_email_german_3.txt0000644000175200017520000000032413114277423025215 0ustar abhijithabhijithGruß Discourse -----Ursprüngliche Nachricht----- Von: Discourse Team Gesendet: Don 11 Februar 2016 11:23 An: Some One Betreff: Some Subject Hallo! Wie geht es Ihnen heute? email-reply-trimmer-0.1.6/Rakefile0000644000175200017520000000041213114277423017213 0ustar abhijithabhijithdef name @name ||= Dir["*.gemspec"].first.split(".").first end def version @version ||= File.read("lib/#{name}.rb")[/^\s*VERSION\s*=\s*['"](?'version'\d+\.\d+\.\d+)['"]/, "version"] end task :default => :test require "rake/testtask" Rake::TestTask.new(:test) email-reply-trimmer-0.1.6/README.md0000644000175200017520000000136513114277423017035 0ustar abhijithabhijith# Discourse Email Reply Trimmer [![Build Status](https://api.travis-ci.org/discourse/email_reply_trimmer.svg?branch=master)](https://travis-ci.org/discourse/email_reply_trimmer) EmailReplyTrimmer is a small library to trim replies from plain text email. ## Usage To trim replies: `trimmed_body = EmailReplyTrimmer.trim(email_body)` ## Installation Get it from [GitHub](https://github.com/discourse/email_reply_trimmer). Run `rake` to run the tests. ## Inspirations - [GitHub's Email Reply Parser](https://github.com/github/email_reply_parser) - [MailGun's Talon](https://github.com/mailgun/talon) - [Vitor R. Carvalho's Learning to Extract Signature and Reply Lines from Email](http://www.cs.cmu.edu/~vitor/papers/sigFilePaper_finalversion.pdf) email-reply-trimmer-0.1.6/email_reply_trimmer.gemspec0000644000175200017520000000124613114277423023162 0ustar abhijithabhijithrequire_relative "lib/email_reply_trimmer" Gem::Specification.new do |s| s.name = "email_reply_trimmer" s.version = EmailReplyTrimmer::VERSION s.date = Time.now.strftime('%Y-%m-%d') s.summary = "Library to trim replies from plain text email." s.description = "EmailReplyTrimmer is a small library to trim replies from plain text email." s.authors = ["Régis Hanol"] s.email = ["regis+rubygems@hanol.fr"] s.homepage = "https://github.com/discourse/email_reply_trimmer" s.license = "MIT" s.require_paths = ["lib"] s.files = Dir["**/*"].reject { |path| File.directory?(path) } s.test_files = s.files.select { |path| path =~ /^test\/.+_test\.rb$/ } end email-reply-trimmer-0.1.6/lib/0000755000175200017520000000000013114277423016317 5ustar abhijithabhijithemail-reply-trimmer-0.1.6/lib/email_reply_trimmer.rb0000644000175200017520000001137613114277423022715 0ustar abhijithabhijithrequire_relative "email_reply_trimmer/empty_line_matcher" require_relative "email_reply_trimmer/delimiter_matcher" require_relative "email_reply_trimmer/signature_matcher" require_relative "email_reply_trimmer/embedded_email_matcher" require_relative "email_reply_trimmer/email_header_matcher" require_relative "email_reply_trimmer/quote_matcher" class EmailReplyTrimmer VERSION = "0.1.6" DELIMITER = "d" EMBEDDED = "b" EMPTY = "e" EMAIL_HEADER = "h" QUOTE = "q" SIGNATURE = "s" TEXT = "t" def self.identify_line_content(line) return EMPTY if EmptyLineMatcher.match? line return DELIMITER if DelimiterMatcher.match? line return SIGNATURE if SignatureMatcher.match? line return EMBEDDED if EmbeddedEmailMatcher.match? line return EMAIL_HEADER if EmailHeaderMatcher.match? line return QUOTE if QuoteMatcher.match? line return TEXT end def self.trim(text, split=false) return if text.nil? || text =~ /\A[[:space:]]*\Z/m # normalize line endings text.gsub!("\r\n", "\n") # fix embedded email markers that might span over multiple lines EmbeddedEmailMatcher::ON_DATE_SOMEONE_WROTE_REGEXES.each do |r| text.gsub!(r) { |m| m.gsub(/\n[[:space:]>\-]*/, " ") } end # from now on, we'll work on a line-by-line basis lines = text.split("\n") lines_dup = lines.dup # identify content of each lines pattern = lines.map { |l| identify_line_content(l) }.join # remove everything after the first delimiter if pattern =~ /d/ index = pattern =~ /d/ pattern = pattern[0...index] lines = lines[0...index] end # remove all mobile signatures while pattern =~ /s/ index = pattern =~ /s/ pattern.slice!(index) lines.slice!(index) end # when the reply is at the end of the email if pattern =~ /^b+q+[eq]*t[te]*$/ index = pattern =~ /t/ pattern = "" lines = lines[index..-1] end # if there is an embedded email marker, not followed by a quote # then take everything up to that marker if pattern =~ /te*b[^q]*$/ index = pattern =~ /te*b[^q]*$/ pattern = pattern[0..index] lines = lines[0..index] end # if there is an embedded email marker, followed by a huge quote # then take everything up to that marker if pattern =~ /te*b[eqbh]*[te]*$/ index = pattern =~ /te*b[eqbh]*[te]*$/ pattern = pattern[0..index] lines = lines[0..index] end # if there still are some embedded email markers, just remove them while pattern =~ /b/ index = pattern =~ /b/ pattern.slice!(index) lines.slice!(index) end # fix email headers when they span over multiple lines if pattern =~ /h+[hte]+h+e/ index = pattern =~ /h+[hte]+h+e/ size = pattern[/h+[hte]+h+e/].size size.times.each { |s| pattern[index + s] = EMAIL_HEADER } end # if there are at least 3 consecutive email headers, take everything up to # these headers if pattern =~ /t[eq]*h{3,}/ index = pattern =~ /t[eq]*h{3,}/ pattern = pattern[0..index] lines = lines[0..index] end # if there still are some email headers, just remove them while pattern =~ /h/ index = pattern =~ /h/ pattern.slice!(index) lines.slice!(index) end # remove trailing quotes when there's at least one line of text if pattern =~ /t/ && pattern =~ /[eq]+$/ index = pattern =~ /[eq]+$/ pattern = pattern[0...index] lines = lines[0...index] end # results trimmed = lines.join("\n").strip if split [trimmed, compute_elided(lines_dup, lines)] else trimmed end end def self.extract_embedded_email(text) return if text.nil? || text =~ /\A[[:space:]]*\Z/m # normalize line endings text.gsub!("\r\n", "\n") # fix embedded email markers that might span over multiple lines EmbeddedEmailMatcher::ON_DATE_SOMEONE_WROTE_REGEXES.each do |r| text.gsub!(r) { |m| m.gsub(/\n[[:space:]>\-]*/, " ") } end # from now on, we'll work on a line-by-line basis lines = text.split("\n") # identify content of each lines pattern = lines.map { |l| identify_line_content(l) }.join if index = pattern =~ /(?:h[eqd]*?){3,}[tq]/ embedded = lines[index..-1].join("\n").strip before = lines[0...(pattern[0...index] =~ /e*(b[eqd]*|b*[ed]*)$/)].join("\n").strip return [embedded, before] end end private def self.compute_elided(text, lines) elided = [] t = 0 l = 0 while t < text.size while l < lines.size && text[t] == lines[l] t += 1 l += 1 end elided << text[t] t += 1 end elided.join("\n").strip end end email-reply-trimmer-0.1.6/lib/email_reply_trimmer/0000755000175200017520000000000013114277423022360 5ustar abhijithabhijithemail-reply-trimmer-0.1.6/lib/email_reply_trimmer/embedded_email_matcher.rb0000644000175200017520000001036713114277423027317 0ustar abhijithabhijithclass EmbeddedEmailMatcher # On Wed, Sep 25, 2013, at 03:57 PM, jorge_castro wrote: # On Thursday, June 27, 2013, knwang via Discourse Meta wrote: # On Wed, 2015-12-02 at 13:58 +0000, Tom Newsom wrote: # On 10/12/15 12:30, Jeff Atwood wrote: # ---- On Tue, 22 Dec 2015 14:17:36 +0530 Sam Saffron<info@discourse.org> wrote ---- # Op 24 aug. 2013 om 16:48 heeft ven88 via Discourse Meta het volgende geschreven: # Le 4 janv. 2016 19:03, "Neil Lalonde" a écrit : # Dnia 14 lip 2015 o godz. 00:25 Michael Downey napisał(a): # Em seg, 27 de jul de 2015 17:13, Neil Lalonde escreveu: # El jueves, 21 de noviembre de 2013, codinghorror escribió: # Am 03.02.2016 3:35 nachm. schrieb Max Mustermann : ON_DATE_SOMEONE_WROTE_MARKERS = [ # Dutch ["Op","het volgende geschreven"], # English ["On", "wrote"], # French ["Le", "a écrit "], # Italian ["Il", "ha scritto"], # Polish ["Dnia", "napisał\\(a\\)"], # Portuguese ["Em", "escreveu"], # Spanish ["El", "escribió"], # German ["Am", "schrieb"], ] ON_DATE_SOMEONE_WROTE_REGEXES = ON_DATE_SOMEONE_WROTE_MARKERS.map do |on, wrote| wrote.gsub!(/ +/, "[[:space:]]+") # the "wrote" part might span over multiple lines /^([[:blank:]>\-]*#{on}\s(?:(?!#{on}\s|#{wrote}:?)[\s\S])*#{wrote}:?[[:blank:]\-]*)$/m end # Op 10 dec. 2015 18:35 schreef "Arpit Jalan" : # Am 18.09.2013 um 16:24 schrieb codinghorror : ON_DATE_WROTE_SOMEONE_MARKERS = [ # Dutch ["Op", "schreef"], # German ["Am", "schrieb"], ] ON_DATE_WROTE_SOMEONE_REGEXES = ON_DATE_WROTE_SOMEONE_MARKERS.map do |on, wrote| /^[[:blank:]>]*#{on}\s.+\s#{wrote}\s[^:]+:/ end # суббота, 14 марта 2015 г. пользователь etewiah написал: DATE_SOMEONE_WROTE_MARKERS = [ # Russian ["пользователь", "написал"], ] DATE_SOMEONE_WROTE_REGEXES = DATE_SOMEONE_WROTE_MARKERS.map do |user, wrote| /.+#{user}.+#{wrote}:/ end # 2016-03-03 17:21 GMT+01:00 Some One ISO_DATE_SOMEONE_REGEX = /^[[:blank:]>]*20\d\d-\d\d-\d\d \d\d:\d\d GMT\+\d\d:\d\d [\w[:blank:]]+$/ # 2015-10-18 0:17 GMT+03:00 Matt Palmer : # 2013/10/2 camilohollanda # вт, 5 янв. 2016 г. в 23:39, Erlend Sogge Heggen : # ср, 1 апр. 2015, 18:29, Denis Didkovsky : DATE_SOMEONE_EMAIL_REGEX = /^[[:blank:]>]*.*\d{4}.+<[^@<>]+@[^@<>.]+\.[^@<>]+>:?$/ # codinghorror via Discourse Meta wrote: # codinghorror via Discourse Meta schrieb: SOMEONE_VIA_SOMETHING_WROTE_MARKERS = [ # English "wrote", # German "schrieb", ] SOMEONE_VIA_SOMETHING_WROTE_REGEXES = SOMEONE_VIA_SOMETHING_WROTE_MARKERS.map do |wrote| /^[[:blank:]>]*.+ via .+ #{wrote}:?[[:blank:]]*$/ end # Some One wrote: SOMEONE_EMAIL_WROTE_REGEX = /^[[:blank:]>]*.+ <.+@.+\..+> wrote:?/ # Posted by mpalmer on 01/21/2016 POSTED_BY_SOMEONE_ON_DATE_REGEX = /^[[:blank:]>]*Posted by .+ on \d{2}\/\d{2}\/\d{4}$/i # Begin forwarded message: # Reply Message # ----- Forwarded Message ----- # ----- Original Message ----- # -----Original Message----- # *----- Original Message -----* FORWARDED_EMAIL_REGEXES = [ # English /^[[:blank:]>]*Begin forwarded message:/i, /^[[:blank:]>]*Reply message/i, /^[[:blank:]>\*]*-{2,}[[:blank:]]*(Forwarded|Original) Message[[:blank:]]*-{2,}/i, # French /^[[:blank:]>\*]*-{2,}[[:blank:]]*Message transféré[[:blank:]]*-{2,}/i, # German /^[[:blank:]>\*]*-{2,}[[:blank:]]*Ursprüngliche Nachricht[[:blank:]]*-{2,}/i, # Spanish /^[[:blank:]>\*]*-{2,}[[:blank:]]*Mensaje original[[:blank:]]*-{2,}/i, ] EMBEDDED_REGEXES = [ ON_DATE_SOMEONE_WROTE_REGEXES, ON_DATE_WROTE_SOMEONE_REGEXES, DATE_SOMEONE_WROTE_REGEXES, DATE_SOMEONE_EMAIL_REGEX, ISO_DATE_SOMEONE_REGEX, SOMEONE_VIA_SOMETHING_WROTE_REGEXES, SOMEONE_EMAIL_WROTE_REGEX, POSTED_BY_SOMEONE_ON_DATE_REGEX, FORWARDED_EMAIL_REGEXES, ].flatten def self.match?(line) EMBEDDED_REGEXES.any? { |r| line =~ r } end end email-reply-trimmer-0.1.6/lib/email_reply_trimmer/email_header_matcher.rb0000644000175200017520000000231213114277423027005 0ustar abhijithabhijithclass EmailHeaderMatcher EMAIL_HEADERS_WITH_DATE_MARKERS = [ # Dutch ["Sendt"], # English ["Sent"], # French ["Date"], # German ["Gesendet"], # Portuguese ["Enviada em"], # Spanish ["Enviado"], # Spanish (Mexican) ["Fecha"], # Italian ["Data"], ] EMAIL_HEADERS_WITH_DATE_REGEXES = EMAIL_HEADERS_WITH_DATE_MARKERS.map do |header| /^[[:blank:]>\*]*(?:#{header.join("|")})[[:blank:]\*]*:.*\d+/ end EMAIL_HEADERS_WITH_TEXT_MARKERS = [ # Dutch ["Fra", "Til", "Emne"], # English ["From", "To", "Cc", "Reply-To", "Subject"], # French ["De", "À", "Répondre à", "Objet"], # German ["Von", "An", "Betreff"], # Portuguese ["De", "Para", "Assunto"], # Spanish ["De", "Para", "Asunto"], # Italian ["Da", "Risposta", "A", "Oggetto"] ] EMAIL_HEADERS_WITH_TEXT_REGEXES = EMAIL_HEADERS_WITH_TEXT_MARKERS.map do |header| /^[[:blank:]>\*]*(?:#{header.join("|")})[[:blank:]\*]*:.*[[:word:]]+/ end EMAIL_HEADER_REGEXES = [ EMAIL_HEADERS_WITH_DATE_REGEXES, EMAIL_HEADERS_WITH_TEXT_REGEXES, ].flatten def self.match?(line) EMAIL_HEADER_REGEXES.any? { |r| line =~ r } end end email-reply-trimmer-0.1.6/lib/email_reply_trimmer/delimiter_matcher.rb0000644000175200017520000000034213114277423026365 0ustar abhijithabhijithclass DelimiterMatcher DELIMITER_CHARACTERS ||= "-_,=+~#*ᐧ" DELIMITER_REGEX ||= /^[[:blank:]]*[#{Regexp.escape(DELIMITER_CHARACTERS)}]+[[:blank:]]*$/ def self.match?(line) line =~ DELIMITER_REGEX end end email-reply-trimmer-0.1.6/lib/email_reply_trimmer/quote_matcher.rb0000644000175200017520000000012413114277423025542 0ustar abhijithabhijithclass QuoteMatcher def self.match?(line) line =~ /^[[:blank:]]*>/ end end email-reply-trimmer-0.1.6/lib/email_reply_trimmer/empty_line_matcher.rb0000644000175200017520000000013013114277423026547 0ustar abhijithabhijithclass EmptyLineMatcher def self.match?(line) line =~ /^[[:blank:]]*$/ end end email-reply-trimmer-0.1.6/lib/email_reply_trimmer/signature_matcher.rb0000644000175200017520000000174113114277423026414 0ustar abhijithabhijithclass SignatureMatcher # Envoyé depuis mon iPhone # Von meinem Mobilgerät gesendet # Diese Nachricht wurde von meinem Android-Mobiltelefon mit K-9 Mail gesendet. # Nik from mobile # From My Iphone 6 # Sent via mobile # Sent with Airmail # Sent from Windows Mail # Sent from my TI-85 # <> # (sent from a phone) # (Sent from mobile device) # 從我的 iPhone 傳送 SIGNATURE_REGEXES = [ # Chinese /^[[:blank:]>]*從我的 iPhone 傳送/i, # English /^[[:blank:]>]*[[:word:]]+ from mobile/i, /^[[:blank:]>]*[\(<]*sent (?:from|via|with|by) .+[\)>]*/i, /^[[:blank:]>]*from my .{1,20}/i, # don't match too much # French /^[[:blank:]>]*Envoyé depuis mon .+/i, # German /^[[:blank:]>]*Von meinem .+ gesendet/i, /^[[:blank:]>]*Diese Nachricht wurde von .+ gesendet/i, # Spanish /^[[:blank:]>]*Enviado desde mi .+/i, ] def self.match?(line) SIGNATURE_REGEXES.any? { |r| line =~ r } end end email-reply-trimmer-0.1.6/LICENSE0000644000175200017520000000205713114277423016562 0ustar abhijithabhijithThe MIT License (MIT) Copyright (c) Discourse Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.