ProtonMail / ProtonMail/libsieve-php
No To or Cc does not match
Nobody has claimed this yet.
- Dominant language
- PHP
- Stars
- 25
- Forks
- 9
- Avg merge
- 6m
- Merged PRs (30d)
- 3
Description
Hi,
The following expression
allof(
anyof(not exists "to", address :is "to" ""),
anyof(not exists "cc", address :is "cc" "")
)
does not seem to match messages containing no 'Cc' header and the following 'To'-header:
To: Undisclosed recipients:;
which I find strange as 'To' contains no valid address and 'Cc' does not exist.
I maybe just have taken for granted that address "whateverheader" would match the emtpy string if the header exists but contains no valid address ... but I've not been able to find out exactly what it is set to in your Sieve-implementation when the header exists and contains data without a valid address.
... I could do it differently I guess matching 'To' and 'Cc' addrs lacking an '@' e.g. ... but I still find the behaviour strange that the above expression does not match those e-mails!
Will test:
allof(
anyof(not exists "to", not address :contains "to" "@"),
anyof(not exists "cc", not address :contains "cc" "@")
)
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing issue #42 with the provided Sieve expression and the message headers, then read RFC5228's address-test semantics alongside the relevant implementation. Clarify the expected result for an existing To or Cc header with no valid address, and consider how that behavior can be covered by a regression test.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- php
- Domain
- backend
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 42/100