bounceHammer has been EOL'ed on February 29, 2016

EOL on February 29, 2016

bounceHammer have been downloaded and used by many users and companies since the first release on March 2010 and has been EOL: End Of Life on February 29, 2016. Thanks for using bounceHammer for a long time. We are now providing Sisimai (the successor of bounceHammer, more faster, more higher precision of analysis) as a bounce mail parser library in BSD 2-Clause License.

Sisimai
Commercial Support

  • 1Setting Up Sisimai Your Server
  • 2Support developmenet using Sisimai
  • 3Support via Email
  • 4Support bounce management
  • 5Parsing your bounced emails

HTTP-API/SELECT

API which gets a single record

select - Getting data by ID or Message Token

Beginning with bounceHammer 2.4.0, HTTP-API(select) is for getting data from a database by specifying ID or Message Token.

The purpose of this API(select) is to get data from other host or network via HTTP. For Example, at web site (low page traffic), The result of email address verification will be displayed at each user's page.

In The Case of Mass Email Delivery

If you want to get many records for verifying email addresses before mass email delivery, you may use datadumper command instead of this API.

How to use API(select)

A URL for getting data via API(select) is the following format:
http://Hostname (bounceHammer is running)/CGI script name of API/select/Message Token or ID.

Example implementation with Perl and Python

Perl

The following code shows an easy example of implementation with Perl. The code is not include error handling. In this section, the following code use JSON::Syck module because bounceHammer's HTTP-API output data as JSON format.

#!/usr/local/bin/perl
use strict;
use warnings;
use LWP::UserAgent;
use JSON::Syck;
use Digest::MD5;

my $addresser = q{sender01@example.jp};
my $recipient = q{user01@example.org};
my $queryhost = q{http://apitest.bouncehammer.jp/index.cgi/query/};
my $mesgtoken = Digest::MD5::md5_hex(
                  sprintf('\x02%s\x1e%s\x03',$addresser,$recipient));
my $useragent = new LWP::UserAgent();
my $response = $useragent->request(
                 HTTP::Request->new( GET => $queryhost.$mesgtoken ));
my $metadata = JSON::Syck::Load($response->content()) || [];

foreach my $j ( @$metadata )
{
  printf( '%s: %s\n', $j->{recipient}, $j->{reason} );
}

Python

The following code shows an easy example of implementation with Python. The code is not include error handling. In this section, the following code use simplejson module because bounceHammer's HTTP-API output data as JSON format.

#!/usr/bin/python
# coding: utf-8
import urllib2
import simplejson
import md5

addresser = 'sender01@example.jp'
recipient = 'user01@example.org'
mesgtoken = md5.new('\x02%s\x1e%s\x03' % (addresser,recipient))
queryhost = 'http://apitest.bouncehammer.jp/index.cgi/query/'
response = urllib2.urlopen( queryhost + mesgtoken.hexdigest() )
metadata = simplejson.load(response)

for j in metadata:
  print j['recipient'] + ': ' + j['reason']

If you use Ruby or PHP, you can find sample scripts: request-to-api.{rb,php} in Ruby(1.9) and PHP in bounceHammer's source distribution/examples directory .