[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

[OT] Procmail/metamail assistance



OK, my eyes are burning from googling and reading man pages. I'd like to
do the following:

When a message comes in with an image attachment I would like that image
saved to a file in a specific directory. I would also like any message
body text saved to a file, and the original sender's name to another
file.

I've been playing with metamail for saving the pieces but I can't figure
out how to save all the parts but I can't figure out how to make it not
require user input.

So far I can get the files saved to the current directory with the
filenames encoded in the mime parts. The body wants to go to a file in
/tmp by default but the binary attachments are saved with the encoded
filenames to the CWD.

What I'm trying to do is let friends/family with no web space (or who
are too computer illiterate to put an image on the web) send me images
as attachments. I will have a specific email address set up for this so
procmail will process ALL messages to that address as if the contain
image attachments. When the message arrives I want all the parts listed
above saved to a specific directory. I will then run a bash script over
them to rename the image files to
"sender_name_mmddyyyy_hhmmss.[jpg|gif]". The senders will be informed
that .bmp files will be deleted, they can download irfanview for
Winboxen and save as .jpg because I don't feel like adding convert to
the mix.

Once the renaming is done the script will ftp the files to a specified
web directory and create an email back to the originator and/or other
specified address with links to the pictures.

Right now I'm working on getting the attachments saved without my
intervention. I haven't even started on the procmail recipe yet (except
to move messages to that specific address into a new folder). I already
have a bash script that wgets images on a regular basis and renames them
with date/time so I have a base to work from on that. Somewhere I have a
snippet I used to use for auto-updating a web page via ftp.

Thanks in advance for any pointers,

G

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

gvl2 (Gerald)
AirBall the Rolling Basket Case (1969 Standard Beetle)
LifeSaver (1974 Bay Window Bus)
http://www.phorce1.com



Reply to: