Script Library: 1238 scripts
  • Home
  • Script library
  • AltME Archive
  • Mailing list
  • Articles Index
  • Site search
View scriptLicenseDownload documentation as: HTML or editable
Download scriptHistoryOther scripts by: carl

Documentation for: popspec.r

Usage document for %popspec.r

1. Introduction to %popspec.r

This script is a support script for many of the REBOL email handling scripts.

2. popspec At a Glance

This script requires some setup to be useful, and cannot be run right out of the box. It is not a standalone script at all. It is only useful in support of the (potentially incomplete) list displayed later in this document

3. Using %popspec.r

There are up to four changes that need to be made for this supporting data script.

The popspec data can first of all, be specified in two forms. Either as a specification in url! format, or as a block! of port data. As mentioned in the script, the block format is a little more general as fields could be prompted for instead of hardcoded. This is of particular use for the password field.

3.1. url! format

If using the url! form, remove the commenting semi-colon and change the string to your email information. Then you will need to either move the line to after the block, or place a comment { ... } sequence around the block.

3.2. port! block format

If using the block format:

  • leave scheme as 'pop
  • Change the "user" to your account username
  • Change the "pass" to your account password
  • Uncomment and change the POP server if needed.

Notes: You will only need to set the POP host information if it differs from, or you have not set the information with the SET-NET utility function.

3.3. Warning about passwords

Saving your password as clear text is NOT recommended.

3.4. Alternative to saving passwords

One suggested alternative. Use a keyword such as 'ASK for the pass: set-word value. Then in the script that is using popspec: load %popspec.r, follow this load with

 change find popspec 'ASK ask/hide "Password? "

Please note the code that is using load %popspec.r may use a different variable than popspec, use the same variable name as used for the load in the above change example.

4. Where %popspec.r is used in the library

%mailautoreply.r This example confirms email received from friends only. All others will be ignored.
%mailboxsave.r This example reads email and appends it to a standard mailbox file (which can be read by most email apps).
%mailfriends.r This example displays messages that come from friends only. All others will be ignored.
%mailping.r Confirm certain email that contains a key word.
%mailsave.r This example reads all email and saves it to a file.
%mailserver.r As simple as a list server gets.
%maildespam.r This is an example of a simple email filter that removes unwanted junk mail from your mailbox.
%mailsniff.r Example of how to search all incoming email for particular keywords.
%remind.r Reads a file 'data.txt' containing appointment data, and sends my cell phone a text message 5 minutes before the appointment.

5. What you can learn

At least three important learning items from this support script.

Sample code with passwords are not usually sophisticated enough.

The REBOL open command is COOL, accepting either a url! or a port spec block, among its other abilities.

LOAD is used to return the last value from %popspec.r as part of a set-word sequence. This is worth more study as you learn REBOL.

6. What can break

Saving passwords in clear text is NOT RECOMMENDED in the long term. Used for trial and testing, maybe, but not for the long term.

You need access to a POP server. Most if not all ISPs support this with your internet connection. If not, or if you want to to use %popspec.r to access webmail, know that some webmail accounts will require you to use the full email address as the username. In that case, you will have to use the block format in %popspec.r, as a full email address (with the @ symbol in it) as a username will confuse a url! specification. Not to worry, the block form can handle this.

6.1. More warning

Once again, saving passwords in clear text is NOT RECOMMENDED.

7. Credits

%popspec.r Original author: Carl Sassenrath
  • The Library Team
  • Usage document by Brian Tiffin, Library Team Apprentice, Last updated: 5-May-2007