Answer the question
In order to leave comments, you need to log in
Why do emails sent via cron come as attachments?
Here's a script:
#!/bin/bash
echo "$(df -h) \n $(tail /var/log/php.mail.log) \n $(exim -bpc)" | mail -s "at02.ru server" [email protected]
SHELL=/bin/bash
PATH=/sbin:/bin:/usr/sbin:/usr/bin
MAILTO=root
HOME=/
*/60 * * * * root /root/mail-about-space.sh
uname -a
Linux at02.ru 2.6.32-042stab102.9 #1 SMP Fri Dec 19 20:34:40 MSK 2014 i686 i686 i386 GNU/Linux
Answer the question
In order to leave comments, you need to log in
And you look at them through "show original". Surely when the script is run from cron you receive Russian letters or something else non-ASCII, so mail sets them
Content-Type: application/octet-stream
Content-Transfer-Encoding: 8bit
What to do? -- set the language in the default environment, or explicitly do some kind of export LANG=C in the process of running the script.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question