Skip to content
Snippets Groups Projects

Reply by email

Merged Douwe Maan requested to merge reply-by-email into master

Fixes #1360 (closed).

It's far from done, but it works.

  • Add attachments
  • Reply with error message
  • Documentation for source
  • Update init scripts
  • Verify updated init scripts actually work
  • Tests
  • Integration with omnibus
  • Documentation for omnibus

cc @dzaporozhets @rspeicher

Merge request reports

Loading
Loading

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
  • Douwe Maan Added 1 commit:

    Added 1 commit:

  • Robert Speicher
    Robert Speicher @rspeicher started a thread on commit 8906caba
  • 1 # Taken mostly from Discourse's Email::HtmlCleaner
    2 module Gitlab
    3 # HtmlCleaner cleans up the extremely dirty HTML that many email clients
    4 # generate by stripping out any excess divs or spans, removing styling in
    5 # the process (which also makes the html more suitable to be parsed as
    6 # Markdown).
    7 class EmailHtmlCleaner
  • Douwe Maan Added 6 commits:

    Added 6 commits:

    • 73eef57d - Make MR notification email subject more standard.
    • 4f34d363 - Correctly set Message-ID for comment notifications.
    • 6b31827a - Include display name with reply to address.
    • 01c5eced - Add "Reply to this email directly" to notification footer.
    • ee1eb294 - Turn reply-by-email attachments into uploads.
    • 170aa3b4 - Update mail_room.
  • Douwe Maan Added 1 commit:

    Added 1 commit:

    • 76dbafba - Send a rejection email when the incoming email couldn't be processed.
  • Author Maintainer

    We're pretty much done implementation wise, pending your review. Next up are tests and documentation.

  • Douwe Maan Added 1 commit:

    Added 1 commit:

    • 03b54f1f - Fix responding to commit notes
  • Douwe Maan Added 2 commits:

    Added 2 commits:

    • a8a861ae - Add BaseMailer to house shared mailer functionality.
    • 992dbbd9 - Move sent_notification! out of Notify.
  • Douwe Maan Added 1 commit:

    Added 1 commit:

  • Douwe Maan Added 1 commit:

    Added 1 commit:

  • Douwe Maan Added 1 commit:

    Added 1 commit:

  • Douwe Maan Added 3 commits:

    Added 3 commits:

    • 089aa2de - Add Reply by email feature to admin dashboard.
    • f3b57ce6 - Update init scripts.
    • 34026c97 - Add documentation.
  • Douwe Maan Added 1 commit:

    Added 1 commit:

  • Douwe Maan Added 1 commit:

    Added 1 commit:

    • 1202875d - Fix lib/support/init.d/gitlab.
  • Douwe Maan Added 1 commit:

    Added 1 commit:

  • Douwe Maan Added 1 commit:

    Added 1 commit:

  • Douwe Maan Added 2 commits:

    Added 2 commits:

  • Douwe Maan Added 1 commit:

    Added 1 commit:

  • Douwe Maan Added 3 commits:

    Added 3 commits:

    • 3ff9d5c6 - Use canonical version of mail_room.
    • e9972efc - Extract ReplyParser and AttachmentUploader from Receiver.
    • 0b401f2e - Fix a couple of whoopsy daisies.
  • Douwe Maan Added 2 commits:

    Added 2 commits:

    • 2f78b5e8 - Make error class names more consistent.
    • 991c9f6f - Test Email::AttachmentUploader.
  • Douwe Maan Added 1 commit:

    Added 1 commit:

  • Douwe Maan Added 1 commit:

    Added 1 commit:

    • 8ec5fb13 - Test Gitlab::Email::Receiver.
  • Douwe Maan Added 48 commits:

    Added 48 commits:

  • Douwe Maan Added 1 commit:

    Added 1 commit:

  • Douwe Maan Added 1 commit:

    Added 1 commit:

    • e1eb09dd - Remove more unused fixtures.
  • Douwe Maan Added 1 commit:

    Added 1 commit:

  • Douwe Maan Added 1 commit:

    Added 1 commit:

  • Author Maintainer

    @marin Could you see what the impact of this would be to omnibus? We'd need to add the mail_room process if reply by email is enabled, as well as reply_by_email config options (enabled/address, imap host/port/ssl/email/password). You can see the doc for source installations at https://gitlab.com/gitlab-org/gitlab-ce/blob/reply-by-email/doc/reply_by_email/README.md.

  • Douwe Maan Added 1 commit:

    Added 1 commit:

  • Douwe Maan Added 1 commit:

    Added 1 commit:

    • 48e25a01 - Add stub_reply_by_email_setting helper.
  • Douwe Maan Added 2 commits:

    Added 2 commits:

    • 123af785 - Add gitlab:reply_by_email:check rake task.
    • 02b7be4a - Remove weirdness.
  • Douwe Maan Added 1 commit:

    Added 1 commit:

    • 41ed60c2 - Fix MailRoom running check.
  • Douwe Maan Added 1 commit:

    Added 1 commit:

  • Douwe Maan Added 1 commit:

    Added 1 commit:

  • Douwe Maan Added 1 commit:

    Added 1 commit:

    • afb765ad - Fix markdown specs again. Apparently development and test behave differently.
  • Douwe Maan Added 1 commit:

    Added 1 commit:

    • 3d141d15 - Fix spec by removing global state.
  • Douwe Maan Added 1 commit:

    Added 1 commit:

    • 35224d5e - Memoize address_regex locally.
  • @DouweM The impact on omnibus-gitlab is not big(new config and templates but no structure changes), when this is ready for merge open an issue at omnibus-gitlab so I can add in the support.

    Edited by Marin Jankovski
  • Douwe Maan Added 1 commit:

    Added 1 commit:

    • 69708dab - Block blocked users from replying to threads by email.
  • Reassigned to @DouweM

  • Reassigned to @rspeicher

  • Author Maintainer

    @rspeicher Ready for the final review? :)

  • Douwe Maan Added 1 commit:

    Added 1 commit:

    • 50baa1fd - Add development section to doc.
  • Douwe Maan Added 1 commit:

    Added 1 commit:

    • 03666553 - Fix check task for development.
  • Douwe Maan Added 1 commit:

    Added 1 commit:

    • 3abb356d - Add development documentation for real.
  • Douwe Maan Title changed from WIP: Reply by email to Reply by email

    Title changed from WIP: Reply by email to Reply by email

  • Douwe Maan Added 1 commit:

    Added 1 commit:

  • Robert Speicher Status changed to merged

    Status changed to merged

  • Robert Speicher mentioned in commit f0bdf7f8

    mentioned in commit f0bdf7f8

  • Great work @DouweM!!

  • 62 :delivery_options:
    63 # The URL to the Redis server used by Sidekiq. Should match the URL in config/resque.yml.
    64 :redis_url: redis://localhost:6379
    65 # Always "resque:gitlab".
    66 :namespace: resque:gitlab
    67 # Always "incoming_email".
    68 :queue: incoming_email
    69 # Always "EmailReceiverWorker"
    70 :worker: EmailReceiverWorker
    71 ```
    72
    73
    74 4. Find `lib/support/init.d/gitlab.default.example` and copy it to `/etc/default/gitlab`:
    75
    76 ```sh
    77 sudo cp lib/support/init.d/gitlab.default.example /etc/default/gitlab
  • What happened to the omnibus integration? This got merged with two 'todo checkboxes' unticked.

    Screen_Shot_2015-08-27_at_10.51.32

    Edit: ah I see the reference to omnibus-gitlab#732 (closed) now in the fine print above. Never mind :)

    Edited by username-removed-5302
  • @jacobvosmaer Thanks for asking. @DouweM Created an issue in omnibus-gitlab/issues!732 and MR was merged yesterday with this. I pushed a documentation commit to gitlab-ce/merge_requests!1193

  • Author Maintainer

    @jacobvosmaer Also see https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/1173#note_1935363, which I posted a day before this MR was merged.

    Edited by Douwe Maan
  • Stan Hu
    Stan Hu @stanhu started a thread on commit f76eac56
  • 5
    6 def perform(raw)
    7 return unless Gitlab.config.reply_by_email.enabled
    8
    9 # begin
    10 Gitlab::EmailReceiver.new(raw).process
    11 # rescue => e
    12 # handle_failure(raw, e)
    13 # end
    14 end
    15
    16 private
    17
    18 def handle_failure(raw, e)
    19 # TODO: Handle better.
    20 Rails.logger.warn("Email can not be processed: #{e}\n\n#{raw}")
  • 30 when Gitlab::EmailReceiver::AutoGeneratedEmailError
    31 reason = "The email was marked as 'auto generated', which we can't accept. Please create your comment through the web interface."
    32 when Gitlab::EmailReceiver::UserNotFoundError
    33 reason = "We couldn't figure out what user corresponds to the email. Please create your comment through the web interface."
    34 when Gitlab::EmailReceiver::UserNotAuthorizedError
    35 reason = "You are not allowed to respond to the thread you are replying to. If you believe this is in error, contact a staff member."
    36 when Gitlab::EmailReceiver::NoteableNotFoundError
    37 reason = "The thread you are replying to no longer exists, perhaps it was deleted? If you believe this is in error, contact a staff member."
    38 when Gitlab::EmailReceiver::InvalidNote
    39 can_retry = true
    40 reason = e.message
    41 else
    42 return
    43 end
    44
    45 EmailRejectionMailer.delay.rejection(reason, raw, can_retry)
  • mentioned in issue #36054 (closed)

  • Please register or sign in to reply
    Loading