This project have been posted before but I closed it down because of new requirements.
This is the new project:
I recive emails with *.jpg attacments into an email account wich is set up only to be used for this purpouse.
I want to automatic post the incomming pictures to a picture gallery.
I have the gallery ready, the MySql is ready, but I'm sick of manually save, re-name, make thumbnail, upload and insert referenses into database table.
I need a perl script that can perform the two following tasks.
Step-1
----------
a) Download all new messages from one spesified account in a POP3 mailbox. (mailserver is not on my server)
b) for each mail/attachment do the following:
- extract the *.jpg picture attachments
- Re-name the picture (random numerical value)
- Save the picture to a folder on my server (../gallery/)
- create a 50 pixels wide thumbnail of the picture (all incomming pics are originally 640x480 pixels)
- save the thumbs to a subfolder (../gallery/thumbs/) using the same name as given to the original picture.
Step-2
----------
a) Extraxt the senders name before the (a) in the senders email adress. e.g: if the senders email adress is "12345(a)[login to view URL]" then only extract "12345" as the senders "name".
b) Save to MySql table:
- senders "name" e.g "12345"
- Topic
- Body message (plain text)
- New picture name (e.g "[login to view URL]" = "59365")
Note If an email contains more than one attachment then the script have to create a new record in the MySql table for each attachment.
Well that was the fun part :-) now to what you got to work with.
My server is hosted by a "hosting company" so i can't install any new moduls on the server.
These modules are installed, and I think they can help:
NET::POP3
Gimp::Fu
But I'm no expert on modules so take a look at what's available:
[login to view URL]
or
[login to view URL]
NOTE! I do not need any userinterface since I will execute the script from a web-browsers command line, using a cron like service. The script will be executed once a day. But it would be nice if the script could write a small log-file.
The budget range I have mentioned is only a pointer, I am willing to pay some extra if the script is good. (I generally like one-file scripts)
If you find it impossible to meet my requirements, due to the server setup I have, then I am interrested to know what you can delivered.
Or if you know a better way to do this, plz tell me.