jenkinsci / poll-mailbox-trigger-plugin

A Jenkins plugin, to poll an email inbox, and trigger jobs based on new emails.
https://plugins.jenkins.io/poll-mailbox-trigger-plugin/
MIT License
40 stars 32 forks source link

Option for a Jenkins job to process emails without marking them as read on the mail server #43

Open TheCodeArtist opened 6 years ago

TheCodeArtist commented 6 years ago

Steps to reproduce

Setup a Jenkins job triggerred by "Poll Mailbox Trigger"

Expected behaviour

User should have an option (checkbox) to NOT mark emails on the server as read. The default configuration should be backward compatible i.e. continue to mark processed emails as read by default.

The goal is to process incoming emails of a human's inbox to trigger required background actions to have the necessary work-products avialabel by the time teh human reads the email.

For example, upon receiving a bug report email when i'm asleep, sync the corresponding branch, trigger a local build and have the necessary outputs ready for me to try things out once i wake-up and read the email. ( It is important and preferred that the original email received is NOT marked as read without me reading it! )

We can avoid repeatedly processing the same email multiple times using: schedule <cron/jenkins pattern to specify poll-period> receivedXMinutesAgo=poll-period

Actual behaviour

Currently unable to locate any option in the trigger configuration options to to avoid marking emails as read on the email-server.

Server configuration

Operating system: Linux

Jenkins Version: 2.107.3

Plugin Version: 1.026

Mail Server: Any

Additional Steps/Questions

TheCodeArtist commented 6 years ago

Looking at PollMailboxTrigger.java:317 it appears we could also support the flow where, the build-job sets some environment variable, based on which Poll Mailbox decides whether to mark the email as Read or keep it Unread.

Correct?...