Digital Marketing

How to fix mailx sends text body as an attachment

Due to non-US-ASCII or non-printable characters, when mailx processes the input, it correctly sets the MIME type to application/octet-stream when non-US-ASCII or non-printable characters are present.

Non-Unix text files that use carriage return (^M, \r) characters in addition will be treated as binary data; to send such files as text, strip these characters e. g. by


my-script.sh | tr -d '[\015\200-\377]' | mailx -s "my mail" ...


Comments

Popular posts from this blog

Fixed WSL sshd: no hostkeys available -- exiting

PowerMTA pmta command

How to fix: mv: failed to preserve ownership