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

mailboxparser/Parsing Bounce Emails

 

mailboxparser - Parsing Bounce Emails

mailboxparser command of bounceHammer parse bounce emails in a mailbox or a Maildir/, and finds a reason of email bounce, and classifies a domain part of a recipient into hostgroup (PC, Webmail, Smartphone).

Then the command write parsed data (Data Structure) into a file as a YAML format.

This command has been installed in INSTALL-DESTINATION/bin directory.

Usage of This Command

Basically, the argument of mailboxparser command is the only path of the mailbox or the Maildir which you want to parse.

When the command is called without any option, parsed data will be displayed in standard out. The command with --help option show available options in the help message.

One mailbox in the argument
# mailboxparser /var/mail/user1
 
Multiple mailboxes in the argument
# mailboxparser /var/mail/user1 /var/mail/user2 /var/mail/root
 
A Maildir/ in the argument
# mailboxparser /home/user1/Maildir/cur
 
Read bounce email text from STDIN
# cat /var/mail/user3 | mailboxparser
 
Show help message
# mailboxparser --help

Available Options

Options for Parsing

-g, --greed
The command parses a bounce email greedy with attempting to find an email address from less common e-mail header.
-s, --skip
The command skips a bounce email which reason of email bounce is less important. This option is equals to all of the following options: --skip-norelaying, --skip-mailererror, --skip-hostunknown, --skip-temperror.
--skip-norelaying
This option does not include a bounce email which reason of email bounce is "Relaying Denied" in parsed data. The error "Relaying Denied" will be incurred often by mis-configuration of SMTP server.
--skip-mailererror
This option does not include a bounce email which reason of email bounce is "Unknown Mailer Error" in parsed data. The error "Unknown Mailer Error" will be incurred often by mis-configuration of SMTP server or mailer programs.
--skip-hostunknown
This option does not include a bounce email which reason of email bounce is "Host Unknown" in parsed data. In many cases, the error "Host Unknown" is due to the misspelling in recipient email address.
--skip-temperror (Beginning with ver. 2.2.0)
This option does not include a bounce email which is temporay error (error code is 4xx).

Options for Logging

-2, --two-way (Beginning with ver. 2.1.0)
This option write parsed data both of the temporary log file(YAML) and standard out. -l, --log option (described later) works the same as this option about writing a temporary log file. This option is intended to use in /etc/mail/aliases file like the following.
  • Parsed data will be saved in the temporary log file
  • Parsed data will be inserted into the database by databasectl command via pipe line
-l, --log
This option write parsed data into a temporary log file (YAML format). If this option is omitted, parsed data will be displayed in standard out. The temporary log file will saved in a directory which is defined at etc/bouncehammer.cf. A user who execute this command should have permissions to write the directory.
-o, --output DIRECTORY
This option write parsed data into a temporary log file in a specified directory. A user who execute this command should have permissions to write the specified directory.
--truncate
After parsing, this option truncate (file size=0) a original mailbox or an email file in Maildir/. If there are many bounce emails in a mbox like /var/mail/bounce, This option is useful to leave a mailbox file with size 0.
--remove
After parsing, this option removes a original mailbox or an email file in Maildir/.
--backup DIRECTORY (Beginning with ver. 2.2.0)
After parsing, this option move a original files to a specified directory.
--save-failed-mesg (Beginning with ver. 2.7.7)
After parsing, this option saves an email which cannot be parsed by mailboxparser. into the directory defined in etc/bouncehammer.cf(directory->spool). The email will be saved as failed.MessageID or MD5 value.eml.

Other Options

-B, --batch (Beginning with ver. 2.3.1)
Runs as a batch mode. Results of the command will be displayed as a YAML format. It useful to send the results to an administrator with an email.
-C, --conf CONFIG-FILE
Use an alternative bounceHammer's configuration file. If this option is omitted, the command will use INSTALL-DESTINATION/etc/bouncehammer.cf.
-T, --test
Runs as test mode. This option is equals to the option -C INSTALL-DESTINATION/etc/test-run.cf.
-F, --format CHAR
Display parsed data as a specified format. If this option is omitted, the results are displayed as a ASCII Table. Available format characters are the followings:
CHAR Notes
y YAML | e.g.) -Fy
j JSON | e.g.) -Fj
c CSV (Beginning with 2.4.0) | -Fc
a ASCII Table | -Fa
--silent
Turn silent mode on. This option makes the command quiet in spite of -v, --verbose option (described later). And when the command is called from a daemon (such as sendmail), the command will exit with status 0 in spite of an error. If an MTA process (e.g. /usr/sbin/sendmail) which is called the command without this --silent option stopped by an error, the command will exit with status 75(EX_TEMPFAIL).
-v, --verbose
Turn verbose mode ON.
--help
Display help messages of this command.
--version
Display the version number of this command.

Screenshots of the running commands

mailboxparser --format a -vvvv Maildir/new

The following screenshot shows that mailboxparser parse bounce emails in the Maildir/new direcotry, and display the results in stadard out as a ASCII Table format.

mailboxparser -vvvv Maildir/new --log --batch

The following screenshot shows that mailboxparser parse bounce emails in the Maildir/new direcotry, and write the results to the temporary log file in /usr/local/bouncehammer/var/spool directory.