nextcloud / nextcloud/mail

Sieve script - Filters not applying properly

Open
#11,593 1 comment 1 reaction 1 assignee View on GitHub

@kesselb is already working on this.

Since Aug 30, 2025.

1. to develop bug
Dominant language
JavaScript
Stars
1k
Forks
348
Avg merge
12h 28m
Merged PRs (30d)
91

Description

Steps to reproduce
  1. Go into mail (Mail 5.3.1)
  2. Click on mail settings
  3. Go to filters
  4. Create a new filter
  5. Add condition : "sender" "contains" "test.com"
  6. Add action : "File into" "junk"
  7. Save filter

Result:
Image


Check the sieve script editor and it will not have all the correct values
### Nextcloud Mail: Filters ### DON'T EDIT ###
# FILTER: [{"name":"New filter","enable":true,"operator":"allof","tests":[{"operator":"contains","values":[],"field":"from"}],"actions":[{"type":"fileinto","mailbox":"Junk"}],"priority":10}]
# New filter
if address :contains :all "From" [""] {
	fileinto "Junk";
}
### Nextcloud Mail: Filters ### DON'T EDIT ###

This will effectivly move all mails into Junk

Expected behavior

The filter is properly created

Actual behavior

Check the sieve script editor and it will not have all the correct values

Nextcloud Mail: Filters ### DON'T EDIT

FILTER: [{"name":"New filter","enable":true,"operator":"allof","tests":[{"operator":"contains","values":[],"field":"from"}],"actions":[{"type":"fileinto","mailbox":"Junk"}],"priority":10}]

New filter

if address :contains :all "From" [""] {
fileinto "Junk";
}

Nextcloud Mail: Filters ### DON'T EDIT


### Mail app version

5.3.1

### Nextcloud version

31.0.8

### Mailserver or service

docker mail server

### Operating system

debian - coker

### PHP engine version

PHP 8.3

### Nextcloud memory caching

_No response_

### Web server

None

### Database

None

### Additional info

_No response_

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.