Skip to content

Conversation

@missytake
Copy link
Contributor

@missytake missytake commented Oct 17, 2025

This seems to fix issues with slow delivery on nine.testrun.org :)

The problem was that filtermail's aiosmtpd dependency had problems with postfix passing parts of the incoming SMTP commands onwards to it; this caused a lot of asyncio back-and-forth. Now filtermail only gets a complete mail it can check in one go. Moving filtermail from async-based to thread-based processing might also help, maybe in rust, but is a lot more effort.

@missytake missytake requested a review from link2xt October 17, 2025 15:17
@missytake
Copy link
Contributor Author

Huh, cmdeploy/src/cmdeploy/tests/online/test_1_basic.py::test_exceed_rate_limit is failing.

feld added a commit to feld/chatmail-cookbook that referenced this pull request Oct 17, 2025
@link2xt
Copy link
Contributor

link2xt commented Oct 18, 2025

As far as I understand smtpd_proxy_options=speed_adjust did not actually help. I also don't see why it should help and why "aiosmtpd" should not be able to handle practically unlimited number of connections even if most of them get stuck waiting for actual data. Buffering the whole mail in postfix smtpd before passing it to filtermail will reduce the number of connections filtermail needs to handle at the same time, but if it is not a problem I'd rather not tweak the settings.

@link2xt
Copy link
Contributor

link2xt commented Oct 18, 2025

This change is also a likely cause of this error from the logs that appeared after deploying it:

postfix/smtps/smtpd[2219812]: proxy-reject: END-OF-MESSAGE: 451 4.3.0 Error: queue file write error

Without this change messages should not even be written into temporary queue. Writing messages to disk before passing them to filtermail is another step that may fail and does not speed up sending.

@link2xt
Copy link
Contributor

link2xt commented Oct 18, 2025

I opened an issue to track the problem this change is trying to solve: #675

reflect some sort of communication path or dependency relationship
between components of the chatmail server.

## Message between users on the same relay
Copy link
Contributor

Choose a reason for hiding this comment

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

This documentation change is better moved in a separate PR, then it can also be merged quickly.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I moved it to #678 :)

@missytake
Copy link
Contributor Author

This change is also a likely cause of this error from the logs that appeared after deploying it:

postfix/smtps/smtpd[2219812]: proxy-reject: END-OF-MESSAGE: 451 4.3.0 Error: queue file write error

Without this change messages should not even be written into temporary queue. Writing messages to disk before passing them to filtermail is another step that may fail and does not speed up sending.

No, that was caused by restarting filtermail service.

@missytake
Copy link
Contributor Author

Let's close this for now :) we can look at it again if #676 isn't sufficient for solving filtermail's performance issues.

@missytake missytake closed this Oct 19, 2025
outcome = e.recipients[user2.addr]
assert outcome[0] == 450
assert b"4.7.1: Too much mail from" in outcome[1]
assert e.smtp_code == 450
Copy link
Contributor

Choose a reason for hiding this comment

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

Test fixes can also be moved to a separate PR?

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

Successfully merging this pull request may close these issues.

4 participants