procmail
[Top] [All Lists]

Re: Cat a file to sendmail

2009-11-16 02:36:43
On Sun, 2009-11-15 at 21:31 -0800, Bart Schaefer wrote:

On Sun, Nov 15, 2009 at 8:00 PM, LuKreme <kremels(_at_)kreme(_dot_)com> 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.

(What's up with the "o" in "-io"?  My sendmail doc doesn't show a
useful semantic for it.)

You've got the i and the o in the wrong order.
It's supposed to be -oi which means set "option ignore dots".  ... From
the man page: "Ignore dots alone on lines by themselves in incoming
messages. This should be set if you are reading data from a file."
It is also referenced in the "Sendmail Installation and Operation Guide"
-> http://freenet-homepage.de/slgig/op_en/options.html


Not directly the cause of your problem, but if you're piping to
sendmail, you should supply a relatively complete message header with
From/To/Date/Subject.  You're also responsible for providing the blank
line between the header and the body, which I think is the direct
cause of your problem.

Check to see if you have the "mail" command?  It may work better for you to 
use

|mail -s "Alert" $MYAD < $MYFILE

If you must use sendmail, try it like this:

|(echo "From: $MYAD";\
  echo "To: $MYAD";\
  echo "Date: `date -R`";\
  echo "Subject: Alert";\
  echo "";\
  cat $MYFILE) | /usr/bin/sendmail -i $MYAD

____________________________________________________________
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

-- 
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>