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

Wrong sieve script is applied when mail is delivered to multiple users #4878

Open
stbr4 opened this issue Apr 3, 2024 · 7 comments
Open
Assignees

Comments

@stbr4
Copy link

stbr4 commented Apr 3, 2024

I'm running Cyrus on Debian Bookworm. Cyrus version: 3.6.1-4+deb12u1 (I recently upgraded from version 3.2.6-2~bpo10+1)

  • A mail is deliverd via lmtp to users U1 U2 and U3
  • U1 has a sieve script which redirects to X
  • U2 has no sieve script
  • U3 has a sieve script which does something

It seems that U1's sieve script is also applied to U2 and U2 doesn't receive the email. U3 receives the mail, even if the script doesn't match.

@elliefm
Copy link
Contributor

elliefm commented Apr 4, 2024

Interesting. @ksmurchison, any thoughts? If this is something we've already fixed in later versions, I might be able to backport it, but I don't remember seeing anything along these lines. I think Fastmail's MTAs probably send one-mail-per-recipient to lmtpd so we don't see this sort of thing ourselves.

@stbr4 In the meantime, I think you should be able to work around this by configuring your MTA (i.e. postfix, sendmail, exim, etc) to always send one-mail-per-recipient to lmptd. I don't know how to do this for any particular MTA, but presumably your MTA's documentation will say.

@stbr4
Copy link
Author

stbr4 commented Apr 5, 2024

Thank you @elliefm!

We mitigated the problem for now by putting a dummy sieve script in every mailbox. I will look into configuring postfix to deliver mails one at a time.

@ksmurchison
Copy link
Contributor

I created #4882 to test this and it passes just fine against master. I also don't see any relevant changes between 3.6.1 and master, but maybe a second set of eyes will.

@stbr4
Copy link
Author

stbr4 commented Apr 5, 2024

Thank you for looking into it, @ksmurchison!

I will try to reproduce it next week. Maybe there is some weird misconfiguration in my setup. Can you suggest anything that i can try to find the cause of this problem?

@ksmurchison
Copy link
Contributor

Does this occur across all users or does it only occur if U1 is one of the recipients?

Are the bytecode scripts/directories for the users somehow linked in your sievedir?

@stbr4
Copy link
Author

stbr4 commented Apr 5, 2024

U1 has to be one of the recipients. The sieve scripts/bytecode/directories were definitely not linked before the Upgrade. The way sieve scripts are stored changed with this upgrade. I am fairly certain that i checked the directories when i was investigating this problem and didn't find anything unusual. Now there are sieve scripts for every user, so i cannot check now.

We noticed two times that mails went missing. Both times it was a mail with many recipients. Actually one recipient that is forwarded to many mailboxes (recipients are expanded by postfix), if that makes a difference.

Both times it happend like this:

  • A -> receives mail
  • B -> receives mail
  • C -> sieve redirect
  • D -> mail lost (i think the sieve script from C is applied)
  • E -> mail lost
  • ...
  • X -> some sieve script (doesn't have to match) -> mail deliverd
  • Y -> mail delivered
  • ...

@stbr4
Copy link
Author

stbr4 commented Apr 10, 2024

I was unable to reproduce this issue.

Attached are anonymized logs of postfix and cyrus from one time where mails were lost. User "bjoF1XbMOLghV7IUkF8ZuQ==" notified us that the mail was not delivered but there were probably more that did not get this mail.
There was definitely no sieve script for this user.

postfix.log.txt
cyrus.log.txt

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants