Description
⚠️ This issue respects the following points: ⚠️
- This is a bug, not a question or a configuration/webserver/proxy issue.
- This issue is not already reported on Github OR Nextcloud Community Forum (I've searched it).
- Nextcloud Server is up to date. See Maintenance and Release Schedule for supported versions.
- I agree to follow Nextcloud's Code of Conduct.
Bug description
As you can from this issue in Symfony symfony/symfony#50875 seems like the mailer adds double dots if a dot is matched as first character of a line (this is the code)
https://github.com/symfony/symfony/blob/acd9e3b9922b2f6064dc8bd1f77c52f7ce48ec69/src/Symfony/Component/Mailer/Transport/SendmailTransport.php#L105-L107
If you add the -i
in the pipe
(like this 'pipe' => ' -t -i'
)
server/lib/private/Mail/Mailer.php
Lines 333 to 336 in 767c42f
This fixes the issue.
Symphony community is still trying to understand if this is a bug or not, but still this seems a solution.
What do you think? Can I do a PR for this?
This will resolve these issues too: #33754 and #16379
Steps to reproduce
- replace the sendmail binary with the postfix one (I don't know if this is required but I use this one) but stop all postfix daemons (or just run it in a container with a super dummy spool folder)
mkdir -p /var/spool/postfix/maildrop
chmod ugo+rwx /var/spool/postfix /var/spool/postfix/maildrop
- set the
mail_sendmailmode
topipe
- create many users with different string length (for example user1, user12, user123, user1234)
# create random users
export OC_PASS=Epi1cP4ssword
for i in {1..20}; do php occ user:add user$(python3 -c "print('1'*$i)") --password-from-env; done
# set the email
for i in {1..20}; do USERNAME=user$(python3 -c "print('1'*$i)"); php occ user:setting "$USERNAME" settings email "${USERNAME}.${USERNAME}@example.com"; done
- generate some emails (for example I send all the Welcome emails with the reset password link)
- check if there are duplicated dots in the postfix spool (grep random things that could appear in your Nextcloud url)
cd /var/spool/postfix/maildrop
postcat -bh * | grep lostpass -C2
- you will definitely find at least one user with a broken link
Imposta la tua password: https://mydrive.example.com/index=
..php/lostpassword/reset/form/3GOnnGyVaEBzs2JmuYXCU/utente123456
Expected behavior
Dots should not be doubled in emails
Installation method
Community Docker image
Nextcloud Server version
26
Operating system
Debian/Ubuntu
PHP engine version
PHP 8.1
Web server
Apache (supported)
Database engine version
MySQL
Is this bug present after an update or on a fresh install?
None
Are you using the Nextcloud Server Encryption module?
Encryption is Disabled
What user-backends are you using?
- Default user-backend (database)
- LDAP/ Active Directory
- SSO - SAML
- Other
Configuration report
{
"system": {
[...]
"mail_smtpmode": "sendmail",
"mail_sendmailmode": "pipe",
[...]
}
}
List of activated Apps
No response
Nextcloud Signing status
No response
Nextcloud Logs
No response
Additional info
No response