1*de9ad6b5Smillert.\" $OpenBSD: spamdb.8,v 1.20 2017/10/29 19:11:34 millert Exp $ 21f68c1d4Sbeck.\" 31f68c1d4Sbeck.\" Copyright (c) 2004 Bob Beck. All rights reserved. 41f68c1d4Sbeck.\" 51f68c1d4Sbeck.\" Permission to use, copy, modify, and distribute this software for any 61f68c1d4Sbeck.\" purpose with or without fee is hereby granted, provided that the above 71f68c1d4Sbeck.\" copyright notice and this permission notice appear in all copies. 81f68c1d4Sbeck.\" 91f68c1d4Sbeck.\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES 101f68c1d4Sbeck.\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 111f68c1d4Sbeck.\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR 121f68c1d4Sbeck.\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 131f68c1d4Sbeck.\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN 141f68c1d4Sbeck.\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF 151f68c1d4Sbeck.\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 161f68c1d4Sbeck.\" 17*de9ad6b5Smillert.Dd $Mdocdate: October 29 2017 $ 181f68c1d4Sbeck.Dt SPAMDB 8 191f68c1d4Sbeck.Os 201f68c1d4Sbeck.Sh NAME 211f68c1d4Sbeck.Nm spamdb 221f68c1d4Sbeck.Nd spamd database tool 231f68c1d4Sbeck.Sh SYNOPSIS 241f68c1d4Sbeck.Nm spamdb 25*de9ad6b5Smillert.Op Fl adGTt 26*de9ad6b5Smillert.Op Ar keys ... 271f68c1d4Sbeck.Sh DESCRIPTION 281f68c1d4Sbeck.Nm 291f68c1d4Sbeckmanipulates the spamd database in 301f68c1d4Sbeck.Pa /var/db/spamd 311f68c1d4Sbeckused for 32fa5e2dccSjmc.Xr spamd 8 . 331f68c1d4Sbeck.Pp 341f68c1d4SbeckThe options are as follows: 351f68c1d4Sbeck.Bl -tag -width Ds 36*de9ad6b5Smillert.It Fl a 37d0872fbcSbeckAdd or update the entries for 38d0872fbcSbeck.Ar keys . 39d0872fbcSbeckThis can be used to whitelist one or more IP addresses 40813f99b6Sjmc(i.e. circumvent the greylisting process altogether) 41d0872fbcSbeckby adding all IP addresses as keys to the spamd database for WHITE entries. 42d0872fbcSbeckIf any 43d0872fbcSbeck.Ar keys 44d0872fbcSbeckspecified match entries already in the spamd database, 45813f99b6Sjmc.Nm 46813f99b6Sjmcupdates the entry's time last seen to now. 47*de9ad6b5Smillert.It Fl d 48d0872fbcSbeckDelete entries for 49d0872fbcSbeck.Ar keys . 5088a0bb7eSmillert.It Fl G 5188a0bb7eSmillertDelete the keys as GREY entries. 5288a0bb7eSmillertSee the GREYTRAPPING section of 5388a0bb7eSmillert.Xr spamd 8 5488a0bb7eSmillertfor more information. 5588a0bb7eSmillertMust be used in conjunction with the 5688a0bb7eSmillert.Fl d 5788a0bb7eSmillertoption. 581e913b92Sbeck.It Fl T 59d0872fbcSbeckAdd or delete the keys as SPAMTRAP entries. 6060addc80SjmcSee the GREYTRAPPING section of 61813f99b6Sjmc.Xr spamd 8 62813f99b6Sjmcfor more information. 63813f99b6SjmcMust be used in conjunction with the 64813f99b6Sjmc.Fl a 65813f99b6Sjmcor 66813f99b6Sjmc.Fl d 67813f99b6Sjmcoption. 681e913b92Sbeck.It Fl t 69d0872fbcSbeckAdd or delete the keys as TRAPPED entries. 7060addc80SjmcSee the GREYTRAPPING section of 71813f99b6Sjmc.Xr spamd 8 72813f99b6Sjmcfor more information. 73813f99b6SjmcMust be used in conjunction with the 74813f99b6Sjmc.Fl a 75813f99b6Sjmcor 76813f99b6Sjmc.Fl d 77813f99b6Sjmcoption. 781f68c1d4Sbeck.El 79813f99b6Sjmc.Pp 807965a5b1SjmcIf adding or deleting a SPAMTRAP address 81813f99b6Sjmc.Pq Fl T , 82d0872fbcSbeck.Ar keys 83d0872fbcSbeckshould be specified as email addresses: 847965a5b1Sjmc.Pp 852abcd8eaSbeck.Dl spamtrap@mydomain.org 867965a5b1Sjmc.Pp 87813f99b6SjmcOtherwise 88d0872fbcSbeck.Ar keys 89d0872fbcSbeckmust be numerical IP addresses. 90a9073584Sbeck.Ss DATABASE OUTPUT FORMAT 91*de9ad6b5SmillertIf invoked without any options, 921f68c1d4Sbeck.Nm 9376b670beSjmclists the contents of the database in a text format. 94*de9ad6b5SmillertIf one or more 95*de9ad6b5Smillert.Ar keys 96*de9ad6b5Smillertare specified, only matching entries will be printed. 978f415134Sjmc.Pp 981e913b92SbeckFor SPAMTRAP entries the format is: 991e913b92Sbeck.Pp 1001e913b92Sbeck.Dl type|mailaddress 1011e913b92Sbeck.Pp 1021e913b92Sbeckwhere 1031e913b92Sbeck.Em type 1041e913b92Sbeckwill be SPAMTRAP and 1051e913b92Sbeck.Em mailaddress 1061e913b92Sbeckwill be the email address for which any connections received by 1071e913b92Sbeck.Xr spamd 8 1081e913b92Sbeckwill be blacklisted if mail is sent to this address. 109813f99b6Sjmc.Pp 1101e913b92SbeckFor TRAPPED entries the format is: 1111e913b92Sbeck.Pp 1121e913b92Sbeck.Dl type|ip|expire 1131e913b92Sbeck.Pp 1141e913b92Sbeckwhere 1151e913b92Sbeck.Em type 1161e913b92Sbeckwill be TRAPPED, 117d0872fbcSbeck.Em IP 1181e913b92Sbeckwill be the IP address blacklisted due to hitting a spamtrap, and 1191e913b92Sbeck.Em expire 1201e913b92Sbeckwill be when the IP is due to be removed from the blacklist. 121813f99b6Sjmc.Pp 1226127addeSjmcFor GREY entries, the format is: 1231e913b92Sbeck.Pp 1245b0222eaSbeck.Dl type|source IP|helo|from|to|first|pass|expire|block|pass 125a9073584Sbeck.Pp 1266127addeSjmcFor WHITE entries, the format is: 1276127addeSjmc.Pp 1286127addeSjmc.Dl type|source IP|||first|pass|expire|block|pass 1296127addeSjmc.Pp 130a9073584SbeckThe fields are as follows: 13176b670beSjmc.Pp 132d0872fbcSbeck.Bl -tag -width "source IP" -offset indent -compact 133a9073584Sbeck.It type 134a9073584Sbeck.Em WHITE 135a9073584Sbeckif whitelisted or 136a9073584Sbeck.Em GREY 137a9073584Sbeckif greylisted 138d0872fbcSbeck.It source IP 139c3be9b44SjmcIP address the connection originated from 1405b0222eaSbeck.It helo 1415b0222eaSbeckwhat the connecting host sent as identification in the HELO/EHLO command in the 1425b0222eaSbeckSMTP dialogue 143a9073584Sbeck.It from 144a9073584Sbeckenvelope-from address for 145a9073584Sbeck.Em GREY 146a9073584Sbeck(empty for 147a9073584Sbeck.Em WHITE 14876b670beSjmcentries) 149a9073584Sbeck.It to 150a9073584Sbeckenvelope-to address for 151a9073584Sbeck.Em GREY 152a9073584Sbeck(empty for 153a9073584Sbeck.Em WHITE 15476b670beSjmcentries) 155a9073584Sbeck.It first 156a9073584Sbecktime the entry was first seen 157a9073584Sbeck.It pass 158a9073584Sbecktime the entry passed from being 159a9073584Sbeck.Em GREY 160a9073584Sbeckto being 161a9073584Sbeck.Em WHITE 162a9073584Sbeck.It expire 163a9073584Sbecktime the entry will expire and be removed from the database 164a9073584Sbeck.It block 16576b670beSjmcnumber of times a corresponding connection received a temporary 166a9073584Sbeckfailure from 167a9073584Sbeck.Xr spamd 8 168a9073584Sbeck.It pass 169a9073584Sbecknumber of times a corresponding connection has been seen to pass 170a9073584Sbeckto the real MTA by 17176b670beSjmc.Xr spamlogd 8 172a9073584Sbeck.El 173a9073584Sbeck.Pp 17476b670beSjmcNote that times are in seconds since the Epoch, in the manner returned by 175a9073584Sbeck.Xr time 3 . 176813f99b6SjmcTimes may be converted to human readable format using: 177813f99b6Sjmc.Pp 178813f99b6Sjmc.Dl $ date -r <value> 1791f68c1d4Sbeck.Sh FILES 180633e51b9Sschwarze.Pa /var/db/spamd 1811f68c1d4Sbeck.Sh SEE ALSO 1821f68c1d4Sbeck.Xr spamd.conf 5 , 1831f68c1d4Sbeck.Xr spamd 8 , 1841f68c1d4Sbeck.Xr spamd-setup 8 1851f68c1d4Sbeck.Sh HISTORY 1861f68c1d4SbeckThe 1871f68c1d4Sbeck.Nm 1881f68c1d4Sbeckcommand 1891f68c1d4Sbeckappeared in 1901f68c1d4Sbeck.Ox 3.5 . 191