Skip to content

feat: do not autoreply to noreply@ and no-reply@ senders - #13467

Merged
ChristophWurst merged 1 commit into
nextcloud:mainfrom
madbob:issue_11600
Aug 19, 2026
Merged

feat: do not autoreply to noreply@ and no-reply@ senders#13467
ChristophWurst merged 1 commit into
nextcloud:mainfrom
madbob:issue_11600

Conversation

@madbob

@madbob madbob commented Aug 11, 2026

Copy link
Copy Markdown
Collaborator

Do not autoreply to noreply@ and no-reply@ senders.

Fixes #11600

🤖 AI (if applicable)

  • The content of this PR was partly or fully generated using AI

I've asked an advice to Gemini about Sieve syntax.

Summary by CodeRabbit

  • Bug Fixes
    • Improved automatic-mail detection by excluding messages sent from addresses matching noreply@* or no-reply@*.
    • Continued support for identifying list messages through List-Id and List-Unsubscribe headers.

@ChristophWurst

Copy link
Copy Markdown
Member

Thanks for the fix!

@ChristophWurst ChristophWurst left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Makes sense!
Did not test

@ChristophWurst

Copy link
Copy Markdown
Member

@coderabbitai review the changes and double-check the Sieve syntax validity

@ChristophWurst ChristophWurst self-assigned this Aug 19, 2026
@coderabbitai

coderabbitai Bot commented Aug 19, 2026

Copy link
Copy Markdown
🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

printf '%s\n' '--- PR metadata ---'
gh pr view 13467 --repo nextcloud/mail --json title,baseRefName,headRefName,files

printf '%s\n' '--- Changed diff ---'
gh pr diff 13467 --repo nextcloud/mail --patch

printf '%s\n' '--- Sieve-related files ---'
fd -t f . | rg -i 'sieve|autorepl|vacation'

printf '%s\n' '--- Sieve references, excluding generated/dependency paths ---'
rg -n -i -C 3 'sieve|autoreply|auto.?reply|vacation|noreply|no-reply' \
  -g '!node_modules/**' -g '!vendor/**' -g '!dist/**' -g '!build/**' .

Length of output: 198664


🏁 Script executed:

#!/bin/bash
set -euo pipefail

printf '%s\n' '--- PR metadata and changed files ---'
gh pr view 13467 --repo nextcloud/mail --json files --jq '.files[] | "\(.path) (+\(.additions) -\(.deletions))"'

printf '%s\n' '--- Exact PR patch ---'
gh pr diff 13467 --repo nextcloud/mail --patch -- \
  lib/Service/OutOfOffice/OutOfOfficeParser.php \
  tests/Unit/Service/OutOfOffice/OutOfOfficeParserTest.php \
  tests/data/sieve-vacation-on.sieve \
  tests/data/sieve-vacation-on-no-end-date.sieve \
  tests/data/sieve-vacation-on-subject-placeholder.sieve \
  tests/data/sieve-vacation-on-special-chars-message.sieve \
  tests/data/sieve-vacation-on-special-chars-subject.sieve

printf '%s\n' '--- Generator ---'
sed -n '80,195p' lib/Service/OutOfOffice/OutOfOfficeParser.php

printf '%s\n' '--- Out-of-office fixtures that contain the new condition ---'
rg -n -i -C 8 'noreply@|no-reply@|automaticMailCondition|vacation' tests/data -g '*.sieve'

printf '%s\n' '--- Existing syntax pattern used by the filter builder ---'
sed -n '35,65p' lib/Service/MailFilter/FilterBuilder.php

Length of output: 1530


🏁 Script executed:

#!/bin/bash
set -euo pipefail

printf '%s\n' '--- Complete PR patch ---'
gh pr diff 13467 --repo nextcloud/mail --patch

printf '%s\n' '--- Changed source with line numbers ---'
nl -ba lib/Service/OutOfOffice/OutOfOfficeParser.php | sed -n '115,185p'

