procmail
[Top] [All Lists]

help with formail

1996-05-18 05:30:59

i have been using this to export files:

:0 c:
* ^Subject: *send
AUTO-RQ

        :0 A:/usr/home/home3/pepsiman/public/$FILENAME$LOCKEXT
        |(formail -rA"X-Loop: pepsiman(_at_)escape(_dot_)com";\
        if test -f /usr/home/home3/pepsiman/public/$FILENAME ; \
        then if echo -n $FILENAME |egrep 'zip|Z|tgz|.gz' >/dev/null 2>&1 ; \
        then makemime $FILENAME ;\
        else cat /usr/home/home3/pepsiman/public/$FILENAME;\
        fi; \
        else echo "File not available in archive."; \
        echo "The following files are available."; \
        ls -l /usr/home/home3/pepsiman/public |sed -e /$FILENAME$LOCKEXT/d; \
        fi) | sendmail -oi -t


  I added checking for if the filename is a zip, gz, tgz, or Z type file
and it manages to MIME encode the file fine, it even sends it :)

  The problem is formail insists on outputing a NEWLINE after it's done 
with the mail header and the MIME headers the makemine shell script 
preappend are sent as part of the email body as a result of the newline.

   Here is a partial, but relevent part of the header sent
      notic the blank line before the MIME-Version:

To: gumbie(_at_)sunspot(_dot_)tiac(_dot_)net
Subject: Re: send allfiles.tar.gz
References: 
<Pine(_dot_)SUN(_dot_)3(_dot_)91(_dot_)960518082403(_dot_)15687A-100000(_at_)sunspot(_dot_)tiac(_dot_)net>
In-Reply-To: 
<Pine(_dot_)SUN(_dot_)3(_dot_)91(_dot_)960518082403(_dot_)15687A-100000(_at_)sunspot(_dot_)tiac(_dot_)net>
X-Loop: pepsiman(_at_)escape(_dot_)com

MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="Gumbie's-mime-script-6371"

This is a MIME message. Your mailer doesn't appear to understand MIME format.
You will need to read this message with a MIME mailer in order to appreciate


  /========================================================================\
  |    ("`-''-/").___..--''"`-._          Gumbie                           |
  |     `6_ 6  )   `-.  (     ).`-.__.`)  pepsiman(_at_)escape(_dot_)com        
      |
  |     (_Y_.)'  ._   )  `._ `. ``-..-'   http://www.escape.com/~pepsiman  |
  |   _..`--'_..-_/  /--'_.' ,'           
gumbie(_at_)sunspot(_dot_)tiac(_dot_)net          |
  |  (il).-''  (li).'  ((!.-'             http://www.tiac.net/users/gumbie |
   \======================================================================/


<Prev in Thread] Current Thread [Next in Thread>