procmail
[Top] [All Lists]

Re: extracting attachments

2003-10-11 13:12:29
On Sat, 11 Oct 2003 23:39:18 +0900 Rob Nugen <rob(_at_)robnugen(_dot_)com> 
wrote:

http://info.ccone.at/INFO/Mail-Archives/procmail/Dec-2002/msg00245.html

Did you ever find a solution to this?

I'm interesting in doing the same thing.

        Thanks
        - Rob

Unfortunately, life intervened and as a low priority project I haven't
gotten back to what I was working on yet..

I do recall I was looking for something other than metamail to do the
extraction. Metamail was generating other fluff that was getting in the
way.

It might work for you if all you want is the attachment. I was trying to
extract the attachment, rename it using a date function, ftp it to a web
host, then generate a NEW message with links to the uploaded images.

Here's what I have sitting idle in my .procmailrc and $HOME/bin/ directory:

#HVWC PICTURE TEST
:0c:  #make a copy to play with
* ^To(_dot_)*hvwc(_dot_)pic(_at_)sysmatrix(_dot_)net
.HVWC.pic/

:0hcw #Dump a copy of the message headers to a temp file
|cat>/home/user/metatemp/headtext

#set a SHELL variable so we can reuse the FROM address on the new message
#we send I really have NO idea why I EXPORTed it.

export FROM=`formail -rt -xTo:`

# Everything following |metamail below is on a single line -- it's wrapped
# in this email. Note that the user processing these messages must be a
# TRUSTED USER in your SMTP daemon in order to use the FROM address of
# someone else(in this case creating a new message that is FROM the
# original SENDER. 
# You'll have to dig in 'man metamail' yourself to check the switches -- it
# appears I've removed it from my system already in preparation to try
# something different (mimedecode perhaps since I see I've installed it). 
# $HOME/bin/names is a script I wrote to rename the images and create a
# text file containing a list of URL's to them. It is at:
# http://www.phorce1.com/names (to avoid nasty wrapping here).

:0rw
* ^To(_dot_)*hvwc(_dot_)pic(_at_)sysmatrix(_dot_)net
|metamail -r -w -q -x;$HOME/bin/names;cat /home/user/metatemp/links
/home/user/metatemp/1-* | /usr/sbin/sendmail -oi -f $FROM 
 user(_at_)localhost,$FROM;rm -f /home/user/metatemp/*

--------------------------------------------------------------------------------------------

I'm posting this back to the list as well in case anyone else has played
with it since last December.

G
-- 
Gerald V. Livingston II

Configure your Email to send TEXT ONLY -- See the following page:
http://expita.com/nomime.html

'74 Kombi (to be renamed - LifeSaver doesn't 'feel' right)
'69 Type 1 - AirBall the Rolling Basket Case
http://www.phorce1.com
http://www.buskatiers.org


_______________________________________________
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>
  • Re: extracting attachments, Gerald V. Livingston II <=