You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
PROBLEM: If sending large emails (i.e. with attachments), and the server is under load, such as doing bulk emailing, ssmtp can corrupt the files.
When the system is under load, because of the way php's fwrite works, streaming input into the ssmtp has many more chunks, which increases the likelyhood of the input breaking at a point that causes ssmtp to corrupt the file. Unfortunately the behaviour can be quite intermittent.
A workaround I found was to use the sponge command.
Thank you for reporting this, this does sound plausible, but were you able to consistently reproduce that this actually fixes the issue? We should come up with some simple local test that demonstrates the issue before introducing new changes
By default, mail is sent via ssmtp:
PHP_SENDMAIL_PATH: '"/usr/bin/dos2unix -u | /usr/sbin/ssmtp -t -f"'
PROBLEM: If sending large emails (i.e. with attachments), and the server is under load, such as doing bulk emailing, ssmtp can corrupt the files.
When the system is under load, because of the way php's fwrite works, streaming input into the ssmtp has many more chunks, which increases the likelyhood of the input breaking at a point that causes ssmtp to corrupt the file. Unfortunately the behaviour can be quite intermittent.
A workaround I found was to use the sponge command.
PHP_SENDMAIL_PATH: '"/usr/bin/dos2unix -u | sponge | /usr/sbin/ssmtp -t -f"'
Sponge will "soak up" the input before passing to ssmtp in one go.
sponge is available from the moreutils library, which is not installed in the container by default.
The text was updated successfully, but these errors were encountered: