Skip to content

Do not alter line endings in `sieveshell` and delete temporary file

This MR contains two fixes for sieveshell:

  • When a Sieve script is edited through sieveshell, it stores the script in a temporary file. On a successful upload to the server the temporary file is currently not deleted, which is added in this MR. (the current behavior might actually be a feature for e.g. debugging, please tell me if it is).
  • When writing the script to this temporary file python's 'universal newlines mode' is enabled by default. It will convert CRLF line endings to LF on Linux. I think CRLF should be preserved and might be useful when e.g. specifying the message body of a vacation statement. (Actually RFC2822 requires CRLF in email messages, however the mailserver I used for testing seems to convert LF to CRLF in automatic reply messages.) For me this is important because I have automatically generated scripts that can contain CRLFs and 'viewing' those scripts with sieveshell (edit <scriptname>) would convert the line endings and therefore modify the scripts.

It would be great if you could take a look at this MR. Any comments/change requests/... welcome. If you would prefer two separate MRs please tell me.

Edited by Thomas Erbesdobler

Merge request reports