I figured it out eventually.
(crossposted from my weblog
http://heliolith.com/archives/2006/0...fish-on-linux/
I’m a fan of Snapfish, mainly because I can get digital prints at $0.10 per 4 x 6 if I prepay for 1000 prints ($100.00). Even after shipping, it works out a little cheaper than Costco or other local cheap digital developers. I like the prints truly developed like traditional film, not printed, as it feels and looks just a bit better.
Anyway, I was flustered by the lack of uploading software for Snapfish available for Linux. I can’t stand the web interface where you have to browse/attach each photo in batches of 10 or whatever, that is such an awful UI for more than a handful of files. Failing to google anything up as nice as a python script based on the Snapfish API (I don’t think they’ve made their API available even), I settled on an email-based solution.
But email really didn’t seem like an efficient way of uploading, especially not if I was going to have to manually compose and attach photos to each email then send them.
Enter mutt & putmail. These are the only two packages you need to make this work.
(You could of course use postfix or sendmail as your smtp senders, but I went with putmail as it seemed simple and light). Install them & set it up so you can send a test email succesfully to yourself. rather than using my domain-less home box as the sender, I set it up to route through gmail’s free smtp service.
Here’s my ~/.putmail/putmailrc:
[config]
server = smtp.gmail.com
email =
fubar@gmail.com
username = fubar
password = F00bar
port = 587
tls = true
You’ll also need to set “set sendmail=”/usr/local/bin/putmail.py” in your ~/.muttrc file. Once that’s up and running, just make a script in ~/bin or wherever you keep them with as many lines as you need to cover the variations in filenames (or use fancier regex if you know it).
Here’s the bare essential line:
#! /bin/bash
for file in *JPG; do mutt -s $file -a $file
save@mysnapfish.com < /dev/null ; done
for file in *jpg; do mutt -s $file -a $file
save@mysnapfish.com < /dev/null ; done
In English, this says, for each file with the *jpg ending in this directory, do invoke mutt to send it to
save@snapfish.com with the subject line the same as the filename, and get your standard input from the void (essentially bypass mutt’s asking you questions and prompting you to type a message for each email). Don’t forget to chmod +x your script, whatever you call it, mine is simply ‘muttfish.’
Make sure you check your email preferences at snapfish’s site so they put the files where you want them and also, that you authorize Snapfish to receive from the email address you’ll be sending them from. Then make a copy of the photos you’ll want to upload into a temp directory, and run the script there.
I like to use gthumb’s catalog feature (Alt+E+A, enter) to add everything I want to upload from various directories to a temporary album, then make a copy of that catalog’s contents (select all) to a temporary directory.
I’ve since begun using mutt fulltime as my main email client, even though I like gmail’s UI, learning the features & conveniences of keyboard bindings in mutt, and the gpg integration is very nice. Someday I’ll get it set up with an imap account and email will function as it should. Hope this helps you.