1.\" $OpenBSD: spamdb.8,v 1.18 2014/06/22 15:11:59 schwarze Exp $ 2.\" 3.\" Copyright (c) 2004 Bob Beck. All rights reserved. 4.\" 5.\" Permission to use, copy, modify, and distribute this software for any 6.\" purpose with or without fee is hereby granted, provided that the above 7.\" copyright notice and this permission notice appear in all copies. 8.\" 9.\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES 10.\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 11.\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR 12.\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 13.\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN 14.\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF 15.\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 16.\" 17.Dd $Mdocdate: June 22 2014 $ 18.Dt SPAMDB 8 19.Os 20.Sh NAME 21.Nm spamdb 22.Nd spamd database tool 23.Sh SYNOPSIS 24.Nm spamdb 25.Oo Oo Fl Tt Oc 26.Fl a Ar keys Oc 27.Oo Oo Fl Tt Oc 28.Fl d Ar keys Oc 29.Sh DESCRIPTION 30.Nm 31manipulates the spamd database in 32.Pa /var/db/spamd 33used for 34.Xr spamd 8 . 35.Pp 36The options are as follows: 37.Bl -tag -width Ds 38.It Fl a Ar keys 39Add or update the entries for 40.Ar keys . 41This can be used to whitelist one or more IP addresses 42(i.e. circumvent the greylisting process altogether) 43by adding all IP addresses as keys to the spamd database for WHITE entries. 44If any 45.Ar keys 46specified match entries already in the spamd database, 47.Nm 48updates the entry's time last seen to now. 49.It Fl d Ar keys 50Delete entries for 51.Ar keys . 52.It Fl T 53Add or delete the keys as SPAMTRAP entries. 54See the GREYTRAPPING section of 55.Xr spamd 8 56for more information. 57Must be used in conjunction with the 58.Fl a 59or 60.Fl d 61option. 62.It Fl t 63Add or delete the keys as TRAPPED entries. 64See the GREYTRAPPING section of 65.Xr spamd 8 66for more information. 67Must be used in conjunction with the 68.Fl a 69or 70.Fl d 71option. 72.El 73.Pp 74If adding or deleting a SPAMTRAP address 75.Pq Fl T , 76.Ar keys 77should be specified as email addresses: 78.Pp 79.Dl spamtrap@mydomain.org 80.Pp 81Otherwise 82.Ar keys 83must be numerical IP addresses. 84.Ss DATABASE OUTPUT FORMAT 85If invoked without any arguments, 86.Nm 87lists the contents of the database in a text format. 88.Pp 89For SPAMTRAP entries the format is: 90.Pp 91.Dl type|mailaddress 92.Pp 93where 94.Em type 95will be SPAMTRAP and 96.Em mailaddress 97will be the email address for which any connections received by 98.Xr spamd 8 99will be blacklisted if mail is sent to this address. 100.Pp 101For TRAPPED entries the format is: 102.Pp 103.Dl type|ip|expire 104.Pp 105where 106.Em type 107will be TRAPPED, 108.Em IP 109will be the IP address blacklisted due to hitting a spamtrap, and 110.Em expire 111will be when the IP is due to be removed from the blacklist. 112.Pp 113For GREY entries, the format is: 114.Pp 115.Dl type|source IP|helo|from|to|first|pass|expire|block|pass 116.Pp 117For WHITE entries, the format is: 118.Pp 119.Dl type|source IP|||first|pass|expire|block|pass 120.Pp 121The fields are as follows: 122.Pp 123.Bl -tag -width "source IP" -offset indent -compact 124.It type 125.Em WHITE 126if whitelisted or 127.Em GREY 128if greylisted 129.It source IP 130IP address the connection originated from 131.It helo 132what the connecting host sent as identification in the HELO/EHLO command in the 133SMTP dialogue 134.It from 135envelope-from address for 136.Em GREY 137(empty for 138.Em WHITE 139entries) 140.It to 141envelope-to address for 142.Em GREY 143(empty for 144.Em WHITE 145entries) 146.It first 147time the entry was first seen 148.It pass 149time the entry passed from being 150.Em GREY 151to being 152.Em WHITE 153.It expire 154time the entry will expire and be removed from the database 155.It block 156number of times a corresponding connection received a temporary 157failure from 158.Xr spamd 8 159.It pass 160number of times a corresponding connection has been seen to pass 161to the real MTA by 162.Xr spamlogd 8 163.El 164.Pp 165Note that times are in seconds since the Epoch, in the manner returned by 166.Xr time 3 . 167Times may be converted to human readable format using: 168.Pp 169.Dl $ date -r <value> 170.Sh FILES 171.Pa /var/db/spamd 172.Sh SEE ALSO 173.Xr spamd.conf 5 , 174.Xr spamd 8 , 175.Xr spamd-setup 8 176.Sh HISTORY 177The 178.Nm 179command 180appeared in 181.Ox 3.5 . 182