Firstly my great thanks to Steffen and any/all others involved in writing and maintaining s-nail. I have used it for many years for sending mails but this is my first post here. It is a lifesaver for me because of its support for mailing attachments and for the -t option.

One small issue I have with it (which may well be because of my lack of understanding) is that when used with -t, it does not seem to work correctly with a source file with lines terminating with CR+LF (Windows-style).

Example (environment: bash on Linux [Ubuntu 20.04]):

1. Send e-mail with CR+LF line-endings using sendmail (postfix v3.4.13) (outcome perfect):

# echo -e "To: Jeremy Fisher <$(id -un)@localhost>\nSubject: Testing $(date +"%F %T")\n\nTesting"|sed 's/$/\r/'|sendmail -t

2. Send same with s-nail v14.9.15, 2019-08-17 (built for Linux):

# echo -e "To: Jeremy Fisher <$(id -un)@localhost>\nSubject: Testing $(date +"%F %T")\n\nTesting"|sed 's/$/\r/'|s-nail -t
s-nail: Not a header line, skipping: $'Testing\r'

- we get the above warning message and, worse, the email appears at the other end with bad format 'To:' header:

To: "Jeremy Fisher =?us-ascii?B?DSI=?= <user@localhost>"@mydomain.tld

3. If we send the same email via s-nail with LF line endings instead of CR+LF (i.e. remove the sed command from the above example) there is no warning and it appears perfect at the other end.

Am I doing something wrong? I realise that CR+LF line endings are not 'normal' in Linux environment but I think that s-nail should handle them perfectly, seamlessly and silently (like postfix's sendmail).

My workaround is to remove CRs from header lines and the succeeding blank line before passing source file to s-nail, but this is ugly.

Reply via email to