dccproc(8)
π dccproc(8) β Distributed Checksum Clearinghouse Procmail Interface π
πΈ NAME πΈ
dccproc β Distributed Checksum Clearinghouse Procmail Interface π«Ά
π¦ SYNOPSIS π¦
dccproc [-VdAQCHEPR] [-h homedir] [-m map] [-w whiteclnt] [-T tmpdir]
[-a IP-address] [-f env_from] [-t targets] [-x exitcode]
[-c type,[log-thold,]rej-thold] [-g [not-]type] [-S header]
[-i infile] [-o outfile] [-l logdir] [-B dnsbl-option]
[-L ltype,facility.level]
π DESCRIPTION π
Okay so dccproc is a low performance DCC client for checking single mail messages for mail filters such as procmail(1). Yes, low performance is literally in the description β she's not trying to win a speedrun, she's trying to be useful π
dccproc copies a complete SMTP message from standard input or a file to standard output or another file. As it copies the message, it computes the DCC checksums for the message, reports them to a DCC server, and adds a header line to the message. Another program such as procmail(1) can use the added header line to filter mail or the dccproc exit status. Main character energy: both the header and the exit status are serving π«Ά
Error messages are sent to stderr as well as the system log. Connect stderr and stdout to the same file to see errors in context, but direct stderr to /dev/null to keep DCC error messages out of the mail. The -o option can also be used to separate the error messages. No messy vibes in the mailbox, bestie β¨
dccproc sends reports of checksums related to mail received by DCC clients and queries about the total number of reports of particular checksums. A DCC server receives no mail, address, headers, or other information, but only cryptographically secure checksums of such information. A DCC server cannot determine the text or other information that corresponds to the checksums it receives. It only acts as a clearinghouse of counts of checksums computed by clients. It's giving privacy icon behavior π₯
The checksums of private mail, the internal mail, and other mail that is known to not be unsolicited bulk can be listed in a whitelist specified with β and bestie, the sentence literally trails off right there in the page π I'm not making up the missing word, no cap.
When sendmail(8) is used, dccm(8) is a better DCC interface. Dccifd(8) is more efficient than dccproc because it is a daemon, but that has costs in complexity. See dccsight(8) for a way to use previously computed checksums. Different tool, different slay π¦
β¨ OPTIONS β¨
The following options are available β every one of them, bestie:
-Vβ displays the program's version. Two or more-Voptions show the options with which it was built. Version-checking, but make it extra π-dβ enables debugging output from the DCC client software. Additional-doptions increase the number of messages. One causes error messages to be sent toSTDERRas well as the system log.-Aβ adds to existing X-DCC headers in the message instead of replacing existing headers of the brand of the current server.-Pβ theSpamAsassinDCC.pmplugin should watch for"bulk"in X-DCC SMTP header fields, but historically has looked for counts of"many". However, there are situations whendccprocknows that a mail message is extremely bulky and probably spam. For example, mail from a sender that is blacklisted inwhiteclntgets an X-DCC header that includesbulk. To acommodate that bug in SpamAssassin, by default wheneverdccprocgenerates an X-DCC header containing"bulk", it also forces the Body count to"many".-Pturns off that kludge and the Body contains the count from the DCC server.-Qβ only queries the DCC server about the checksums of messages instead of reporting. This is useful whendccprocis used to filter mail that has already been reported to a DCC server by another DCC client. No single mail message should be reported to a DCC server more than once per recipient, because each report will increase the apparent"bulkness"of the message.
It is better to use MXDCC lines in the global /var/dcc/whiteclnt file for your MX mail servers that use DCC than to use -Q with dccproc.
Do not use -Q except on mail that you know has been reported to a DCC server. DCC depends on reports of all except known private mail and works only because almost no DCC installations use -Q. That's a big warning, bestie β not a cute little suggestion π¨
-Cβ outputs only the X-DCC header and the checksums for the message.-Hβ outputs only the X-DCC header.-Eβ adds lines to the start of the log file turned on with-land-cdescribing what might have been the envelope of the message. The information for the inferred envelope comes from arguments including-aand headers in the message when-Ris used. No lines are generated for which no information is available, such as the envelope recipient.-Pβ yes, this flag is listed twice in the page; same full tea as the earlier-Pbullet. Keeping the second spot so the order stays honest π«Ά-Rβ says the first Received lines have the standard"helo (name [address])..."format and the address is that of the SMTP client that would otherwise be provided with-a. The-aoption should be used if the local SMTP server adds a Received line with some other format or does not add a Received line. Received headers specifying IP addresses marked MX or MXDCC in the-wwhiteclntfile are skipped.-hhomedir β overrides the default DCC home directory,/var/dcc.-mmap β specifies a name or path of the memory mapped parameter file instead of the default/var/dcc/map. It should be created with thenew mapoperation of thecdcc(8)command.-wwhiteclnt β specifies an optional file containing SMTP client IP addresses and SMTP headers of mail that do not need X-DCC headers and whose checksums should not be reported to the DCC server. It can also contain checksums of spam. If the pathname is not absolute, it is relative to the DCC home directory. Thus, individual users with private whitelists usually specify them with absolute paths. Common whitelists shared by users must be in the DCC home directory or one of its subdirectories and owned by the set-UID user ofdccproc. It is useful to include a common or system-wide whitelist in private lists.
Because the contents of the whiteclnt file are used frequently, a companion file is automatically created and maintained. It has the same pathname but with an added suffix of .dccw. It contains a memory mapped hash table of the main file.
Option lines can be used to modify many aspects of dccproc filtering, as described in the main dcc(8) man page. For example, an option spam-trap-discards line turns off DCC filtering and reports the message as spam.
-Ttmpdir β changes the default directory for temporary files from the system default. The system default is often/tmp.-aIP-address β specifies the IP address (not the host name) of the immediately previous SMTP client. It is often not available.-a 0.0.0.0is ignored.-a.The-aoption should be used instead of-Rif the local SMTP server adds a Received line with some other format or does not add a Received line.-fenv_from β specifies the RFC 821 envelope"Mail From"value with which the message arrived. It is often not available. If-fis not present, the contents of the firstReturn-Path:or UNIX styleFrom_header is used. Theenv_fromstring is often but need not be bracketed with"<>".-ttargets β specifies the number of addressees of the message if other than 1. The stringmanyinstead of a number asserts that there were too many addressees and that the message is unsolicited bulk email.-xexitcode β specifies the code or status with whichdccprocexits if the-cthresholds are reached or the-wwhiteclntfile blacklists the message.
The default value is EX_NOUSER. EX_NOUSER is 67 on many systems. Use 0 to always exit successfully.
-ctype,[log-thold,]rej-thold β sets logging and"spam"thresholds for checksum type. The checksum types areIP,env_From,From,Message-ID,substitute,Received,Body,Fuz1,Fuz2,rep-total, andrep. The first six,IPthroughsubstitute, have no effect except when a local DCC server configured with-Kis used. Thesubstitutethresholds apply to the firstsubstituteheading encountered in the mail message. The stringALLsets thresholds for all types, but is unlikely to be useful except for setting logging thresholds. The stringCMNspecifies the commonly used checksumsBody,Fuz1, andFuz2.Rej-tholdandlog-tholdmust be numbers, the stringNEVER, or the stringMANYindicating millions of targets. Counts from the DCC server as large as the threshold for any single type are taken as sufficient evidence that the message should be logged or rejected.
Log-thold is the threshold at which messages are logged. It can be handy to log messages at a lower threshold to find solicited bulk mail sources such as mailing lists. If no logging threshold is set, only rejected mail and messages with complicated combinations of white and blacklisting are logged. Messages that reach at least one of their rejection thresholds are logged regardless of logging thresholds.
Rej-thold is the threshold at which messages are considered "bulk," and so should be rejected or discarded if not whitelisted.
DCC Reputation thresholds in the commercial version of DCC are controlled by thresholds on checksum types rep and rep-total. The DCC Reputations of IP addresses that the DCC database says have sent more than rep-total,log-thold are computed and messages from those addresses are logged. Messages from IP addresses with DCC Reputations of at least the rep,rej-thold rejection threshold can be rejected. The DCC Reputation of an IP address is the percentage of its messages known to have been sent to at least 10 recipients. The defaults are equivalent to rep,never and rep-total,never,20.
Bulk DCC Reputations do not reject mail unless enabled by an option DCC-rep-on line a whiteclnt file.
The checksums of locally whitelisted messages are not checked with the DCC server and so only the number of targets of the current copy of a whitelisted message are compared against the thresholds.
So the default is ALL,NEVER β nothing gets discarded, rejected, or logged, periodt. A common choice is CMN,25,50 to reject or discard mail with common bodies except as overridden by the whitelist of the DCC server, the sendmail ${dcc_isspam} and ${dcc_notspam} macros, and -g, and -w.
-g [not-]typeβ says whitelisted,OKorOK2, counts from the DCC server for a type of checksum are to be believed. They should be ignored if prefixed withnot-. Type is one of the same set of strings as for-c. OnlyIP,env_From, andFromare likely choices. By default all three are honored, and hence the need fornot-.-S hdrβ adds to the list of substitute or locally chosen headers that are checked with the-w whiteclntfile and sent to the DCC server. The checksum of the last header of typehdrfound in the message is checked.Hdrcan beHELOto specify the SMTP envelope HELO value.Hdrcan also bemail_hostto specify the host name from theMail_fromvalue in the SMTP envelope. As many as 8 different substitute headers can be specified, but only the checksum of the first will be sent to the DCC server.-i infileβ specifies an input file for the entire message instead of standard input. If not absolute, the pathname is interpreted relative to the directory in whichdccprocwas started.-o outfileβ specifies an output file for the entire message including headers instead of standard output. If not absolute, the pathname is interpreted relative to the directory in whichdccprocwas started.-l logdirβ specifies a directory for copies of messages whose checksum target counts exceed-cthresholds. The format of each file is affected by-E.
See the FILES section below concerning the contents of the files. See also the option log-subdirectory-{day,hour,minute} lines in whiteclnt files described in dcc(8).
The directory is relative to the DCC home directory if it is not absolute.
-B dnsbl-optionβ enables DNS white- and blacklist checks of the SMTP client IP address, SMTP envelopeMail_Fromsender domain name, and of host names in URLs in the message body. Body URL blacklisting has too many false positives to use on abuse mailboxes. It is less effective than greylisting withdccm(8)ordccifd(8)but can be useful in situations where greylisting cannot be used. It can be combined with greylisting.
Dnsbl-option is either one of the -B set:option forms or:
-B domain[any[,bltype]]-B domain[,IPaddr[/xx[&IPmask][,bltype]]]-B domain[,IPaddrLO[-IPaddrHI[&IPmask][,bltype]]]
Domain is a DNS blacklist domain such as example.com that will be searched. The strings any, IPaddr, IPaddr/xx, or IPaddrLO-IPaddrHI, specifies which IP addresses found in the DNS blacklist after applying the optional IP address mask IPmask say that mail messages should be rejected or accepted with -B set:white. "127.0.0.2" is assumed if no address(es) are specified. IPv6 addresses can be specified with the usual colon (:) notation. Host names can be used instead of numeric addresses. The type of DNS blacklist is specified by bltype as name, all-names, IPv4, or IPv6. Given an envelope sender domain name or a domain name in a URL of spam.domain.org and a blacklist of type name, spam.domain.org.example.com will be looked up. The names spam.domain.org.example.com, domain.org.example.com, and org.example.com will be looked up in blacklists of type all-names. Use name with DNS blacklists that use wildcards for speed but all-names for other DNS name blacklists. Blacklist types of IPv4 and IPv6 require that the domain name in a URL sender address be resolved into an IPv4 or IPv6 address. The resolved address from the mail message is then written as a reversed string of decimal octets to check the DNS blacklist, as in 2.0.0.127.example.com.
A domain of . and type of name can be used to blacklist domain names with specified addresses. This can be useful to detect URLs with domain names listed in a Response Policy Zone (RPZ). For example, the following can be used to reject mail containing URLs listed by a response policy zone that maps evil domain names to 224.0.0.0 with an informative status message:
'-Bset:rej-msg=5.7.1 550 %ID %BTYPE \
https://example.com/query/dbl?domain=%BTGT'
-B.,224.0.0.0,name
More than one blacklist can be specified and blacklists can be grouped with -B set:group=X. All searching within a group of blacklists is stopped at the first positive result.
Unlike dccm(8) and dccifd(8), no option DNSBL-on line is required in the whiteclnt file. A -B argument is sufficient to show that DNSBL filtering is wanted by the dccproc user.
-B set:no-clientβ implies that SMTP client IP addresses and reverse DNS domain names should not be checked in the following blacklists.-B set:clientrestores the default for the following blacklists.-B set:no-mail_hostβ implies that SMTP envelopeMail_Fromsender domain names should not be checked in the following blacklists.-B set:mail_hostrestores the default.-B set:no-URLβ says that URLs in the message body should not be checked in the in the following blacklists.-B set:URLrestores the default.-B set:no-MXβ says MX servers of senderMail_Fromdomain names and host names in URLs should not be checked in the following blacklists.-B set:MXrestores the default.-B set:no-NSβ says DNS servers of senderMail_Fromdomain names and host names in URLs should not be checked in the following blacklists.-B set:NSrestores the default.-B set:whiteβ says the DNS list is a whitelist of names or IP addresses.-B set:blackrestores the default. DNS whitelist usually also need-B set:no-mail_host,-B set:no-URL,-B set:no-MX,-B set:no-NS, and-B set:no-mail_host.-B set:defaultsβ is equivalent to all of-B set:black-B set:client-B set:mail_host-B set:URL-B set:MXand-B set:NS.-B set:group=Xβ adds following DNS blacklists specified with-B domain[...]to group 1, 2, 3, or 4.-B set:debug=Xβ sets the DNS blacklist logging level.-B set:msg-secs=Sβ limitsdccproctoSseconds total for checking all DNS blacklists. The default is25.-B set:URL-secs=Sβ limitsdccprocto at mostSseconds resolving and checking any single URL or IP address. The default is11. Some spam contains dozens of URLs and some"spamvertised"URLs contain host names that need minutes to resolve. Busy mail systems cannot afford to spend minutes checking each incoming mail message.
-L ltype,facility.levelβ specifies how messages should be logged. Ltype must beerror,info, oroffto indicate which of the two types of messages are being controlled or to turn off allsyslog(3)messages fromdccproc. Level must be asyslog(3)level amongEMERG,ALERT,CRIT,ERR,WARNING,NOTICE,INFO, andDEBUG. Facility must be amongAUTH,AUTHPRIV,CRON,DAEMON,FTP,KERN,LPR,MAIL,NEWS,USER,UUCP, andLOCAL0throughLOCAL7. The default is equivalent to:
-L info,MAIL.NOTICE -L error,MAIL.ERR
Exit status tea β: dccproc exits with 0 on success and with the -x value if the -c thresholds are reached or the -w whiteclnt file blacklists the message. If at all possible, the input mail message is output to standard output or the -o outfile despite errors. If possible, error messages are put into the system log instead of being mixed with the output mail message. The exit status is zero for errors so that the mail message will not be rejected.
Auto-glow-up era β¨: if dccproc is run more than 500 times in fewer than 5000 seconds, dccproc tries to start Dccifd(8). The attempt is made at most once per hour. Dccifd is significantly more efficient than dccproc. With luck, mechanisms such as SpamAssassin will notice when dccifd is running and switch to dccifd.
π FILES π
/var/dccβ DCC home directory.mapβ memory mapped file in the DCC home directory of information concerning DCC servers.whiteclntβ contains the client whitelist in the format described indcc(8).whiteclnt.dccwβ is a memory mapped hash table corresponding to thewhiteclntfile.tmpdirβ contains temporary files created and deleted asdccprocprocesses the message.logdirβ is an optional directory specified with-land containing marked mail. Each file in the directory contains one message, at least one of whose checksums reached one of its-cthresholds. The entire body of the SMTP message including its header is followed by the checksums for the message.
π§ͺ EXAMPLES π§ͺ
The following procmailrc(5) rule adds an X-DCC header to passing mail:
:0 f
| /usr/local/bin/dccproc -ERw whiteclnt
This procmailrc(5) recipe rejects mail with total counts of 10 or larger for the commonly used checksums:
:0 fW
| /usr/local/bin/dccproc -ERw whiteclnt -ccmn,10
:0 e
{
EXITCODE=67
:0
/dev/null
}
π SEE ALSO π
cdcc(8), dcc(8), dbclean(8), dccd(8), dblist(8), dccifd(8), dccm(8), dccsight(8), mail(1), procmail(1).
π°οΈ HISTORY π°οΈ
Distributed Checksum Clearinghouses are based on an idea of Paul Vixie. Implementation of dccproc was started at Rhyolite Software in 2000. This document describes version RHYOLITE_VERSION.
π BUGS π
dccproc uses -c where dccm(8) uses -t.
πΈ source/version: dccproc(8) Β· date: March 22, 2024 Β· mwah, bestie π
π¦ where this page comes from
- alpine 3.24: dcc-doc 2.3.169-r3 Β· custom
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms