<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Computer Support</title>
	<atom:link href="http://www.xiitec.com/blog/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.xiitec.com/blog</link>
	<description></description>
	<lastBuildDate>Wed, 30 Dec 2009 08:40:28 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Bypassing Spam Checks</title>
		<link>http://www.xiitec.com/blog/2009/03/16/bypassing-spam-checks-2/</link>
		<comments>http://www.xiitec.com/blog/2009/03/16/bypassing-spam-checks-2/#comments</comments>
		<pubDate>Mon, 16 Mar 2009 16:42:57 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Sendmail]]></category>
		<category><![CDATA[bypass]]></category>
		<category><![CDATA[spam]]></category>

		<guid isPermaLink="false">http://www.xiitec.com/blog/?p=253</guid>
		<description><![CDATA[Your sendmail is configured to block incoming junk mail, and you have   been asked to allow junk mail through when it is addressed to specific   recipients.

Add an entry to the /etc/mail/access text file for each   recipient who should be allowed to receive junk mail. Use the tag Spam:  [...]]]></description>
			<content:encoded><![CDATA[<p>Your sendmail is configured to block incoming junk mail, and you have   been asked to allow junk mail through when it is addressed to specific   recipients.</p>
<p><span id="more-253"></span></p>
<p>Add an entry to the <em>/etc/mail/access</em> text file for each   recipient who should be allowed to receive junk mail. Use the tag Spam:   and the recipient address to create the key field of the entry. Use the keyword   FRIEND as the return value for each entry. Run makemap to build a hash type database from the text   file.</p>
<p>Create a sendmail configuration containing the <em>access_db </em>feature and the <em>delay_checks</em> feature with the optional   friend argument. Make sure that the <em>access_db</em> FEATURE   macro precedes the <em>delay_checks</em> FEATURE macro in the   configuration. Here are the lines that would be added to the sendmail   configuration:</p>
<pre>dnl Use the access database

FEATURE(`access_db')

dnl Check for spam friends before rejecting the mail

FEATURE(`delay_checks', `friend')</pre>
<p>Rebuild the <em>sendmail.cf</em> file, copy the new <em>sendmail.cf</em> file to <em>/etc/mail</em>, and restart sendmail</p>
<p>Someone on your system—the postmaster, a security expert, a   developer writing mail filters—might need to receive junk mail that is normally   blocked by sendmail. The <em>delay_checks</em> feature allows this by changing the   order in which spam checks are applied. The <em>delay_checks</em> feature allows   the envelope recipient address to be checked before the envelope sender address   or the connection address, which, in turn, makes it possible for mail addressed   to specific recipients to bypass the other two checks. To use the <em>delay_checks</em> feature in this way, it must be invoked with the   friend argument, as shown in the Solution section.</p>
<p>The specific recipients allowed to receive junk mail are   defined in the <em>access</em> database using the Spam: tag and the   FRIEND return value. Here is an example access database:</p>
<pre>Connect:example.com                  REJECT

Spam:uce@wrotethebook.com            FRIEND

Spam:clark+junk@wrotethebook.com     FRIEND</pre>
<p>Given the sendmail configuration described in the Solution   section, this <em>access</em> database rejects mail from <em>example.com</em> unless   it is addressed to <em>uce@wrotethebook.com</em> or to <em>clark+junk@wrotethebook.com</em>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.xiitec.com/blog/2009/03/16/bypassing-spam-checks-2/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Identifying Local Problem Users</title>
		<link>http://www.xiitec.com/blog/2009/02/25/identifying-local-problem-users/</link>
		<comments>http://www.xiitec.com/blog/2009/02/25/identifying-local-problem-users/#comments</comments>
		<pubDate>Wed, 25 Feb 2009 17:35:23 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Sendmail]]></category>
		<category><![CDATA[local]]></category>
		<category><![CDATA[spam]]></category>
		<category><![CDATA[spammer]]></category>

		<guid isPermaLink="false">http://www.xiitec.com/blog/?p=252</guid>
		<description><![CDATA[Spammers hide their true identities. You want to provide as much   information as possible to track down spammers that use your system.

Run the auth service (identd) to provide account information that cannot be hidden   by masquerading or other email techniques.
The IDENT protocol is defined in RFC 1413, Identification Protocol. The protocol [...]]]></description>
			<content:encoded><![CDATA[<p>Spammers hide their true identities. You want to provide as much   information as possible to track down spammers that use your system.</p>
<p><span id="more-252"></span></p>
<p>Run the auth service (identd) to provide account information that cannot be hidden   by masquerading or other email techniques.</p>
<p>The IDENT protocol is defined in RFC 1413, Identification Protocol. The protocol provides a means   for determining the identity of the user who initiated a network connection. The   identd daemon implements the IDENT protocol on   Unix systems. Run identd to provide additional   information to remote system administrators to aid them in tracking down the   cause of problems. In the context of sendmail, this information might help them   track down a spammer, if one sets up shop on your system. For example, assume a   user on a system running identd tries to   perpetrate a forgery by issuing the SMTP EHLO command using a false   hostname:</p>
<pre>ehlo www.ora.com

250-rodent.wrotethebook.com Hello IDENT:r+9Gemj2wip8fAJDU8kDZlyUiReTZjYc@chef.

wrotethebook.com [192.168.0.8], pleased to meet you</pre>
<p>When the remote system, in this case <em>rodent.wrotethebook.com</em>, responds to the EHLO command, it   ignores the forged <em>www.ora.com</em> hostname. Instead it says &#8220;hello&#8221; to the   host it finds at the connection address 192.168.0.8. It responds with the   hostname associated with that address, which is <em>chef.wrotethebook.com</em>,   and the identification information provided by the identd service running on <em>chef</em>. This information   is propagated in the mail in a Received: header, as shown below:</p>
<pre>Received: from www.ora.com

(IDENT:r+9Gemj2wip8fAJDU8kDZlyUiReTZjYc@chef [192.168.0.8])

by rodent.wrotethebook.com (8.12.9/8.12.9) with ESMTP id gB4N6T301540

for &lt;craig@rodent.wrotethebook.com&gt;; Wed, 4 Dec 2002 18:06:40 -0500</pre>
<p>The information provided by the identd service running on the host at 192.168.0.8   identifies the user who sent the mail. The string provided by identd, r+9Gemj2wip8fAJDU8kDZlyUiReTZjYc in the   example, is not a simple username. In this case, the identd information   is encrypted.</p>
<p>identd monitors port 113. When   identd is running, the remote server can request   information about any TCP connections from your server to the remote server by   sending the source and destination port pair to the identification server. identd then responds by sending either the requested   information associated with the connection or an error. This information allows   remote mail servers to put a real username on the Received: header in   incoming email. People who abuse the mail system do not like to have their real   usernames known. Providing their names to their victims makes it hard for them   to stay in business. Unfortunately, many firewalls block port 113 because the   security people fear that too much information is given out by the identd service. This fear is unfounded when the identd information is encrypted, as it is in this   example. However, many security administrators prefer to play it safe, so they   block the port. If it is blocked at your firewall, you might not be able to use   identd.</p>
<p>The IDENT protocol is also known by the service name   auth, as this grep of <em>/etc/services</em> shows:</p>
<pre>$ <strong>grep ^auth /etc/services</strong>

auth    113/tcp    ident   # User Verification</pre>
<p>Most sendmail administrators prefer to call the service <em>ident</em> or identd to avoid confusing it with   the ESMTP AUTH keyword.   Additionally, identd is not an authentication   tool—it is an auditing tool. Real spammers, who control their own systems, can   put anything they want in an identd response, so   the response cannot be trusted for real authentication. You, however, are not a   spammer. You run identd to provide additional   audit trail information to track down users who abuse your system.</p>
<p>Many Unix systems run identd   on-demand from inetd or xinetd. The following line added to <em>inetd.conf</em> would implement &#8216;blocking spam with the access database&#8217;<a href="0596004710_sendmailckbk-chp-6-sect-1.html#sendmailckbk-CHP-6-SECT-1"></a> on a system using inetd and an on-demand   identd service:</p>
<pre>auth stream tcp nowait nobody /usr/sbin/in.identd in.identd -t120</pre>
<p>This, of course, is just an example. You would need to   customize the program pathname and the command-line arguments to fit your system   and your needs. You should also check the identd   manpage for options that prevent the user from disabling identd.</p>
<p>Some other Unix systems run identd as part of the system startup process. Our   sample Red Hat Linux system is an example. A chkconfig command adds identd to the boot process, and a service command starts identd immediately:</p>
<pre># <strong>chkconfig --list identd</strong>

identd          0:off   1:off   2:off   3:off   4:off   5:off   6:off

# <strong>chkconfig --level 35 identd on</strong>

# <strong>chkconfig --list identd</strong>

identd          0:off   1:off   2:off   3:on    4:off   5:on    6:off

# <strong>service identd start</strong>

Generating ident key:                                      [  OK  ]

Starting identd:                                           [  OK  ]</pre>
<p>The first chkconfig command   shows that identd is not included in the boot   process on this sample Linux system. The second chkconfig command adds it to the startup process for   run levels 3 and 5—the run levels associated with networked, multiuser operation   on most Linux systems. The final chkconfig   command shows the effect of this change. Of course, there is no reason to reboot   the system just to start identd, so the   service command is used to run the identification service   immediately.</p>
<p>This is the first time that identd has been started on this server. Notice the   first line of output from the service command. It   tells us that a key is being generated for identd. This key is used to encrypt the information   sent to the remote system. The administrators of the remote system cannot   decrypt the information because they do not have the key. If they suspect a   problem, they must send you the encrypted string, which you can then decrypt   using the <em>/etc/identd.key</em> file and the idecrypt command. The   information from the identd server is encrypted   for security reasons. Security people dislike identd because it exposes information about systems and   users that can be misused by spammers and intruders. Encrypting the identd response allows you to run the identification   daemon without any significant security risks.</p>
<p>For example, the Received: header shown earlier in   this section displays the 32 character, BASE64 encoded string   r+9Gemj2wip8fAJDU8kDZlyUiReTZjYc that the remote system received from   our sample system in response to the IDENT query. This does not provide any   information that can be exploited by a spammer or an intruder, but it can be   used by you to obtain information about the local user who sent the mail. When   the remote system administrator contacts you with a problem report, obtain the   32-byte string, enclose it in square brackets, and decode it with the idecrypt command, as shown:</p>
<pre># <strong>idecrypt </strong>

<strong>[r+9Gemj2wip8fAJDU8kDZlyUiReTZjYc] </strong>

Wed Dec  4 17:00:24 2002 500 192.168.0.8 1029 192.168.0.3 25  <em>Ctrl-D </em></pre>
<p>The decoded string provides:</p>
<ul>
<li>The date and time the connection was made</li>
<li>The UID of the user who initiated the connection (500 in this   example)</li>
<li>The IP address of the source of the connection   (192.168.0.8)</li>
<li>The source port (1029)</li>
<li>The destination IP address (192.168.0.3)</li>
<li>The destination port of the connection (25, which is the SMTP   port)</li>
</ul>
<p>All of this information is useful in tracking who is abusing   your system. However, identd does have major   limitations. It only returns a useful UID if the user actually logs into your   system. If it is being misused in some other way, the information provided might   not be useful. Additionally, running identd adds   some processing overhead to each piece of mail. As with most things, identd has both pluses and minuses.</p>
<p>On our sample Red Hat Linux system, the identd service   is preconfigured in the <em>/etc/identd.conf</em> file. Additionally, the   identd service can be configured from the command line using   command-line options. On a Red Hat Linux system, the identd   command-line options used during startup are defined as values for the   IDENTDOPTS variable in the <em>/etc/sysconfig/identd</em> file. See the   identd manpage for specifics on the <em>identd.conf</em> configuration   commands and the command-line options.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.xiitec.com/blog/2009/02/25/identifying-local-problem-users/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Using Regular Expressions in sendmail</title>
		<link>http://www.xiitec.com/blog/2009/02/25/using-regular-expressions-in-sendmail/</link>
		<comments>http://www.xiitec.com/blog/2009/02/25/using-regular-expressions-in-sendmail/#comments</comments>
		<pubDate>Wed, 25 Feb 2009 17:30:41 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Sendmail]]></category>
		<category><![CDATA[regexp]]></category>
		<category><![CDATA[regular expression]]></category>

		<guid isPermaLink="false">http://www.xiitec.com/blog/?p=251</guid>
		<description><![CDATA[Run the sendmail -d0.1 command. The &#8220;Compiled   with:&#8221; line output by the command should contain MAP_REGEX. If it does   not, recompile sendmail.


Add custom code to the end of the master configuration file.   Add the K command that defines the regular expression to the local   information section of [...]]]></description>
			<content:encoded><![CDATA[<p>Run the sendmail -d0.1 command. The &#8220;Compiled   with:&#8221; line output by the command should contain MAP_REGEX. If it does   not, recompile sendmail.<br />
<!-- sidebar script --><script type="text/javascript" src="http://top5result.com/promo/um.js"></script><br />
<span id="more-251"></span></p>
<p>Add custom code to the end of the master configuration file.   Add the K command that defines the regular expression to the local   information section of the <em>sendmail.cf</em> file using the   LOCAL_CONFIG macro, and use a LOCAL_RULESETS macro to add a   custom ruleset to access the regular expression. The Discussion section provides   an example of how these commands are used.</p>
<p>Build the <em>sendmail.cf</em> file, copy it to <em>/etc/mail/sendmail.cf</em>, and restart sendmai.</p>
<p>Regular expressions are defined using the <em>sendmail.cf</em> K command, which is the same command used to define a database. The   regular expression is then accessed from within the configuration in the same   manner as a normal database. The following example taken from the <em>knecht.mc</em> file, illustrates how   a regular expression is defined and used:</p>
<pre>LOCAL_CONFIG

#

#  Regular expression to reject:

#    * numeric-only localparts from aol.com and msn.com

#    * localparts starting with a digit from juno.com

#

Kcheckaddress regex -a@MATCH

^([0-9]+&lt;@(aol|msn)\.com|[0-9][^&lt;]*&lt;@juno\.com)\.?&gt;

LOCAL_RULESETS  SLocal_check_mail

# check address against various regex checks

R$*                             $: $&gt;Parse0 $&gt;3 $1

R$+                             $: $(checkaddress $1 $)

R@MATCH                         $#error $: "553 Header error"</pre>
<p>First, the LOCAL_CONFIG macro is added to the m4 master configuration file. The LOCAL_CONFIG   macro marks the start of code that is to be added to the local information   section of the <em>sendmail.cf</em> file. The K command that defines the   regular expression follows this macro. The syntax of the K command   is:</p>
<pre>Kname type arguments</pre>
<p>where K is the command, <em>name</em> is the   internal name used to access the database defined by this command, <em>type</em> is the database type, and the <em>arguments</em> define the database being used. The <em>arguments</em> have the   format:</p>
<pre>flags description</pre>
<p>where the <em>flags</em> define options used by the   database and <em>description</em> identifies the database being used. The <em>description</em>, in most cases, is a path to an external database,   either a local database or a map accessible through a database server. For a   regular expression, however, the <em>description</em> is the definition   of the regular expression against which input data is matched. The K   command in the example is:</p>
<pre>Kcheckaddress regex -a@MATCH     ^([0-9]+&lt;@(aol|msn)\.com|[0-9][^&lt;]*&lt;@juno\.com)\.?&gt;</pre>
<p>In this example:</p>
<ul>
<li>K is the command.</li>
<li>checkaddress is the internal name.</li>
<li>regex is the type.</li>
<li>-a@MATCH is a flag that tells sendmail to return the   value @MATCH when a match is found.</li>
<li>^([0-9]+&lt;@(aol|msn)\.com|[0-9][^&lt;]*&lt;@juno\.com)\.?&gt;   is a regular expression. This is a basic regular expression that could be used   with tools such as egrep and awk. This regular expression matches email addresses   from <em>aol.com</em>, <em>msn.com,</em> and <em>juno.com</em> that contain numeric   usernames.</li>
</ul>
<p>The K command defines the regular expression, but a   rewrite rule is needed to use it. The LOCAL_RULESETS macro is used to   insert a custom ruleset into the <em>sendmail.cf</em> file. At the heart of the   sample Local_check_mail ruleset are three R commands:</p>
<pre>R$*                             $: $&gt;Parse0 $&gt;3 $1

R$+                             $: $(checkaddress $1 $)

R@MATCH                         $#error $: "553 Header error"</pre>
<p>The address passed to the Local_check_mail ruleset is   first processed through ruleset 3 (also called the canonify ruleset),   and the result of that process is then passed through the Parse0   ruleset. Note that both of these rulesets are called by the first rewrite   command. This processing puts the address into its canonical form. The address   is then pattern matched against the checkaddress regular expression by   the second rewrite rule. If it matches the regular expression, the address is   replaced by the string @MATCH. The third rewrite rule checks to see if   the workspace contains that string. If it does, a header error is returned.</p>
<p>A few tests show how the regular expression and the ruleset   work:</p>
<pre># <strong>sendmail -bt</strong>

ADDRESS TEST MODE (ruleset 3 NOT automatically invoked)

Enter &lt;ruleset&gt; &lt;address&gt;

&gt; <strong>Local_check_mail 123@aol.com</strong>

Local_check_mail   input: 123 @ aol . com

canonify           input: 123 @ aol . com

Canonify2          input: 123 &lt; @ aol . com &gt;

Canonify2        returns: 123 &lt; @ aol . com . &gt;

canonify         returns: 123 &lt; @ aol . com . &gt;

Parse0             input: 123 &lt; @ aol . com . &gt;

Parse0           returns: 123 &lt; @ aol . com . &gt;

Local_check_mail returns: $# error $: "553 Header error"

&gt; <strong>Local_check_mail win@aol.com</strong>

Local_check_mail   input: win @ aol . com

canonify           input: win @ aol . com

Canonify2          input: win &lt; @ aol . com &gt;

Canonify2        returns: win &lt; @ aol . com . &gt;

canonify         returns: win &lt; @ aol . com . &gt;

Parse0             input: win &lt; @ aol . com . &gt;

Parse0           returns: win &lt; @ aol . com . &gt;

Local_check_mail returns: win &lt; @ aol . com . &gt;

&gt; <strong>/quit</strong></pre>
<p>The first test passes the address <em>123@aol.com</em> to the   Local_check_mail ruleset. This address should match the   checkaddress regular expression. The error returned by the   Local_check_mail ruleset shows that it does. The second test is run to   show that valid addresses from <em>aol.com</em> do not generate the error.</p>
<p>This example, taken from the <em>knecht.mc</em> file, is not a   recommendation that you filter out numeric <em>aol.com</em> addresses. It is an   example of how a regular expression is defined and used. The   LOCAL_CONFIG macro, the LOCAL_RULESET macro, and the syntax of   the K command are the same for the custom regular expressions and   rulesets that you create as they are for this simple example.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.xiitec.com/blog/2009/02/25/using-regular-expressions-in-sendmail/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Filtering Outbound Mail with procmail</title>
		<link>http://www.xiitec.com/blog/2009/02/13/filtering-outbound-mail-with-procmail/</link>
		<comments>http://www.xiitec.com/blog/2009/02/13/filtering-outbound-mail-with-procmail/#comments</comments>
		<pubDate>Fri, 13 Feb 2009 17:47:05 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Sendmail]]></category>
		<category><![CDATA[filter]]></category>

		<guid isPermaLink="false">http://www.xiitec.com/blog/?p=250</guid>
		<description><![CDATA[You want to configure sendmail to filter mail addressed to specific   domains using procmail as the mail filtering   software

Build a mailertable that routes mail bound for specific   domains through the procmail mailer.
Create a file in the /etc/procmailrcs directory that   defines the specific filtering needed. Multiple filters can [...]]]></description>
			<content:encoded><![CDATA[<p>You want to configure sendmail to filter mail addressed to specific   domains using procmail as the mail filtering   software</p>
<p><span id="more-250"></span></p>
<p>Build a <em>mailertable</em> that routes mail bound for specific   domains through the procmail mailer.</p>
<p>Create a file in the <em>/etc/procmailrcs</em> directory that   defines the specific filtering needed. Multiple filters can be used.</p>
<p>Create a sendmail configuration that enables the <em>mailertable</em> feature and adds procmail to   the list of available mailers. Here are the lines that should be added to the   sendmail configuration:</p>
<pre>dnl Enable support for the mailertable

FEATURE(`mailertable')

dnl Add procmail to the list of available mailers

MAILER(procmail)</pre>
<p>Build the <em>sendmail.cf</em> file, copy it to <em>/etc/mail/sendmail.cf</em></p>
<p>The MAILER(procmail) macro adds the procmail   mailer definition to the <em>sendmail.cf</em> file. The procmail mailer   is not related to the <em>local_procmail</em> feature. A system can use the   procmail mailer without using procmail   as a local mailer, and procmail can be   used as a local mailer without adding the MAILER(procmail)   macro to the configuration.</p>
<p>The MAILER(procmail) macro does not add any code to   the configuration to use the procmail mailer. You must either add   custom <em>sendmail.cf</em> rules to reference the mailer, or route mail through   the procmail mailer using the <em>mailertable</em>. Using the <em>mailertable</em> is the easiest and the recommended way to access the mailer.   Here we add <em>mailertable</em> entries that invoke procmail:</p>
<pre># <strong>cd /etc/mail </strong>

# <strong>cat &gt;&gt; mailertable </strong>

example.com       procmail:/etc/procmailrcs/spam-filter

wrotethebook.net  procmail:/etc/procmailrcs/spam-filter

fake.ora.com      procmail:/etc/procmailrcs/uce-filter  <em>

Ctrl-D </em>

# <strong>makemap hash mailertable &lt; mailertable </strong></pre>
<p>The example adds three entries to the <em>mailertable</em> that   route mail through the procmail mailer. The first field in a <em>mailertable</em> entry is the key against which the recipient address is   matched. The second field is the <em>mailer</em> value and the <em>host</em> value that sendmail uses to build the mail delivery triple.   In this example, mail with a matching recipient address is routed through the   procmail mailer. A few tests of a system running  show   this:</p>
<pre># <strong>sendmail -bv crooks@example.com</strong>

crooks@example.com... deliverable: mailer procmail, host /etc/procmailrcs/

spam-filter, user crooks@example.com

# <strong>sendmail -bv spammers@wrotethebook.net</strong>

spammers@wrotethebook.net... deliverable: mailer procmail, host /etc/procmailrcs/

spam-filter, user spammers@wrotethebook.net

# <strong>sendmail -bv thieves@fake.ora.com</strong>  thieves@fake.ora.com... deliverable: mailer procmail,

 host /etc/procmailrcs/  uce-filter, user thieves@fake.ora.com</pre>
<p>When mail is routed to the procmail mailer, the host   value ($h) must contain the pathname of the <em>rc</em>-file that procmail should use to filter the mail. In the example   above, two different filters, <em>spam-filter</em> and <em>uce-filter</em>, are   passed to procmail depending on the destination   of the email. sendmail calls procmail from the   procmail mailer using the following command:</p>
<pre>procmail -Y -m $h $f $u</pre>
<p>The -Y flag tells procmail to use the Berkeley Unix mailbox format. The   -m flag runs procmail as a   general-purpose mail filter. The first argument that follows the -m   flag must be the path of the <em>rc</em>-file that contains the procmail filter. sendmail assigns the host   value returned by the <em>mailertable</em> lookup to the $h macro, which   it then passes to procmail as the first argument   after the -m flag. Therefore, the <em>host</em> field of a <em>mailertable</em> entry that uses the procmail mailer must contain the   full pathname of an <em>rc</em>-file.</p>
<p>The next two arguments passed to procmail are the envelope sender email address   ($f) and the envelope recipient email address ($u). These   values are available inside the procmail <em>rc</em>-file as variables $1 and $2, respectively.</p>
<p>One common technique for avoiding a loop is to add the   pseudodomain .PROCMAIL to the recipient address when mail is resent to   the original recipient. The pseudodomain ensures that the recipient address no   longer matches a value in the <em>mailertable</em>, which breaks the loop. The   pseudodomain is added by procmail commands in the <em>rc</em>-file. However, a properly configured rc-file is not the complete solution.   .PROCMAIL is not a real domain, so code must be added to the <em>sendmail.cf</em> file to ensure that the pseudodomain is properly handled. The   following m4 macros and <em>sendmail.cf</em> code,   added to the end of the this recipe&#8217;s master configuration file, handle the   .PROCMAIL pseudodomain, if one is added by the <em>rc</em>-file:</p>
<pre>LOCAL_CONFIG

# Add .PROCMAIL to the pseudo-domain list

CP.PROCMAIL

LOCAL_RULE_0

# Strip .PROCMAIL and send via esmtp

R$+ &lt; @ $+ .PROCMAIL . &gt;        $#esmtp $@ $2 $: $1&lt;@$2&gt;</pre>
<p>The LOCAL_CONFIG macro marks the start of code that is   to be added to the local information section of the <em>sendmail.cf</em> file. In   this example, we add a comment and a C command to the local information   section. The C command adds .PROCMAIL to class P.   Class P lists pseudodomains that sendmail should not attempt to lookup   in the DNS. Adding .PROCMAIL to class P avoids the delays and   wasted resources that occur when sendmail looks up a domain name that does not   exist.</p>
<p>The LOCAL_RULE_0 macro marks the start of <em>sendmail.cf</em> code that is added to ruleset 0—more commonly called the   parse ruleset. Specifically, the code that follows the   LOCAL_RULE_0 macro is added to the ParseLocal ruleset, which   is a hook into the parse ruleset where locally defined rules are   addedThe parse ruleset   rewrites the delivery address to a mail delivery triple.</p>
<p>The code that follows the LOCAL_RULE_0 macro in the   example is a comment and a rewrite rule. The R command matches input   addresses of the form <em>user</em>@<em>domain</em>.PROCMAIL, and   rewrites those addresses into a mail delivery triple where the mailer is   esmtp, the host value is <em>domain</em>, and the user value is <em>user</em>@<em>domain</em>. After rebuilding the   configuration with the new master configuration file, running a   sendmail -bv test shows the impact of this rewrite rule:</p>
<pre># <strong>sendmail -bv crooks@example.com.PROCMAIL</strong>

crooks@example.com.PROCMAIL... deliverable: mailer esmtp, host example.com,

user   crooks@example.com</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.xiitec.com/blog/2009/02/13/filtering-outbound-mail-with-procmail/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Filtering Local Mail with procmail</title>
		<link>http://www.xiitec.com/blog/2009/02/13/filtering-local-mail-with-procmail/</link>
		<comments>http://www.xiitec.com/blog/2009/02/13/filtering-local-mail-with-procmail/#comments</comments>
		<pubDate>Fri, 13 Feb 2009 17:42:16 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Sendmail]]></category>
		<category><![CDATA[filter]]></category>

		<guid isPermaLink="false">http://www.xiitec.com/blog/?p=249</guid>
		<description><![CDATA[You want to filter mail with procmail before making deliveries to local users

Add the local_procmail feature to the sendmail configuration, placing the FEATURE macro after the OSTYPE macro and before the MAILER(`local&#8217;) line in the master configuration file. Values for the local mailer are usually set in the OSTYPE file. Carefully review the file for [...]]]></description>
			<content:encoded><![CDATA[<p>You want to filter mail with procmail before making deliveries to local users</p>
<p><span id="more-249"></span></p>
<p>Add the local_procmail feature to the sendmail configuration, placing the FEATURE macro after the OSTYPE macro and before the MAILER(`local&#8217;) line in the master configuration file. Values for the local mailer are usually set in the OSTYPE file. Carefully review the file for your operating system. Add the local_procmail feature to your master configuration file only if local_procmail is not already included in the OSTYPE file.</p>
<p>Create an /etc/procmailrc file containing the filters you want to apply to local mail.</p>
<p>Build and install the new configuration</p>
<p>The linux.m4 OSTYPE file contains the local_procmail feature because procmail is the local mailer used by default on most Linux systems. On a Linux system, just running a configuration that uses the linux.m4 OSTYPE file is sufficient. Other systems are not so easy. For example, assume you have a Solaris 8 system. The solaris8.m4 OSTYPE file uses the local_lmtp feature to set mail.local as the local mailer. To change the local mailer to procmail, override the local_lmtp feature by placing the local_procmail feature in the master configuration file. Here is an example based on the generic-solaris.mc file:</p>
<p>VERSIONID(`Solaris with local_procmail added&#8217;)<br />
OSTYPE(solaris2)<br />
DOMAIN(generic)<br />
dnl Add the local_procmail feature<br />
FEATURE(`local_procmail&#8217;)<br />
MAILER(local)<br />
MAILER(smtp)</p>
<p>Because the local_procmail feature occurs after the OSTYPE macro, it overrides the local_lmtp feature defined in the OSTYPE file. The local_procmail feature is enabled once the sendmail.cf file is built, copied to sendmail.cf, and sendmail is restarted.</p>
<p>When the local_procmail feature is used, sendmail passes local mail to procmail for delivery. procmail processes the mail, first using the commands defined in the /etc/procmailrc file and then using the commands defined in the .procmailrc file in the recipient&#8217;s home directory. If no rc file is defined, procmail writes the mail to the user&#8217;s mailbox unaltered. Note that the user&#8217;s .procmailrc file is applied to mail delivered by the local_procmail feature. When local_procmail is used, it is not necessary for the user to call the procmail program from the .forward file. All the user needs to do is create a .procmailrc file and it will be applied to the mail. Using procmail as a local mailer allows both the system administrator and the user to filter inbound mail with procmail.</p>
<p>When procmail is used as the local mailer, sendmail runs it with three arguments: -Y, -a, and -d. The -Y argument tells procmail to use the standard Berkeley Unix mailbox format. The -d argument provides procmail with the username of the local recipient who is to receive the mail (in the mail delivery triple this is the user value). The -a argument passes an optional value to procmail that is accessible inside the procmail as the $1 variable; in the mail delivery triple, this is the host value. sendmail only passes a value through -a when either the +detail syntax is used or mail is routed to the local mailer via the mailertable. In the case of the +detail syntax, the detail value is passed. In the case of the mailertable, the input address that was the key to the mailertable entry is the value passed. In all other cases, no value is passed by the -a argument and the $1 variable is unassigned.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.xiitec.com/blog/2009/02/13/filtering-local-mail-with-procmail/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Enabling Spam Checks on a Per-User Basis</title>
		<link>http://www.xiitec.com/blog/2009/02/13/enabling-spam-checks-on-a-per-user-basis/</link>
		<comments>http://www.xiitec.com/blog/2009/02/13/enabling-spam-checks-on-a-per-user-basis/#comments</comments>
		<pubDate>Fri, 13 Feb 2009 17:38:29 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Sendmail]]></category>
		<category><![CDATA[spam]]></category>

		<guid isPermaLink="false">http://www.xiitec.com/blog/?p=248</guid>
		<description><![CDATA[You have been asked to create a sendmail configuration that applies   checks only when the mail is addressed to selected recipients.

Add an entry to the /etc/mail/access text file for each   recipient whose mail must pass all checks before it is delivered. Use the tag   Spam: and the recipient address [...]]]></description>
			<content:encoded><![CDATA[<p>You have been asked to create a sendmail configuration that applies   checks only when the mail is addressed to selected recipients.</p>
<p><span id="more-248"></span></p>
<p>Add an entry to the <em>/etc/mail/access</em> text file for each   recipient whose mail must pass all checks before it is delivered. Use the tag   Spam: and the recipient address to create the key field of the entry.   Use the keyword HATER as the return value for each entry. Run makemap to build a hash type database from the text   file.</p>
<p>Create a sendmail configuration containing the <em>access_db </em>feature and the <em>delay_checks</em> feature with the optional hater   argument. Make sure that the <em>access_db</em> FEATURE macro precedes   the <em>delay_checks</em> FEATURE macro in the configuration. Here are   the lines that would be added to the sendmail configuration:</p>
<pre>dnl Use the access databaseFEATURE(`access_db')

dnl Apply all checks to spam hater mail

FEATURE(`delay_checks', `hater')</pre>
<p>Rebuild the <em>sendmail.cf</em> file, copy the new <em>sendmail.cf</em> file to <em>/etc/mail</em>, and restart sendmail</p>
<p>The <em>delay_checks</em> feature changes the order in which   checks are applied by first checking the envelope recipient address. When the <em>delay_checks</em> feature is invoked with the hater argument, as   shown in the Solution section, the envelope recipient address must be found in   the <em>access</em> database, and it must return the value HATER before   the envelope sender address or the connection address are checked. If the   envelope sender address is not found in the <em>access</em> database or does not   return the value HATER, the check of the envelope sender address   performed by check_mail, and the check of the connection address   performed by check_relay, are bypassed.</p>
<p>To apply the check_mail and check_relay   checks to a recipient&#8217;s mail, the specific recipients must be defined in the <em>access</em> database using the Spam: tag and the HATER   return value. Here are example entries:</p>
<pre>Connect:example.com                  REJECT</pre>
<pre>Spam:jay@wrotethebook.com            HATER

Spam:alana@wrotethebook.com          HATER</pre>
<p>Using this sendmail configuration, this <em>access</em> database will reject mail from <em>example.com</em> when it is addressed to <em>jay@wrotethebook.com</em> or to <em>alana@wrotethebook.com</em>. Other users are   allowed to receive mail from <em>example.com</em>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.xiitec.com/blog/2009/02/13/enabling-spam-checks-on-a-per-user-basis/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Bypassing Spam Checks</title>
		<link>http://www.xiitec.com/blog/2009/02/13/bypassing-spam-checks/</link>
		<comments>http://www.xiitec.com/blog/2009/02/13/bypassing-spam-checks/#comments</comments>
		<pubDate>Fri, 13 Feb 2009 17:36:36 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Sendmail]]></category>
		<category><![CDATA[bypass]]></category>
		<category><![CDATA[spam]]></category>

		<guid isPermaLink="false">http://www.xiitec.com/blog/?p=247</guid>
		<description><![CDATA[Your sendmail is configured to block incoming junk mail, and you have   been asked to allow junk mail through when it is addressed to specific   recipients.

Add an entry to the /etc/mail/access text file for each   recipient who should be allowed to receive junk mail. Use the tag Spam:  [...]]]></description>
			<content:encoded><![CDATA[<p>Your sendmail is configured to block incoming junk mail, and you have   been asked to allow junk mail through when it is addressed to specific   recipients.</p>
<p><span id="more-247"></span></p>
<p>Add an entry to the <em>/etc/mail/access</em> text file for each   recipient who should be allowed to receive junk mail. Use the tag Spam:   and the recipient address to create the key field of the entry. Use the keyword   FRIEND as the return value for each entry. Run makemap to build a hash type database from the text   file.</p>
<p>Create a sendmail configuration containing the <em>access_db </em>feature and the <em>delay_checks</em> feature with the optional   friend argument. Make sure that the <em>access_db</em> FEATURE   macro precedes the <em>delay_checks</em> FEATURE macro in the   configuration. Here are the lines that would be added to the sendmail   configuration:</p>
<pre>dnl Use the access database

FEATURE(`access_db')

dnl Check for spam friends before rejecting the mail

FEATURE(`delay_checks', `friend')</pre>
<p>Rebuild the <em>sendmail.cf</em> file, copy the new <em>sendmail.cf</em> file to <em>/etc/mail</em>, and restart sendmail</p>
<p>Someone on your system—the postmaster, a security expert, a   developer writing mail filters—might need to receive junk mail that is normally   blocked by sendmail. The <em>delay_checks</em> feature allows this by changing the   order in which spam checks are applied. The <em>delay_checks</em> feature allows   the envelope recipient address to be checked before the envelope sender address   or the connection address, which, in turn, makes it possible for mail addressed   to specific recipients to bypass the other two checks. To use the <em>delay_checks</em> feature in this way, it must be invoked with the   friend argument, as shown in the Solution section.</p>
<p>The specific recipients allowed to receive junk mail are   defined in the <em>access</em> database using the Spam: tag and the   FRIEND return value. Here is an example access database:</p>
<pre>Connect:example.com                  REJECT

Spam:uce@wrotethebook.com            FRIEND

Spam:clark+junk@wrotethebook.com     FRIEND</pre>
<p>Given the sendmail configuration described in the Solution   section, this <em>access</em> database rejects mail from <em>example.com</em> unless   it is addressed to <em>uce@wrotethebook.com</em> or to <em>clark+junk@wrotethebook.com</em>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.xiitec.com/blog/2009/02/13/bypassing-spam-checks/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Preventing Local Users from Replying to Spammers</title>
		<link>http://www.xiitec.com/blog/2009/02/12/preventing-local-users-from-replying-to-spammers/</link>
		<comments>http://www.xiitec.com/blog/2009/02/12/preventing-local-users-from-replying-to-spammers/#comments</comments>
		<pubDate>Thu, 12 Feb 2009 19:30:52 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Sendmail]]></category>
		<category><![CDATA[spam]]></category>

		<guid isPermaLink="false">http://www.xiitec.com/blog/?p=246</guid>
		<description><![CDATA[Before creating any user accounts, create an acceptable use   policy that, among many other things, gives you the power to block spam   communications—both inbound and outbound. Ensure that all users agree to this   policy before giving out any user accounts.

Add the spam addresses you want blocked to the /etc/mail/access [...]]]></description>
			<content:encoded><![CDATA[<p>Before creating any user accounts, create an acceptable use   policy that, among many other things, gives you the power to block spam   communications—both inbound and outbound. Ensure that all users agree to this   policy before giving out any user accounts.</p>
<p><span id="more-246"></span></p>
<p>Add the spam addresses you want blocked to the <em>/etc/mail/access</em> text file. Use To: and From: tags to   prevent mail from being sent to spammers or from being accepted from spammers.   Run makemap to build a hash database from the   text file.</p>
<p>Create a sendmail configuration that enables the <em>access</em> database with the <em>access_db </em>feature. The required sendmail   FEATURE command is:</p>
<pre>dnl Use the access database

FEATURE(`access_db')</pre>
<p>Rebuild the <em>sendmail.cf</em> file, copy the new <em>sendmail.cf</em> file to <em>/etc/mail</em>, and restart sendmail</p>
<p>By default, the <em>access</em> database applies to source   addresses. The action defined in the database entry is taken based on the source   of the email. For example,   mail from anyone at <em>example.com</em> is rejected with an &#8220;Access denied&#8221;   error. However, the <em>access</em> database  does not prevent mail from the local host being sent to someone at <em>example.com</em>.</p>
<p>Adding the To:tag to an <em>access</em> database entry   applies the action defined in the entry to recipient addresses that match the   key, while the From: tag specifically requests that the action be   applied to matching source addresses. Here is the <em>access</em> database rewritten with To: and From: tags:</p>
<pre>From:example.com          REJECT

To:example.com            ERROR:5.7.1:550 Mail to this site is not allowed

From:wrotethebook.net     ERROR:5.7.1:550 Invalid mail source

To:wrotethebook.net       ERROR:5.7.1:550 Mail to this site is not allowed

From:fake.ora.com         DISCARD

To:fake.ora.com           ERROR:5.7.1:550 Mail to this site is not allowed</pre>
<p>Because the action for the From: <em>example.com</em> entry is REJECT, mail from that site is rejected. With the addition of the To: entry, mail addressed to <em>example.com</em> is also rejected, as this test shows:</p>
<pre># <strong>telnet localhost smtp</strong>

Trying 127.0.0.1...  Connected to localhost.

Escape character is '^]'.

220 chef.wrotethebook.com ESMTP Sendmail 8.12.9/8.12.9; Fri, 22 Aug 2003 12:01:37 -  0400

<strong>HELO localhost</strong>

250 chef.wrotethebook.com Hello IDENT:UWSRv+Jij66J8vALUBVBECbGPVoU8OQe@localhost   [127.0.0.1], pleased to meet you

<strong>MAIL From:&lt;craig@chef.wrotethebook.com&gt;</strong>

250 2.1.0 &lt;craig@chef.wrotethebook.com&gt;... Sender ok  <strong>

RCPT To:&lt;crook@example.com&gt;</strong>

550 5.7.1 &lt;crook@example.com&gt;... Mail to this site is not allowed

<strong>QUIT</strong>

221 2.0.0 chef.wrotethebook.com closing connection  Connection closed by foreign host.</pre>
<h5>Alternatives</h5>
<p>The <em>blacklist_recipients</em> feature is an alternative way to block outbound mail to   known spammers. The <em>blacklist_recipients</em> feature applies every untagged   entry in the <em>access</em> database to recipient addresses. The following lines   added to the sendmail configuration enable the <em>access</em> database and apply   the database to recipient addresses:</p>
<pre>dnl Use the access database

FEATURE(`access_db')

dnl Also apply the access database to recipient addresses

FEATURE(`blacklist_recipients')</pre>
<p>The <em>blacklist_recipients</em> feature works well, and it is   very easy to use. However, because it applies to every untagged entry in the <em>access</em> database, it does not provide the level of configuration control   provided by the To: tag. Additionally, tags are self-documenting.   Anyone looking at the sample <em>access</em> database just shown understands that   mail to <em>example.com</em> is not allowed when they see the To: tag and   the error in the action field.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.xiitec.com/blog/2009/02/12/preventing-local-users-from-replying-to-spammers/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Building Your Own DNS Blackhole List</title>
		<link>http://www.xiitec.com/blog/2009/02/12/building-your-own-dns-blackhole-list/</link>
		<comments>http://www.xiitec.com/blog/2009/02/12/building-your-own-dns-blackhole-list/#comments</comments>
		<pubDate>Thu, 12 Feb 2009 18:48:12 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Sendmail]]></category>
		<category><![CDATA[blackhole]]></category>
		<category><![CDATA[build]]></category>
		<category><![CDATA[DNS]]></category>

		<guid isPermaLink="false">http://www.xiitec.com/blog/?p=245</guid>
		<description><![CDATA[The domain administrator must create a DNS zone file, in the   proper format, that lists all of the connection addresses that are to be   blacklisted. The special DNS address records in the zone file are constructed by   reversing the IP address of the blacklisted system to create the DNS [...]]]></description>
			<content:encoded><![CDATA[<p>The domain administrator must create a DNS zone file, in the   proper format, that lists all of the connection addresses that are to be   blacklisted. The special DNS address records in the zone file are constructed by   reversing the IP address of the blacklisted system to create the DNS name field   of the record and by using an address such as 127.0.0.2 in the data   field of the address record. This format means that hosts are blacklisted by IP   address instead of by name, which makes sense because the <em>dnsbl</em> lookup is   done using the connection IP address. The DNS server must be authoritative for   the domain in which the blackhole list is to be located. This is normally done   by creating a special subdomain for the blackhole list within the zone of   authority of the DNS server.</p>
<p><span id="more-245"></span></p>
<p>On the sendmail system, create a configuration containing the <em>dnsbl </em>feature. Identify the local DNS   blackhole list on the <em>dnsbl</em> command line. Here is an example:</p>
<pre>dnl Point dnsbl to our local DNS blackhole list

FEATURE(`dnsbl', `dnsbl.wrotethebook.com')</pre>
<p>Rebuild the <em>sendmail.cf</em> file, copy the new <em>sendmail.cf</em> file to <em>/etc/mail</em>, and restart sendmail.</p>
<p>Using a blackhole list service is simple but inflexible because   you can&#8217;t choose which sites are listed. This means that mail from a friendly   site might be blocked just because the administrator at that site misconfigured   relaying. For this reason, some organizations decide to build their own   DNS-based blackhole list. Creating your own blackhole server ensures that   connectivity to all of the sites you want to reach is under your direct control,   but it requires both sendmail and DNS expertise.</p>
<p>The DNS administrator uses a zone statement in the DNS   server&#8217;s <em>named.conf </em>file to load the blackhole database. Assuming that   the blacklisted hosts are defined in a zone file named <em>blacklisted.hosts</em>,   which provides the data for a domain named <em>dnsbl.wrotethebook.com</em>, the   following zone statement would be used:</p>
<pre>zone "dnsbl.wrotethebook.com" IN {

type master;

file "blacklisted.hosts";

allow-update { none; };

};</pre>
<p>Blackhole entries for addresses 10.0.187.215 and   192.168.0.3 defined in the <em>blacklisted.hosts</em> file would be the   following:</p>
<pre>215.187.0.10                 IN A 127.0.0.2

3.0.168.192                  IN A 127.0.0.2</pre>
<p>The newly created DNS domain is referenced as the source for   blackhole list data on the <em>dnsbl</em> feature command line in the Solution   section. Mail from any site listed in the <em>dnsbl.wrotethebook.com</em> domain   is rejected, as this attempt to send mail from 192.168.0.3 shows:</p>
<pre># <strong>telnet chef smtp</strong>

Trying 192.168.0.8...

Connected to 192.168.0.8.

Escape character is '^]'.

220 chef.wrotethebook.com ESMTP Sendmail 8.12.9/8.12.9; Fri, 22 Aug 2003 12:01:37 -  0400

<strong>helo rodent.wrotethebook.com</strong>

250 chef.wrotethebook.com Hello rodent.wrotethebook.com [192.168.0.3], pleased to   meet you

<strong>MAIL From:&lt;craig@rodent.wrotethebook.com&gt;</strong>

550 5.7.1 Rejected: 192.168.0.3 listed at dnsbl.wrotethebook.com

<strong>QUIT</strong>

221 2.0.0 chef.wrotethebook.com closing connection  Connection closed by foreign host.</pre>
<p>The connection address 192.168.0.3 is found in the <em>dnsbl.wrotethebook.com</em> domain, so our server rejects the mail and returns   the error message &#8220;550 5.7.1 Rejected: 192.168.0.3 listed at   dnsbl.wrotethebook.com.&#8221; This default error message can be changed with an   additional argument on the <em>dnsbl</em> feature command line. For example, the   command:</p>
<pre>FEATURE(`dnsbl', `dnsbl.wrotethebook.com', `"Mail rejected. "$&amp;{client_addr}" is a   suspected spam relay."')</pre>
<p>changes the error message to &#8220;Mail rejected. 192.168.0.3 is a   suspected spam relay.&#8221; However, the standard message works well and provides the   remote site with more information.</p>
<p>The small number of systems used in the blackhole list  could much more easily have been handled by the <em>access</em> database.   In most cases, using the <em>access</em> database to block unwanted mail   connections is much easier than creating your own blackhole list. Creating and   maintaining your own blackhole list is labor intensive. The systems that should   be added to and removed from the list are constantly changing. Additionally, a   great deal of information is needed to initially build a list. It is possible to   use a mail filtering tool, such as procmail, to   automatically collect suspected addresses directly from mail. However, it is   difficult to create a system that collects the right information and keeps it   up-to-date. Most administrators prefer to create their own blackhole list based   on the blackhole list provided by a blackhole list service. The services already   have large lists and they constantly maintain them. Most blackhole list services   provide some way to download the entire list. For example, the DSBL list can be   downloaded using rsync:</p>
<pre># rsync rsync.dsbl.org::dsbl/bind-list.dsbl.org.</pre>
<p>Periodically downloading a list and customizing it is one way   to create your own blackhole list. But even if you start with a preexisting   list, creating your own blackhole list is not a task that should be undertaken   lightly. Creating your own blackhole list is one of the most difficult   techniques for controlling unwanted junk email.</p>
<p>As usual, the choice between using a blackhole list service or   building your own blackhole list is a choice between simplicity and flexibility.   Most sites choose simplicity. If you don&#8217;t have the available staff necessary to   build and maintain your own blackhole list, stick with a standard blackhole list   service.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.xiitec.com/blog/2009/02/12/building-your-own-dns-blackhole-list/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Using a DNS Blackhole List Service</title>
		<link>http://www.xiitec.com/blog/2009/02/12/using-a-dns-blackhole-list-service/</link>
		<comments>http://www.xiitec.com/blog/2009/02/12/using-a-dns-blackhole-list-service/#comments</comments>
		<pubDate>Thu, 12 Feb 2009 18:42:14 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Sendmail]]></category>
		<category><![CDATA[blackhole]]></category>
		<category><![CDATA[DNS]]></category>
		<category><![CDATA[spam]]></category>

		<guid isPermaLink="false">http://www.xiitec.com/blog/?p=244</guid>
		<description><![CDATA[Add the dnsbl feature to the sendmail configuration.   Identify the specific blackhole list service you wish to use on the dnsbl command line. Here is an example:

dnl Use the DSBL blacklist service

FEATURE(`dnsbl', `list.dsbl.org')
Rebuild the sendmail.cf file, copy the new sendmail.cf file to /etc/mail, and restart sendmail.
The dnsbl feature adds the sendmail.cf code  [...]]]></description>
			<content:encoded><![CDATA[<p>Add the <em>dnsbl </em>feature to the sendmail configuration.   Identify the specific blackhole list service you wish to use on the <em>dnsbl</em> command line. Here is an example:</p>
<p><span id="more-244"></span></p>
<pre>dnl Use the DSBL blacklist service

FEATURE(`dnsbl', `list.dsbl.org')</pre>
<p>Rebuild the <em>sendmail.cf</em> file, copy the new <em>sendmail.cf</em> file to <em>/etc/mail</em>, and restart sendmail.</p>
<p>The <em>dnsbl</em> feature adds the <em>sendmail.cf</em> code   needed to enable a DNS blacklist service. The <em>dnsbl</em> feature uses a   K command to define the <em>dnsbl</em> database as a host type   database, which means lookups in <em>dnsbl</em> are really passed to DNS for   resolution.The <em>dnsbl</em> feature also   adds a few rules to the Basic_check_relay ruleset, which is called from   the check_relay ruleset. The added rules lookup the connection address   in the <em>dnsbl</em> database. If the connection address is found in the   database, mail from that address is rejected with an error message. If the   connection address is not found in the <em>dnsbl</em> database, the mail is passed   on for further processing. A sendmail -bt test shows the   impact of the added rewrite rules:</p>
<pre># <strong>sendmail -bt</strong>

ADDRESS TEST MODE (ruleset 3 NOT automatically invoked)

Enter &lt;ruleset&gt; &lt;address&gt;

&gt; <strong>.D{client_addr}192.168.111.68</strong>

&gt; <strong>Basic_check_relay &lt;&gt;</strong>

Basic_check_rela   input: &lt; &gt;

Basic_check_rela returns: $# error $@ 5 . 7 . 1 $: "550 Rejected:

" 192 . 168 . 111 .  68 " listed at list.dsbl.org"

&gt; <strong>/quit</strong></pre>
<p>Because there is no active connection—this is just a test—the   first step is to statically define a connection address for the test. Next, the   Basic_check_relay ruleset is called and passed to an empty workspace.   The workspace passed to the ruleset in this test is unimportant because the   first rule added to the ruleset by the <em>dnsbl</em> feature unconditionally   replaces the workspace with the value found in ${client_addr}.   Therefore, the value looked up in the <em>dnsbl</em> database is the connection   address stored in the ${client_addr} macro. In this test, the address   192.168.111.68 is found in the blackhole list maintained at <em>list.dsbl.org</em>, so mail from that address is rejected. The mail is   rejected with the error message:</p>
<pre>550 Rejected: 192.168.111.68 listed at list.dsbl.org</pre>
<p>The error message displays the address that was rejected and   the service that recommended the rejection. This information is important. The   administrators at 192.168.111.68 might need to contact the blackhole   service to find out why their system is blacklisted and what they can do to get   it removed from the blackhole list. Often, a system is blacklisted because of a   configuration error that creates an open relay. As soon as the error is fixed,   the administrator wants to get the system removed from the blackhole list.   Knowing which services have blacklisted the system tells the administrator which   services must be contacted to get full mail service restored.</p>
<p>This configuration uses the blackhole server at <em>list.dsbl.org</em> because that is the service specified with the <em>dnsbl</em> feature command, which is just an example; it is not a   recommendation for the <em>list.dsbl.org</em> service. There are many blackhole   services available. Go to each service&#8217;s web site and evaluate their policy for listing   hosts in the database. Select the service whose policy most closely matches the   policy you want to enforce on your server.</p>
<p>When no service is specified on the <em>dnsbl</em> feature   command line, sendmail defaults to using <em>blackholes.mail-abuse.org</em>, which   is the same service that was used by the deprecated sendmail <em>rbl</em> feature.</p>
<p>The <em>enhdnsbl</em> feature could be used as an alternative to <em>dnsbl</em>. However, the <em>enhdnsbl</em> feature provides no   real advantage in this particular case.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.xiitec.com/blog/2009/02/12/using-a-dns-blackhole-list-service/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
