Python Shell
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.


eMail Web Interface


There are some countries (like for example Japan) where you can get very cheap
mobile E-Mail flatrates, but no direct internet access.
To have access to some basic sites you can install this
python script on your mail server, which will translate simple
e-Mail commands into web page fetches.

Authorised users are identified by their from address and a password
in the subject line.


You just need to call the program from the ~/.forward file
for the respective user which should deal with your mail requests.

Content of ~/.forward file:
 |"cd /home/username/mail2web; FAKECHROOT_EXCLUDE_PATH=/usr/lib/python2.5 fakechroot ./ 2>&1 >> watcher_report_output.log"

Please update to your settings.
If you don't like the fakechroot'ing you can comment off the block
"Go into CHROOT" in

The script checks the execution of
mail2web and generate an error mail in case of encountered errors.
In this case further execution of the program is prevented.
When you don't want to use this script then just remove it from the call.

To have some simple logfile rotation for
use the following crontab entry for the user (again adapt settings).
# Crontab-Entry for simple log archiving
# mail2web: Simple Logfile cleaner: Every 2 weeks make one backup
24           2       11,21    *     *      cd $HOME/mail2web; nice bzip2 -c watcher_report_output.log > watcher_report_output.log.bak.bz2 ; rm watcher_report_output.log

Configuration and Extension
You need to add the authorised users into the file .
the format should be self-explanatory.

Update some program settings like sender, SMTP server or data limit in the
Opts dictionary inside .
You should also change the disclaimer variable "explanation" inside the code, which
is send with every message.

Update some program settings like mail recipient below "*** Settings"
inside .

For adding new web fetching methods just have a look at the implementations
below the section "Command execution objects" in .
Take the one which suits you best as base and then implement it.
The new worker you then need to add to the dictionary WorkerClasses.

See Homepage mentioned below at "Web Links"

When you want to have a kind of revision count embedded for your local use, run
the script
Do not commit files after keyword expansion is done.

License & Author
GNU General Public License, version 2
Copyright (C) 2010 Robert Lange <>

This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
version 2 as published by the Free Software Foundation.

Web Links