thsmi / sieve

Sieve Script Editor
GNU Affero General Public License v3.0
729 stars 56 forks source link

[app] add an option to use unix line breaks on sieve save #899

Closed brevilo closed 9 months ago

brevilo commented 9 months ago

Prerequisites

Is your feature request related to a problem?

The editor seems to use the Windows line break format CRLF, even on macOS. Given that (most) mail servers presumably run on Linux, the sieve filter should be saved/exported using Linux line breaks, so LF only, to not cause incompatibilities on the server due to the trailing CR at the end of each line.

Describe the solution you'd like

Add an option to save/export with Linux line break LF. Should probably be a server-specific option.

Describe alternatives you've considered

Right now I'm manually running dos2unix on the mail server after I saved the filter in order to "fix" the file format.

Thanks, and keep it up! Great work 🚀

thsmi commented 9 months ago

This question pops up every not an then thus you find more details in the FAQ section: https://github.com/thsmi/sieve/wiki/FAQ---Sieve

The short answer is :

Sieve is specified that script never contains single CR or LF. And in case it contains a single CR or LF the server has to reject the script, editors are not allowed to create script containing single line breaks. Any automatic line-break conversion is not permitted.

So there is no point adding an option to export something in an non standard and invalid format.

In case you need to do any kind of dos2unix conversion, then your server is non standard compliant and incorrectly configured.

CRLF is not the "Windows line break" format, it is the one which was used on IBM and DEC machines. And thus it is used by almost all network protocols. Windows grant grant grant ancestors is IBM DOS, it used CRLF and thus windows does. The native linebreak format for MacOS is historically a CR not an LF.

brevilo commented 9 months ago

Sieve is specified that script never contains single CR or LF. And in case it contains a single CR or LF the server has to reject the script, editors are not allowed to create script containing single line breaks. Any automatic line-break conversion is not permitted.

Thanks for the details, incl. the RFC reference. 👏

(Sorry I missed the FAQ entry. I did search the issues, though)