printf '%s\n' '--- Relevant test coverage ---'
nl -ba tests/Unit/Service/OutOfOffice/OutOfOfficeParserTest.php | sed -n '75,185p'

Length of output: 1981


🤖 web_search executed:

RFC 5228 Sieve address test syntax :all :matches header-list key-list

Length of output: 14653


@ChristophWurst I found one issue.

  • OutOfOfficeParserTest compares generated scripts with the tests/data/sieve-vacation-*.sieve fixtures. This PR changes the generated script but does not update these fixtures. The existing exact-output tests will fail. Update each enabled-responder fixture to include the new address condition. Add a focused regression case for both sender patterns if possible.

The Sieve syntax is valid. RFC 5228 defines the form:

address [COMPARATOR] [ADDRESS-PART] [MATCH-TYPE] <header-list> <key-list>

The generated expression uses valid :all and :matches arguments. From and Sender are supported structured address headers. The * wildcard matches the remaining domain part, so the condition matches noreply@… and no-reply@… addresses as intended. RFC 5228

✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@coderabbitai

coderabbitai Bot commented Aug 19, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

The out-of-office parser now excludes messages with From or Sender values matching noreply@* or no-reply@*, in addition to messages identified by List-Id or List-Unsubscribe.

Changes

Automatic-mail filtering

Layer / File(s) Summary
Expand automatic-mail detection
lib/Service/OutOfOffice/OutOfOfficeParser.php
The generated Sieve anyof(...) condition now matches List-Id, List-Unsubscribe, and common no-reply sender addresses.

Estimated code review effort: 2 (Simple) | ~10 minutes

Merge Risk: 🟡 Moderate · up to fd56c

The PR changes autoreply filtering, but the existing Sieve fixture does not match the new output and focused tests for the affected sender headers are missing. Merge should wait until the fixture and coverage are updated.

Suggested reviewers: kesselb, christophwurst, gretad

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes the added exclusions for noreply@ and no-reply@ senders.
Linked Issues check ✅ Passed The change implements the directly linked issue objective by excluding noreply@ and no-reply@ senders from automatic replies [#11600].
Out of Scope Changes check ✅ Passed The parser change is limited to the linked issue objective and does not introduce unrelated functionality.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing Touches 💡 1
🛠️ Fix failing CI checks 💡
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1


ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: f6107c9f-1971-4f59-a3cd-157435f38237

📥 Commits

Reviewing files that changed from the base of the PR and between 1968041 and fd56cc7.

📒 Files selected for processing (1)
  • lib/Service/OutOfOffice/OutOfOfficeParser.php

Included review availability: Your plan provides up to 4 included reviews per hour; 3 remain after this review.

Comment on lines +123 to +129
$skipConditions = [
'exists "List-Id"',
'exists "List-Unsubscribe"',
'address :all :matches ["From", "Sender"] ["noreply@*", "no-reply@*"]',
];

$automaticMailCondition = 'anyof(' . join(', ', $skipConditions) . ')';

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🗄️ Data Integrity & Integration | 🟠 Major | ⚡ Quick win

Update the enabled-responder fixture before merging.

The new condition changes the complete Sieve output. tests/Unit/Service/OutOfOffice/OutOfOfficeParserTest.php still compares that output with tests/data/sieve-vacation-on.sieve, which does not contain the new address condition. Update the fixture and add focused coverage for both noreply@* and no-reply@* in the From and Sender headers.

@ChristophWurst

Copy link
Copy Markdown
Member

Updating the branch for a full CI run

@ChristophWurst

Copy link
Copy Markdown
Member

The AI rabbit is right, tests need adjustment :)

Signed-off-by: Roberto Guido <info@madbob.org>
@ChristophWurst
ChristophWurst merged commit b50cea4 into nextcloud:main Aug 19, 2026
44 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Autoresponder responds to no reply emails

2 participants