nextcloud / nextcloud/mail

Sieve script is missing newline after using OOO autoresponder

Open
#11,795 0 comments 0 reactions 1 assignee View on GitHub

@kesselb is already working on this.

Since Oct 7, 2025.

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

Description

Steps to reproduce
  1. Use OOO feature
  2. Manually edit Sieve script in Account settings
  3. Try to save
Expected behavior

The script saves

Actual behavior

The script doesn't save with error similar to:

{"reqId":"4RyhYilSeOwxigXG9HQX","level":3,"time":"2025-10-05T22:00:05+00:00","remoteAddr":"","user":"--","app":"mail","method":"","url":"--","message":"Failed to apply out-of-office sieve script: nextcloud: line 125: warning: no newline (CRLF) at end of hash comment at end of file. nextcloud: line 24: error: unknown tagged argument ':regex' for the header test (reported only once at first occurrence). nextcloud: line 27: error: unknown command 'addflag' (only reported once at first occurrence). nextcloud: error: validation failed.","userAgent":"--","version":"32.0.0.13","exception":{"Exception":"Horde\\ManageSieve\\Exception","Message":"nextcloud: line 125: warning: no newline (CRLF) at end of hash comment at end of file. nextcloud: line 24: error: unknown tagged argument ':regex' for the header test (reported only once at first occurrence). nextcloud: line 27: error: unknown command 'addflag' (only reported once at first occurrence). nextcloud: error: validation failed.","Code":3,"Trace":[{"file":"/opt/nextcloud/apps/mail/vendor/nextcloud/horde-managesieve/lib/Horde/ManageSieve.php","line":825,"function":"_doCmd","class":"Horde\\ManageSieve","type":"->"},{"file":"/opt/nextcloud/apps/mail/vendor/nextcloud/horde-managesieve/lib/Horde/ManageSieve.php","line":463,"function":"_cmdPutScript","class":"Horde\\ManageSieve","type":"->"},{"file":"/opt/nextcloud/apps/mail/lib/Service/SieveService.php","line":56,"function":"installScript","class":"Horde\\ManageSieve","type":"->"},{"file":"/opt/nextcloud/apps/mail/lib/Service/OutOfOfficeService.php","line":68,"function":"updateActiveScript","class":"OCA\\Mail\\Service\\SieveService","type":"->","args":["*** sensitive parameters replaced ***"]},{"file":"/opt/nextcloud/apps/mail/lib/Listener/OutOfOfficeListener.php","line":77,"function":"update","class":"OCA\\Mail\\Service\\OutOfOfficeService","type":"->","args":["*** sensitive parameters replaced ***"]},{"file":"/opt/nextcloud/lib/private/EventDispatcher/ServiceEventListener.php","line":57,"function":"handle","class":"OCA\\Mail\\Listener\\OutOfOfficeListener","type":"->"},{"file":"/opt/nextcloud/3rdparty/symfony/event-dispatcher/EventDispatcher.php","line":220,"function":"__invoke","class":"OC\\EventDispatcher\\ServiceEventListener","type":"->"},{"file":"/opt/nextcloud/3rdparty/symfony/event-dispatcher/EventDispatcher.php","line":56,"function":"callListeners","class":"Symfony\\Component\\EventDispatcher\\EventDispatcher","type":"->"},{"file":"/opt/nextcloud/lib/private/EventDispatcher/EventDispatcher.php","line":67,"function":"dispatch","class":"Symfony\\Component\\EventDispatcher\\EventDispatcher","type":"->"},{"file":"/opt/nextcloud/lib/private/EventDispatcher/EventDispatcher.php","line":79,"function":"dispatch","class":"OC\\EventDispatcher\\EventDispatcher","type":"->"},{"file":"/opt/nextcloud/apps/dav/lib/BackgroundJob/OutOfOfficeEventDispatcherJob.php","line":66,"function":"dispatchTyped","class":"OC\\EventDispatcher\\EventDispatcher","type":"->"},{"file":"/opt/nextcloud/lib/public/BackgroundJob/Job.php","line":61,"function":"run","class":"OCA\\DAV\\BackgroundJob\\OutOfOfficeEventDispatcherJob","type":"->"},{"file":"/opt/nextcloud/lib/public/BackgroundJob/QueuedJob.php","line":43,"function":"start","class":"OCP\\BackgroundJob\\Job","type":"->"},{"file":"/opt/nextcloud/lib/public/BackgroundJob/QueuedJob.php","line":29,"function":"start","class":"OCP\\BackgroundJob\\QueuedJob","type":"->"},{"file":"/opt/nextcloud/cron.php","line":175,"function":"execute","class":"OCP\\BackgroundJob\\QueuedJob","type":"->"}],"File":"/opt/nextcloud/apps/mail/vendor/nextcloud/horde-managesieve/lib/Horde/ManageSieve.php","Line":1000,"message":"Failed to apply out-of-office sieve script: nextcloud: line 125: warning: no newline (CRLF) at end of hash comment at end of file. nextcloud: line 24: error: unknown tagged argument ':regex' for the header test (reported only once at first occurrence). nextcloud: line 27: error: unknown command 'addflag' (only reported once at first occurrence). nextcloud: error: validation failed.","exception":{"details":null,"logged":false},"userId":"xxx","accountId":xxx,"CustomMessage":"Failed to apply out-of-office sieve script: nextcloud: line 125: warning: no newline (CRLF) at end of hash comment at end of file. nextcloud: line 24: error: unknown tagged argument ':regex' for the header test (reported only once at first occurrence). nextcloud: line 27: error: unknown command 'addflag' (only reported once at first occurrence). nextcloud: error: validation failed."}}

Couldn't reproduce after adding a newline manually and deleting it again, so it's likely the newline encoding, not the actual newline

Mail app version

c.nc

Nextcloud version

32.0.0

Mailserver or service

c.nc

Operating system

No response

PHP engine version

None

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.