VPOPMail

VPOPMail is a library that helps to manipulate vpopmail (www.inter7.com/vpopmail), a software package to provide an easy way to manage virtual email domains.

This library can be used to write email filters, spam learners, etc.

Requirements

  • Ruby 1.8.* (or newer). Only tested under Linux, should be fine under any Unix.

  • Installed vpopmail software.

  • Installed spamassassin for spam learning.

Gem requirements

RubyMail 0.17 or newer

Documentation

The documentation is in RDoc format in the doc subdirectory.

Install

Type the following while in the package directory:

ruby install.rb config
ruby install.rb setup
ruby install.rb install

You may need special permissions to execute the last line. If you want to just install RubyMail to a custom location, just copy the rmail subdirectory manually.

Support

To reach the author of ruby-vpopmail, send mail to [email protected].

Examples

emailcheck

Just run ruby emailcheck [email protected] and it will tell you if that email address is valid or not.

See ruby emailcheck –help for help.

Incorporating emailcheck in maildrop’s mailfilter

That’s what I did in my own. Since I am not an expert at maildrop yet, I suspect there is a way to make this look nicer.

VCHKMAIL=“/usr/bin/ruby /home/vpopmail/bin/emailcheck.rb”

.…..

# Check if the sender exists if ( $ISSPAM == 0) {

ADDRESS=""
if ( /^Reply-To:\s+.*/ )
{
    foreach (getaddr $MATCH) =~ /.+/
    {
        ADDRESS="$ADDRESS $MATCH"
    }
}
else
if ( /^Return-Path:\s+.*/ )
{
    foreach (getaddr $MATCH) =~ /.+/
    {
        ADDRESS="$ADDRESS $MATCH"
    }
}
else
if ( /^From:\s+.*/ )
{
    foreach (getaddr $MATCH) =~ /.+/
    {
        ADDRESS="$ADDRESS $MATCH"
    }
}

if (length($ADDRESS) > 0)
{
    log "   Checking if Sender <$ADDRESS> is valid"
    `$VCHKMAIL --silent --log -- $ADDRESS`
    if ( $RETURNCODE == 1 )
    {
        log "   Sender <$ADDRESS> does not exist"
        ISSPAM=1
    }
}

}

License

Copyright © 2006 Gildas Cherruel

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.