LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 08-19-2009, 01:31 AM   #1
jlieben
LQ Newbie
 
Registered: Aug 2009
Location: Netherlands
Distribution: Ubuntu, Redhat, Centos, Oracle Linux
Posts: 3

Rep: Reputation: 0
shell mail is sending only attachments


I made a shell-script for updateing antivirus.
At the end of the script the log file is send by mail.

why is it send as attachment and not as text??

the logfile is written as index.php for use on a monitoring page.
the command I use:
cat /srv/web/netwerk/update/index.php | mail -s "AV updates" email@domain.com

How can I solve this??
 
Old 08-19-2009, 01:48 AM   #2
micxz
Senior Member
 
Registered: Sep 2002
Location: CA
Distribution: openSuSE, Cent OS, Slackware
Posts: 1,131

Rep: Reputation: 75
The contents of "index.php" are not in the body of your email? It should only add attachments with the -a flag.
You do realize that index.php is not getting executed it's just the source that should be sent.
 
Old 08-19-2009, 01:50 AM   #3
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Rocky 9.2
Posts: 18,359

Rep: Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751
mail systems can be funny, try this other syntax http://onlamp.com/linux/cmd/cmd.csp?path=m/mail and/or try mailx instead of mail.
Good luck.
 
Old 08-21-2009, 02:44 AM   #4
jlieben
LQ Newbie
 
Registered: Aug 2009
Location: Netherlands
Distribution: Ubuntu, Redhat, Centos, Oracle Linux
Posts: 3

Original Poster
Rep: Reputation: 0
Thanx all, the -a option made it complete.
Now the file is send as attachment and in readable format.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
sending mail with bulk attachments onyangoliech Linux - Networking 1 12-04-2006 06:15 AM
Sending mail attachments in OpenOffice.org mikieboy Linux - Software 2 06-14-2006 06:12 PM
Sending mail from shell with attached file loopoo Linux - General 3 11-17-2005 10:57 AM
Shell script sending mail mfrick Linux - General 5 09-01-2005 07:46 PM
sending mail using shell meshmesh Linux - Software 1 01-25-2004 07:25 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 12:24 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration