I’m trying to use mail2entry, a Python 2.2 script, along with a .procmail pipe command, to post e-mailed images to a weblog (creating a ‘moblog’).
I know I need to use Python 2.2 (/usr/bin/python2.2) instead of the default Python 2.1.3 because the mail2entry script requires “email.Header” and “True” functions (I don’t know what these mean, but searching for them after an error message found other discussions concluding that the newer version of Python was needed).
I created a new user with shell access and an e-mail account (firstname.lastname@example.org). Under that user, I used the .forward.postfix kludge to pipe mail to procmail, then used a procmail filters.rc recipe to send all received messages to the python 2.2 script (in my other user directory):
| /usr/bin/python2.2 /home/mainuser/mail2entry/mail2entry.py
My problem? I don’t even know if e-mail sent to email@example.com is being sent correctly to the script in my main user directory. And when I try to test the mail2entry script via Python2.2, I get errors like
UnboundLocalError: local variable ‘result’ referenced before assignment
SyntaxWarning: import * only allowed at module level
ImportError: No module named Header
That last one despite using Python2.2 (which I read is where ‘Header’ was added).
Any ideas? Or am I in way over my head?