procmail
[Top] [All Lists]

Re: Cat a file to sendmail

2009-11-15 23:44:25
I think what you want is probably more like this:

        :0 i
        | /bin/echo -ne "Subject: Alert\n\n$(<$MYFILE)\n" | send.......

On Sun, 2009-11-15 at 22:29 -0600, JW Simpson wrote:
You are losing your carriage returns because you aren't putting
double-quote marks arround $MYFILE.
The same was true in your previous post.

On Sun, 2009-11-15 at 21:00 -0700, LuKreme wrote: 
I tried the following:
   :0
   |(echo "Subject: Alert"; \
   cat $MYFILE)|/usr/sbin/sendmail -io  $MYAD

But this put the contents of $MYFILE into the subject.

I tried
  :0
   |(echo "Subject: Alert"; \
   echo `cat $MYFILE`)|/usr/sbin/sendmail -io $MYAD

This worked, but instead of getting the file as formatted, I got it as a 
single line email.

that is, this file

 $ cat /tmp/summary
       1 .applescript-users.2009-11
       3 .httpd-users.2009-11
       1 .php-general.2009-10
       1 .postfix-users.2009-11
       6 total

arrived as

1 .applescript-users.2009-11 3 .httpd-users.2009-11 1 .php-general.2009-10 
1 .postfix-users.2009-11 6 total



-- 
JW Simpson <john(_at_)swajime(_dot_)com>
SwaJime's Cove℠
-- 
JW Simpson <john(_at_)swajime(_dot_)com>
SwaJime's Cove℠

____________________________________________________________
procmail mailing list   Procmail homepage: http://www.procmail.org/
procmail(_at_)lists(_dot_)RWTH-Aachen(_dot_)de
http://mailman.rwth-aachen.de/mailman/listinfo/procmail
<Prev in Thread] Current Thread [Next in Thread>