auanasgheps / snapraid-aio-script

The definitive all-in-one SnapRAID script on Linux. Diff, sync, scrub are things of the past. Manage SnapRAID and much, much more!
GNU General Public License v3.0
231 stars 37 forks source link

Send mail error. No such entry, file or director. #28

Closed nzlov closed 2 years ago

nzlov commented 2 years ago

OS

archlinux

test script

#!/bin/bash

body="asdasdasdasd"
echo $body
echo $(echo "$body" | sed '/^[[:space:]]*$/d; /^ -*$/d; s/$/  /')
echo $(echo "$body" | sed '/^[[:space:]]*$/d; /^ -*$/d; s/$/  /' | python -m markdown)
echo $(echo "$body" | sed '/^[[:space:]]*$/d; /^ -*$/d; s/$/  /' | python -m markdown | sed 's/<code>/<pre>/;s%</code>%</pre>%')

mailx -a 'Content-Type: text/html' -s "aaal" "me@nzlov.com" \
    < <(echo "$body" | sed '/^[[:space:]]*$/d; /^ -*$/d; s/$/  /' |
      python -m markdown |
      sed 's/<code>/<pre>/;s%</code>%</pre>%')

echo "$body" | sed '/^[[:space:]]*$/d; /^ -*$/d; s/$/  /' |
      python -m markdown |
      sed 's/<code>/<pre>/;s%</code>%</pre>%' |
      mailx -a 'Content-Type: text/html' -s "TTTT" "me@nzlov.com"

out:

asdasdasdasd
asdasdasdasd
<p>asdasdasdasd </p>
<p>asdasdasdasd </p>
mail: Failed to access attachment 'Content-Type: text/html': No such entry, file or directory
mail: Failed to access attachment 'Content-Type: text/html': No such entry, file or directory
nzlov commented 2 years ago

s-nail problem in archlinux. ok. I need archlinux verion of script.

auanasgheps commented 2 years ago

All good I hope!

Izumiko commented 2 years ago

@auanasgheps s-nail use -M for content type, while bsd-mailx use -a, should the script add an option for mail program provider?

auanasgheps commented 2 years ago

29 should cover your needs. You can specify an alternative to the main mail program and pass to it subject and mail body.