Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add checks to sieve validator (mime and foreverypart) #5786

Closed

Conversation

melone2
Copy link

@melone2 melone2 commented Mar 8, 2024

Allowing the inclusion of the sieve extensions mime and foreverypart would allow for additional sieve filter options.
The usecase could be filtering mails by attached filetypes.
e.g. redirecting or blocking mails which have a certain file attached to them.

With the proposed changes I was able to successfully save a sieve filter script with following content:

require ["mime", "foreverypart", "copy"];

foreverypart
{
  if header :mime :anychild :param "filename" :matches "Content-Disposition" ["*.pdf"]
  {
    redirect :copy "copycat@example.com";
  }
}

This script will forward every mail that has a .pdf file attached to a separate E-Mail address (e.g. dms such as paperless-ngx).

Removing the "filename" string from this example caused the parser to fail - as it should.

Additional checks for sieve parser to allow mime and foreverypart extensions in sieve scripts.
@melone2 melone2 changed the title Add checks to sieve parser (mime and foreverypart) Add checks to sieve validator (mime and foreverypart) Mar 8, 2024
@DerLinkman DerLinkman added this to the 2024-03 milestone Mar 19, 2024
@milkmaker
Copy link
Collaborator

This pull request has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.

@milkmaker milkmaker added the stale Please update the issue with current status, unclear if it's still open/needed. label May 19, 2024
@milkmaker milkmaker closed this May 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
confirmed needs testing stale Please update the issue with current status, unclear if it's still open/needed.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants