Skip to content

Periodic Background rules like "MailRetentionRule" do not run on papercut.service.exe #369

Description

@Pxtl

Describe the bug

The rule "Papercut.Rules.Domain.Cleanup.MailRetentionRule, Papercut.Rules" are not executed on the service, nor is there any warning that these are not supported.

To Reproduce
Steps to reproduce the behavior:

  1. In Papercut.Rules.Service, use the following rules.json:
[
  {
    "$type": "Papercut.Rules.Domain.Cleanup.MailRetentionRule, Papercut.Rules",
    "Type": "Cleanup Mail",
    "MailRetentionDays": 14,
    "Id": "00f34b91-84ab-41bb-9924-1aa5dcbf56e5",
    "IsEnabled": true
  }
]
  1. Have an email more than 14 days old in your "Incoming" directory.

  2. Nothing happens. It does not get deleted.

Expected behavior
Emails older than 14 days would get deleted.

Screenshots
NA.

Desktop (please complete the following information):

  • OS: Windows Server 2016

Additional context
I've examined the code and I'm 99% sure that the problem is that
Papercut.Service.Infrastructure.Rules.RulesService calls SetupPeriodicRuleObservable in the HandleAsync for PapercutClientReadyEvent which (being client-oriented) is never called in Papercut.Service.

I don't understand the architecture well-enough for a PR but I'm pretty confident that SetupPeriodicRuleObservable needs to be called by something that is also called by services.

If the intention is that Periodic Background rules are not supported on service, then users need to be notified.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions