Skip to content

ismaildup.1

Manvendra Bhangui edited this page Feb 25, 2024 · 4 revisions

NAME

ismaildup - Duplicate Email eliminator

SYNOPSYS

ismaildup dir cmd [args]

DESCRIPTION

ismaildup takes email on stdin. It exits with status 0 if the email is duplicate. A mail is treated as duplicate if it has been received previously in a given time interval. The default time interval is 900 seconds (15 mins) and can be changed by setting ELIMINATE_DUPS_INT environment variable. If the email is not a duplicate, it executes the command cmd with args as command line arguments.

You can put the following in .qmail file to eliminate duplicates

  |/usr/bin/ismaildup Maildir /usr/bin/maildirdeliver Maildir

Where Maildir is the path to user's Maildir.

You need to set the environment variables MAKESEEKABLE, ELIMINATE_DUPS to turn on the duplicate elimination logic. The time interval in seconds (default 900 seconds) within which the duplicates are checked can be set by the ELIMINATE_DUPS_INT environment variable.

ismaildup uses 822header(1) to get the headers and calculate 32 character md5sum of the headers. It excludes the Received and Delivered-To headers from the md5sum calculation. The result is written to the file dir/dupmd5 in the following format.

unix_time md5sum

ismaildup automatically updates the dupmd5 file with the latest timestamps, expired records are automatically removed. Hence there is no maintenance required for this file. ismaildup uses uses the following command to get the headers for md5sum calculation.

  /usr/bin/822header -X Received -X Delivered-To -X X-Delivered-To

You can set ELIMINATE_DUPS_ARGS environment variable to set your own program and arguments for md5sum computation. The below command will use 822header program and use just the Subject and Date headers to decide if the mail is a duplicate.

  /usr/bin/822header -I Subject -I Date

SEE ALSO

vdelivermail(8), 822header(1), md5sum(1)

Clone this wiki locally