WEB2MAIL Version 0.1 This program takes e-mail messages and uses them to browse the web. This version is very much under development and I take no responsibility for any problems, including incorrect information you may get for its use. (Example if you use the DIR: commands to get driving directions and it leads you into a deadly swamp, sorry not my problem) It under 'Public License' which means that you can use it any where except for commercial use. I mean by this is that you CAN use it in a company as a tool for your 'on the road' work force, but you CAN NOT re-sell it as a commercial service or product for others to use. If your an ISP and want to provide this as a value added service to your customers, thats fine, just do not charge a separate line item for its use. Installation: At this time there is no really useful install script and your going to have to edit some files to modify the directory path to fit your system. Step 1: Decide where your going to install this, there is a queue of messages that will be stored for a period of time, so make sure that you select a disk large enough for your needs. (a few hundred megs or a gig or two should be find for most users) For our explain install, the following will be used $W2MHOME = /home/web2mail mkdir -p $W2MHOME $W2MHOME/bin $W2MHOME/db $W2MHOME/queue $W2MHOME/log chown alias $W2MHOME $W2MHOME/bin $W2MHOME/db $W2MHOME/queue $W2MHOME/log copy all the web2mail executable scripts into $W2MHOME/bin and edit the top of all the scripts so they know the correct full path. copy the help.html and error.html files into the $W2MHOME/db directory. Step 2: Decide what the email address that will be the 'To:' address of the system. I Strongly recommend, to prevent misuse, you pick a IQ e-mail ID that is obscure and not something obvious like 'web2mail@somewhere.com'. Since most handhold wireless PDA's have decent address books with alias names for addresses, you can pick something obscure and let the wireless handhold remember the odd address for you. Example something like MMM023X@somethere.com For this document I'll use the obvious web2mail@somewhere.com just to make reading a bit easier. Step 3: Create a forward rule that will attach this program to your UNIX mail system. In theory any of the major UNIX mail systems (sendmail, procmail or qmail) can be used. My test system uses qmail. Note file ownership is important to make sure everything works right. Check the rules of your mail software. In the most common distributions of qmail, you use 'dot' files in the qmail aliases directory to control this. For an alias for 'web2mail@somewhere.com' the file names will be '/var/qmail/alias/.qmail-web2mail' and '/var/qmail/alias/.qmail-web2mail-default' The content of both of these files will be the same. '|$W2MHOME/bin/webfilter' (note that use the real full path and not $W2MHOME here) also note the pipe "|" character. Make sure the ownership and protection of the .qmail-* files are correct. Step 4: Test the e-mail alias, at this time you should not get a reply, as the use control files int he $W2MHOME/db directory need to be edited, but you can still see if the mail is being captured and filtered by looking for a new file in the $W2MHOME/queue directory. If this part worked, your more than 1/2 way there. If no files end up in the queue directory, check your permissions and look at the /var/log files for any errors from qmail. Step 5: Create your first db entry. There is a sample file, use it only as a guide, do not accidental include the sample data record in your final file because that could become a security hole. The user.db file: The user.db file is the main control file for the program. It is used as a security tool to verify that incoming e-mail requests are from authorized users, and it also gives control on where outbound e-mail goes to. You also have options for controlling the 'split size' of outbound email so not to overload the message side limits of wireless handholds. Fields are comma separated. F1: From address. The fill text of the first FROM line in the requesting message. Use cut and paste from the messages in the $H2MHOME/queue files. Example would be 'From: "john Doe" ' F2: The email address the web data should be sent to. It does not HAVE to be the same as the F1 field. In most cases it will be the same address but it doesn't have to me. Remove unnecessary text like the "john Doe' and the brackets in the above example. F3: The largest message block size. Messages are split into these blocks up to this size. Useful for smaller e-mail devices that have size limits. F4: The maximum number of blocks to send. Keeps you from sending 100's of messages if a user accidental browses to a huge web page. A good number might be 10 to 20 blocks. F5: The virtual screen height. Used only in an experimental formating tool for images. A value of 20 is reasonable. F6: Display width, uses this to help format the pages to be more readable. Many handholds use proportional rather than fixed width fonts, so this is only a 'best guess' to make the majority of the web pages look 'ok'. Try number like 35 for pager style blackberries and 45 for the PDA style ones. F7: Zip code. So to provide a default value for localized information such as movies and weather. Can be over ridden by the user. Step 6: Test and clean up. Test the system, if you don't get a reply right away, look in the queue directory. You should see two files in there for each message. The first should be ###.q which is a copy of the message the user sent, and ###.qdl which should be a text copy of the web page reply. If you only see '###.q' but no '###.qdl' files, then check ownership of the directories. If you can not find any error, but still can't see the problem. run the perl script interactively to see if there are any obvious errors. perl $W2MHOME/bin/parcekeys.pl $W2MHOME/queue/###.q Check for any errors related to the fixed pathnames and make sure all the scrips have to correct value for $W2MHOME To simplify this testing, I recommend erasing all the files in the $W2MHOME/queue directory after each test run. That way you can don't have to guess which file in there is from the latest run. Lastly add some clean up CRON jobs. Add it under the qmail owner (commonly 'alias') See your man page on cron to see how to edit this. example for daily midnight cleanup of old messages '1 1 * * * find $W2MHOME/queue -ctime +0 -exec /bin/rm -f {} \;'