procmail
[Top] [All Lists]

Re: rule vbs,exe -> folder

2001-02-23 12:28:08


On 23 Feb, Micke Hamstrom wrote:

Hi again!
That worked find! Thank you,,,,

But when one thing works out then next question pops up  :-)

1. Is there a way to make metamail(formail) to rip of the header to. In
my folder I only get the text from the mail and the attached document
separated? And it could be nice to see from whom it orignally was
sended..

2. Then this to: Is this possible?? When I mail arrives and get splited
up how to make a message leave for the reciver telling "A mail with 
attachments have arrived. Take contact with.."

You can rip that header with the arg. -q, that makes metamail go *quiet*
(man metamail). But you will still have some output concerning the
decoding, I believe.

My suggestion then:

:0 
 # the condition(s) you used previously
* again, whatever condition you need for those attachments
 # new one, safety, elegance
*!^X-Loop: user(_at_)your(_dot_)site(_dot_)there
{
   # extract info concerning the message/sender, to use later
    FROM_=`$FORMAIL -rtzxTo:`
    SUBJ_=`$FORMAIL -zxSubject:`
    TO_=`$FORMAIL -zxTo:`

    METAMAIL_TMPDIR=some/directory/destination
   # you must set this, otherwise the files will go to /tmp
   # note that I discard all output of metamail...
    :0 fw
    |metamail -q -x -w > /dev/null


   # start a message/note to send yourself/user
    :0 fhw
    | (formail -r -A"X-Loop: user(_at_)your(_dot_)site(_dot_)there" \
         -I"Precedence: junk" \
         -I"From: $FROM_" \
         -I"To: user(_at_)your(_dot_)site(_dot_)there" \
         -I"Subject: $SUBJ_" ; \
         echo "" ; \
         echo "Whatever you want to say goes here." ; \
         echo "Things like this: From: $FROM_" ; \
         echo "Attachments saved in $METAMAIL_TMPDIR" ; \
         echo "" ) \
       | $SENDMAIL $SENDMAILFLAGS -t 
}


Ok, as you see I made some changes and I can tell you I didn't test them
thouroughly. Can't garantee it works as you want, but it should be a good
start.

--Rui


_______________________________________________
procmail mailing list
procmail(_at_)lists(_dot_)RWTH-Aachen(_dot_)DE
http://MailMan.RWTH-Aachen.DE/mailman/listinfo/procmail

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