English | Japanese

scmail: a mail filter written in Scheme

Last Modified: 2004-07-27 (Since: 2002-10-24)


What's scmail?

scmail is a mail filter written in Scheme. scmail can filter an incoming mail when it is received and filter mails in a mailbox. A bayesian spam filter called scbayes is also included.

What's new?

Requirements

Characteristics

Installation

To install scmail, run the following commands.

% gzip -dc scmail-1.3.tar.gz | tar xvf - 
% cd scmail-1.3
Password: (enter root's password)
# make
# make install

Components

Configuration

Copy a sample file (~/dot.scmail/config.sample) to ~/.scmail/config and edit it.

#{../dot.scmail/config.sample}

Using scmail-deliver

scmail-deliver is a command to filter an incoming mail when it is received. scmail-deliver uses Filtering rules defined in ~/.scmail/deliver-rules. You can copy a sample file (dot.scmail/deliver-rules.sample) to ~/.scmail/deliver-rules.

If your mail server is Sendmail or Postfix, you can put the following ~/.forward file to filter an incoming mail when it is received.

| /usr/local/bin/scmail-deliver

If you are using fetchmail to fetch mails from a POP server, you can add the following code into your ~/.fetchmailrc file to use scmailrc-deliver.

poll pop3.example.org
     protocol apop
     user satoru
     mda "/usr/local/bin/scmail-deliver"
     no mimedecode

Using scmail-refile

scmail-refile is a command to filter mails in a mailbox. scmail-refile uses Filtering rules defined in ~/.scmail/refile-rules. You can copy a sample file (dot.scmail/refile-rules.sample) to ~/.scmail/refile-rules.

To use scmail-refile, run it on the command line like the following:

% scmail-refile
refile: inbox/93 -> ml/enkai@coboler/57
refile: inbox/94 -> ml/linux-zaurus/218
refile: inbox/98 -> ml/linux-zaurus/219
refile: inbox/99 -> ml/ming/42           

In this example, the first line in the output messages shows a mail 93 in inbox folder is refiled to ml/enkai@colber as a mail 57. ~/.scmail/log file contains the same report with time information.

% tail -5 ~/.scmail/log
2002-09-26T12:49:31: refile: inbox/93 -> ml/enkai@coboler/57  
2002-09-26T12:49:31: refile: inbox/94 -> ml/linux-zaurus/218  
2002-09-26T12:49:31: refile: inbox/98 -> ml/linux-zaurus/219
2002-09-26T12:49:31: refile: inbox/99 -> ml/ming/42

Filtering rules

You can edit sample files.

dot.scmail/deliver-rules.sample

#{../dot.scmail/deliver-rules.sample}

dot.scmail/refile-rules.sample

#{../dot.scmail/refile-rules.sample}

Using a spam filter

Please see scbayes's documentation.

FAQ

How does scmail handle a huge mail?

Since scmail handles a mail on memory entirely, a huge mail which cannot fit in memory is not supported. So, scmail-deliver perhaps loses an incoming huge mail.

What happens if a rule file has syntax errors?

scmail uses rules read correctly and broken rules are ignored. Messages of syntax errors are reported in ~/.scmail/log.

Download

scmail is a free software with ABSOLUTELY NO WARRANTY under so called "BSD licence".

References

Links


Satoru Takabayashi