Tom's Guide | Tom's Hardware | Tom's Games
![]() |
![]() |
![]() |
Hi all. Just started using this ver of Slackware and have problem with using mailto in a shell script (used mail in the past and it worked fine). If I have any blank lines in the message it arrives in Outlook on my PC as an attachment ! If I put a # where the blank line would be (in the shell script) it arrives and the message shows in the email body/preview window. Below is the section of script. Any help/guidance/criticism will be appreciated.
... the section of script....
cat << END | $MAILPROG $NOTIFY -s "Warning: $account's Disk usage $usage on $SHORTNAME " > /dev/null
#
#*** $account's disk usage is ${usage}MB. ***
#
The server automatically examines the amount of disk space used by each user account and reports on each user found to have more than 50Mb of files/folders.
#
If this account is for a trainee please ensure that they are only storing training related files !
#
The system will also calculate files/folders "owned" by members of staff.
#
These may show as being over 50Mb due to "ownership" of files in the "Masters" and "Local Transfer" folders.
#
Mike
support@**********.co.uk
http://172.16.15.9
END

Don't use it then: mailto sends as text/richtext if you put empty lines in the message. This is not the same as MS rtf and maybe Outlook doesn't understand it.
The fact that '#'s appear as-is in a "here document" in a script is a feature, not a bug ;-)
Use BSD mail or the GNU enhanced version from mailutils and BTW, there is no need to use cat in the script:
mail_command arg1 arg2 ... <<END
...
...
END

Many thanks Wolfbone,
The installation CD I'm using has been "tweaked" by our main IT dept so it uses the new Mailto command. I'll need to hack into it and switch back to Mail. As you say, it's an rtf thing ! I don't have the same problem if I use Outlook Express.
As for the cat command... the script is largely based on one of Dave Taylor's "Wicked Cool Shell Scripts" and as I'm a complete novice with scripts (& Linux) I've only altered the bits necessary to make it produce my desired output :-)

![]() |
Recommend Linux distro fo...
|
CLI in Mandrake?
|

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.
| Ads by Google |