<?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>牧羊人的方向 &#187; 师夷长技</title>
	<atom:link href="http://www.sweetytang.com/archieves/technique/feed" rel="self" type="application/rss+xml" />
	<link>http://www.sweetytang.com</link>
	<description>追风少年,且听风吟,风犹在耳,牧羊人的方向</description>
	<lastBuildDate>Mon, 08 Sep 2014 05:13:42 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>DB2中数据类型</title>
		<link>http://www.sweetytang.com/archives/147.html</link>
		<comments>http://www.sweetytang.com/archives/147.html#comments</comments>
		<pubDate>Wed, 04 Sep 2013 15:24:03 +0000</pubDate>
		<dc:creator>牧羊人</dc:creator>
				<category><![CDATA[师夷长技]]></category>
		<category><![CDATA[DB2]]></category>
		<category><![CDATA[数据类型]]></category>

		<guid isPermaLink="false">http://www.sweetytang.com/?p=147</guid>
		<description><![CDATA[导读：DB2数据库内置数据类型可以分成数值型(numeric)、字符串型(character string)、图形字符串(graphic string)、二进制字符串型(binary string)或日期时间型(datetime)。还有一种叫做 DATALINK 的特殊数据类型。DATALINK 值包含了对存储在数据库以外的文件的逻辑引用。 数值型数据类型包括 SMALLINT、INTEGER、BIGINT、DECIMAL(p,s)、REAL 和 DOUBLE。所有数值都有符号和精度。精度是指除符号以外的二进制或十进制的位数。如果数字的值大于等于零，就认为符号为正。 *小整型，SMALLINT：小整型是两个字节的整数，精度为 5 位。小整型的范围从 -32,768 到 32,767。 *大整型，INTEGER 或 INT：大整型是四个字节的整数，精度为 10 位。大整型的范围从 -2,147,483,648 到 2,147,483,647。 *巨整型，BIGINT：巨整型是八个字节的整数，精度为 19 位。巨整型的范围从 -9,223,372,036,854,775,808 到 9,223,372,036,854,775,807。 *小数型，DECIMAL(p,s)、DEC(p,s)、NUMERIC(p,s) 或 NUM(p,s)：小数型的值是一种压缩十进制数，它有一个隐含的小数点。压缩十进制数将以二-十进制编码(binary-coded decimal，BCD)记数法的变体来存储。小数点的位置取决于数字的精度(p)和小数位(s)。小数位是指数字的小数部分的位数，它不可以是负数，也不能大于精度。最大精度是 31 位。小数型的范围从 -10**31+1 到 10**31-1。 &#8230; <a href="http://www.sweetytang.com/archives/147.html">继续阅读 <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p align="left"><strong>导读：DB2数据库</strong>内置<strong>数据类型</strong>可以分成数值型(numeric)、字符串型(character string)、图形字符串(graphic string)、二进制字符串型(binary string)或日期时间型(datetime)。还有一种叫做 DATALINK 的特殊数据类型。DATALINK 值包含了对存储在数据库以外的文件的逻辑引用。</p>
<p align="left">数值型数据类型包括 SMALLINT、INTEGER、BIGINT、DECIMAL(p,s)、REAL 和 DOUBLE。所有数值都有符号和精度。精度是指除符号以外的二进制或十进制的位数。如果数字的值大于等于零，就认为符号为正。<span id="more-147"></span></p>
<p align="left"><strong>*</strong><strong>小整型，SMALLINT：</strong>小整型是两个字节的整数，精度为 5 位。小整型的范围从 -32,768 到 32,767。</p>
<p align="left"><strong>*</strong><strong>大整型，INTEGER 或 INT：</strong>大整型是四个字节的整数，精度为 10 位。大整型的范围从 -2,147,483,648 到 2,147,483,647。</p>
<p align="left"><strong>*</strong><strong>巨整型，BIGINT：</strong>巨整型是八个字节的整数，精度为 19 位。巨整型的范围从 -9,223,372,036,854,775,808 到 9,223,372,036,854,775,807。</p>
<p align="left"><strong>*</strong><strong>小数型，DECIMAL(p,s)、DEC(p,s)、NUMERIC(p,s) 或 NUM(p,s)：</strong>小数型的值是一种压缩十进制数，它有一个隐含的小数点。压缩十进制数将以二-十进制编码(binary-coded decimal，BCD)记数法的变体来存储。小数点的位置取决于数字的精度(p)和小数位(s)。小数位是指数字的小数部分的位数，它不可以是负数，也不能大于精度。最大精度是 31 位。小数型的范围从 -10**31+1 到 10**31-1。</p>
<p align="left"><strong>*</strong><strong>单精度浮点数(Single-precision floating-point)，REAL：</strong>单精度浮点数是实数的 32 位近似值。数字可以为零，或者在从 -3.402E+38 到 -1.175E-37 或从 1.175E-37 到 3.402E+38 的范围内。</p>
<p align="left"><strong>*</strong><strong>双精度浮点数(Double-precision floating-point)，DOUBLE，DOUBLE PRECISION 或 FLOAT：</strong>双精度浮点数是实数的 64 位近似值。数字可以为零，或者在从 -1.79769E+308 到 -2.225E-307 或从 2.225E-307 到 1.79769E+308 的范围内。</p>
<p align="left">字符串是字节序列。字符串包括 CHAR(n) 类型的定长字符串和 VARCHAR(n)、LONG VARCHAR 或 CLOB(n) 类型的变长字符串。字符串的长度就是序列中的字节数。</p>
<p align="left"><strong>*</strong><strong>定长字符串，CHARACTER(n) 或 CHAR(n)：</strong>定长字符串的长度介于 1 到 254 字节之间。如果没有指定长度，那么就认为是 1 个字节。</p>
<p align="left"><strong>*</strong><strong>变长字符串，VARCHAR(n)、CHARACTER VARYING(n) 或 CHAR VARYING(n)：</strong>VARCHAR(n) 类型的字符串是变长字符串，最长可达 32,672 字节。</p>
<p align="left"><strong>*LONG VARCHAR</strong><strong>：</strong>LONG VARCHAR 类型的字符串是变长字符串，最长可达 32,700 字节。</p>
<p align="left"><strong>*</strong><strong>字符大对象字符串(Character Large Object String)，CLOB(n[K|M|G])：</strong>CLOB 是变长字符串，最长可以达到 2,147,483,647 字节。如果只指定了 n，那么 n 的值就是最大长度。如果指定了 nK，那么最大长度就是 n*1,024(n 的最大值为 2,097,152)。如果指定了 nM，那么最大长度就是 n*1,048,576(n 的最大值为 2,048)。如果指定了 nG，那么最大长度就是 n*1,073,741,824(n 的最大值是 2)。CLOB 用于存储基于大单字节字符集(single-byte character set，SBCS)字符的数据或基于混合(多字节字符集(MBCS)和 SBCS)字符的数据。图形字符串是表示双字节字符数据的字节序列。图形字符串包括类型为 GRAPHIC(n) 的定长图形字符串和类型为 VARGRAPHIC(n)、LONG VARGRAPHIC 和 DBCLOB(n) 的变长图形字符串。字符串的长度就是序列中双字节字符的数目。</p>
<p align="left"><strong>*</strong><strong>定长图形字符串，GRAPHIC(n)：</strong>定长图形字符串的长度介于 1 到 127 个双字节字符之间。如果没有指定长度，就认为是 1 个双字节字符。</p>
<p align="left"><strong>*</strong><strong>变长图形字符串，VARGRAPHIC(n)：</strong>VARGRAPHIC(n) 类型的字符串是变长图形字符串，最大长度可达 16,336 个双字节字符。</p>
<p align="left"><strong>*LONG VARGRAPHIC</strong><strong>：</strong>LONG VARGRAPHIC 类型的字符串是变长图形字符串，最大长度可达 16,350 个双字节字符。</p>
<p align="left"><strong>*</strong><strong>双字节字符大对象字符串，DBCLOB(n[K|M|G])：</strong>双字节字符大对象是变长双字节字符图形字符串，最长可达 1,073,741,823 个字符。如果只指定了 n，那么 n 就是最大长度。如果指定了 nK，那么最大长度就是 n*1,024(n 的最大值为 1,048,576)。如果指定了 nM，那么最大长度就是 n*1,048,576(n 的最大值为 1,024)。如果指定了 nG，那么最大长度就是 n*1,073,741,824(n 的最大值是 1)。DBCLOB 用于存储基于大 DBCS(双字节字符集，double-byte character set)字符的数据。二进制字符串是字节序列。二进制字符串包括 BLOB(n) 类型的变长字符串，它用于容纳非传统型的数据，诸如图片、语音或混合媒体等，还可以容纳用户定义的类型及用户定义的函数的结构化数据。</p>
<p align="left"><strong>二进制大对象，BLOB(n[K|M|G])：</strong>二进制大对象是变长字符串，最长可达 2,147,483,647 字节。如果只指定了 n，那么 n 就是最大长度。如果指定了 nK，那么最大长度就是 n*1,024(n 的最大值为 2,097,152)。如果指定了 nM，那么最大长度就是 n*1,048,576(n 的最大值为 2,048)。如果指定了 nG，那么最大长度就是 n*1,073,741,824(n 的最大值是 2)。</p>
<p align="left">日期时间型数据类型包括 DATE、TIME 和 TIMESTAMP。日期时间值可在某些算术和字符串操作中使用，而且兼容某些字符串，但它们既不是字符串，也不是数字。</p>
<p align="left"><strong>*DATE</strong><strong>：</strong>DATE 是一个由三部分组成的值(年、月和日)。年份部分的范围是从 0001 到 9999。月份部分的范围是从 1 到 12。日部分的范围是从 1 到 n，其中 n 的值取决于月份。DATE 列长 10 个字节。</p>
<p align="left"><strong>*TIME</strong><strong>：</strong>TIME 是一个由三部分组成的值(小时、分钟和秒)。小时部分的范围是从 0 到 24。分钟和秒部分的范围都是从 0 到 59。如果小时为 24，分钟和秒的值都是 0。TIME 列长 8 个字节。</p>
<p align="left"><strong>*TIMESTAMP</strong><strong>：</strong>TIMESTAMP 是一个由七部分组成的值(年、月、日、小时、分钟、秒和微秒)。年份部分的范围是从 0001 到 9999。月份部分的范围是从 1 到 12。日部分的范围是从 1 到 n，其中 n 的值取决于月份。小时部分的范围是从 0 到 24。分钟和秒部分的范围都是从 0 到 59。微秒部分的范围是从 000000 到 999999。如果小时是 24，那么分钟值、秒的值和微秒的值都是 0。TIMESTAMP 列长 26 个字节。日期时间值的字符串表示：尽管 DATE、TIME 和 TIMESTAMP 的值的内部表示对用户是透明的，日期、时间和时间戳记也可以用字符串来表示，CHAR 标量函数(请参阅 SQL 的“词类(parts of speech)”)可以用于创建日期时间值的字符串表示。</p>
<p align="left">*日期值的字符串表示是一个以数字开始，长度不少于 8 个字符的字符串。日期值的月份和日部分中前面的零可以省略。</p>
<p align="left">*时间值的字符串表示是以数字开头，长度不少于 4 个字符的字符串。时间值的小时部分前面的零可以省略，秒部分可以完全省略。如果秒的值没有指定，那么就认为是 0。</p>
<p>*时间戳记值的字符串表示是以数字开头，长度不少于 16 个字符的字符串。完整的时间戳记字符串表示形式为 yyyy-mm-dd-hh.mm.ss.nnnnnn。时间戳记值的月、日或小时等几部分前面的零可以省略，微秒可以截断或完全省略。如果任何时间戳记值的微秒部分尾零被省略掉了，那么将假定空缺的数位上是零。</p>
]]></content:encoded>
			<wfw:commentRss>http://www.sweetytang.com/archives/147.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Java中的单例模式</title>
		<link>http://www.sweetytang.com/archives/145.html</link>
		<comments>http://www.sweetytang.com/archives/145.html#comments</comments>
		<pubDate>Sun, 18 Aug 2013 14:03:05 +0000</pubDate>
		<dc:creator>牧羊人</dc:creator>
				<category><![CDATA[师夷长技]]></category>
		<category><![CDATA[JAVA编程，单例模式]]></category>

		<guid isPermaLink="false">http://www.sweetytang.com/?p=145</guid>
		<description><![CDATA[单例模式属于对象创建型模式，其意图是保证一个类仅有一个实例，并提供一个访问它的全局访问点。对一些类来说，只有一个实例是很重要的，虽然系统中可以有许多打印机，但却只应该有一个打印机假脱机，只应该有一个文件系统和一个窗口管理器，一个数字滤波器只能有一个A/D转换器，一个会计系统只能专用于一个公司。怎样才能保证一个类只有一个实例并且这个实例易于被访问，一个全局变量使得一个对象可以被访问，但它不能防止你实例化多个对象，一个更好的方法是让类自身负责保存他的唯一实例。这个类可以保证没有其他实例可以被创建，并且它可以提供一个访问该实例的方法，这就是Singleton模式。 实用性：在下面的情况下可以使用Singleton模式： 当类只能有一个实例而且客户可以从一个众所周知的访问点访问它时。 当这个唯一实例应该是通过子类化可扩展的，并且客户应该无需更改代码就能使用一个扩展的实例时。 import javax.swing.*; import java.awt.*; public class TestSingleton {     public static void main(String args[])     {         System.out.println(“System Print Out”);        int x1=40;        int y1=40;        int x2=100;        int y2=100;        Color paint_color &#8230; <a href="http://www.sweetytang.com/archives/145.html">继续阅读 <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>单例模式属于对象创建型模式，其意图是保证一个类仅有一个实例，并提供一个访问它的全局访问点。对一些类来说，只有一个实例是很重要的，虽然系统中可以有许多打印机，但却只应该有一个打印机假脱机，只应该有一个文件系统和一个窗口管理器，一个数字滤波器只能有一个A/D转换器，一个会计系统只能专用于一个公司。怎样才能保证一个类只有一个实例并且这个实例易于被访问，一个全局变量使得一个对象可以被访问，但它不能防止你实例化多个对象，一个更好的方法是让类自身负责保存他的唯一实例。这个类可以保证没有其他实例可以被创建，并且它可以提供一个访问该实例的方法，这就是Singleton模式。<span id="more-145"></span></p>
<p>实用性：在下面的情况下可以使用Singleton模式：</p>
<ul>
<li>当类只能有一个实例而且客户可以从一个众所周知的访问点访问它时。</li>
<li>当这个唯一实例应该是通过子类化可扩展的，并且客户应该无需更改代码就能使用一个扩展的实例时。</li>
</ul>
<table border="1" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td valign="top" width="568">
<p align="left"><strong>import</strong> javax.swing.*;</p>
<p align="left"><strong>import</strong> java.awt.*;</p>
<p align="left">
<p align="left"><strong>public</strong> <strong>class</strong> TestSingleton</p>
<p align="left">{</p>
<p align="left">    <strong>public</strong> <strong>static</strong> <strong>void</strong> main(String args[])</p>
<p align="left">    {</p>
<p align="left">        System.<em>out</em>.println(“System Print Out”);</p>
<p align="left">       <strong>int</strong> x1=40;</p>
<p align="left">       <strong>int</strong> y1=40;</p>
<p align="left">       <strong>int</strong> x2=100;</p>
<p align="left">       <strong>int</strong> y2=100;</p>
<p align="left">       Color paint_color = Color.<em>blue</em>;</p>
<p align="left">       Video2.<em>getInstance</em>(x1,y1,x2,y2,paint_color);</p>
<p align="left">       <strong>for</strong>(<strong>int</strong> i=0;i&lt;3;i++)</p>
<p align="left">       {</p>
<p align="left">           paint_color = Color.<em>red</em>;</p>
<p align="left">           Video2.<em>getInstance</em>(x1+40,y1+40,x2,y2,paint_color);</p>
<p align="left">       }</p>
<p align="left">       System.<em>out</em>.println(“System Print Out”);</p>
<p align="left">    }</p>
<p align="left">}</p>
<p align="left">
<p align="left"><strong>class</strong> <span style="text-decoration: underline;">Video2</span> <strong>extends</strong> JFrame</p>
<p align="left">{</p>
<p align="left">    <strong>static</strong> <strong>int</strong> <em>x1</em>;</p>
<p align="left">    <strong>static</strong> <strong>int</strong> <em>y1</em>;</p>
<p align="left">    <strong>static</strong> <strong>int</strong> <em>x2</em>;</p>
<p align="left">    <strong>static</strong> <strong>int</strong> <em>y2</em>;</p>
<p align="left">    <strong>static</strong> Color <em>paint_color</em>;</p>
<p align="left">    //定义Construct函数，将需要的参数带入</p>
<p align="left">    <strong>public</strong> Video2(<strong>int</strong> x1,<strong>int</strong> y1,<strong>int</strong> x2,<strong>int</strong> y2, Color paint_color)</p>
<p align="left">    {</p>
<p align="left">       Video2.<em>x1</em>=x1;</p>
<p align="left">       Video2.<em>y1</em>=y1;</p>
<p align="left">       Video2.<em>x2</em>=x2;</p>
<p align="left">       Video2.<em>y2</em>=y2;</p>
<p align="left">       Video2.<em>paint_color</em> = paint_color;</p>
<p align="left">       setBounds(200,100,200,500);</p>
<p align="left">       setDefaultCloseOperation(JFrame.<em>EXIT_ON_CLOSE</em>);</p>
<p align="left">       setVisible(<strong>true</strong>);</p>
<p align="left">    }</p>
<p align="left">    <strong>int</strong> j=0;</p>
<p align="left">
<p align="left">    //@Override</p>
<p align="left">    <strong>public</strong> <strong>void</strong> paint(Graphics g)</p>
<p align="left">    {</p>
<p align="left">       System.<em>out</em>.println(++j);</p>
<p align="left">       g.setColor(<em>paint_color</em>);</p>
<p align="left">       g.drawLine(<em>x1</em>, <em>y1</em>, <em>x2</em>, <em>y2</em>);</p>
<p align="left">    }</p>
<p align="left">
<p align="left">    <strong>public</strong> <strong>static</strong> <strong>synchronized</strong> Video2 getInstance(<strong>int</strong> x1,<strong>int</strong> y1,<strong>int</strong> x2,<strong>int</strong> y2,Color paint_color){</p>
<p align="left">        <strong>if</strong> (<em>instance</em> == <strong>null</strong>) {</p>
<p align="left">          <em>instance</em> = <strong>new</strong> Video2(x1, y1, x2, y2, paint_color);</p>
<p align="left">        }</p>
<p align="left">        <em>instance</em>.repaint();</p>
<p align="left">        <strong>return</strong> <em>instance</em>;</p>
<p align="left">      }</p>
<p align="left">
<p align="left">    <strong>private</strong> <strong>static</strong> Video2 <em>instance</em>;</p>
<p>}</td>
</tr>
</tbody>
</table>
<p>&nbsp;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.sweetytang.com/archives/145.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>如何查看网络端口号状态</title>
		<link>http://www.sweetytang.com/archives/142.html</link>
		<comments>http://www.sweetytang.com/archives/142.html#comments</comments>
		<pubDate>Sun, 11 Aug 2013 12:34:28 +0000</pubDate>
		<dc:creator>牧羊人</dc:creator>
				<category><![CDATA[师夷长技]]></category>
		<category><![CDATA[网络]]></category>

		<guid isPermaLink="false">http://www.sweetytang.com/?p=142</guid>
		<description><![CDATA[用“netstat－an”查看端口状态 在Windows2000/XP中，可以在命令提示符下使用“netstat-an”查看系统端口状态，可以列出系统正在开放的端口号及其状态。在stat下面有一些英文，简单说一下这些英文具体都代表什么 LISTEN：侦听来自远方的TCP端口的连接请求 SYN-SENT：再发送连接请求后等待匹配的连接请求 SYN-RECEIVED：再收到和发送一个连接请求后等待对方对连接请求的确认 ESTABLISHED：代表一个打开的连接 FIN-WAIT-1：等待远程TCP连接中断请求，或先前的连接中断请求的确认 FIN-WAIT-2：从远程TCP等待连接中断请求 CLOSE-WAIT：等待从本地用户发来的连接中断请求 CLOSING：等待远程TCP对连接中断的确认 LAST-ACK：等待原来的发向远程TCP的连接中断请求的确认 TIME-WAIT：等待足够的时间以确保远程TCP接收到连接中断请求的确认 CLOSED：没有任何连接状态 “telnet 目标ip 对端port”，是不是可以测试对端的tcp上的该port是不是开启状态？ 这个方法经常用于调试穿越防火墙的连接吧？我有点疑问，这是什么原理啊？ ####可以，telnet客户进程和终端用户本身就是通过tcp建立连接的，当然前提是双方都打开了相应的port，如果失败，那就证明没有开放次端口（当然这个不是绝对的，例如防火墙限制）如果穿越防火墙的话，根据我的经验，udp相对容易些 从过程来看，“telnet 目标ip” 就是想连接目标ip的telnet服务嘛，而且要默认占用对端的23端口； 后面又跟上另外一个端口算怎么回事啊？ ####telnet服务目的端默认的端口是23，这是应用层的C/S，所以你telnet+ip地址是可以的，对于类似sqlserver 2000 telnet服务的端口是1433，所以你就需要telnet+ip+port 另外这种方法好像只能测试对端的tcp端口吧？ 如果要测试对方的udp端口呢？ ####是的，telnet的原理已经说明，udp是无连接的，所以不能通过telnet的方式进行测试，一般可以向目标主机的每个端口发出一个0字节的udp包如果我们收到端口不可达的icmp消息，端口就是关闭的，否则假设它是打开的。这个你找点扫描工具例如nmap 暗礁的xscan源码看看]]></description>
			<content:encoded><![CDATA[<p>用“netstat－an”查看端口状态 在Windows2000/XP中，可以在命令提示符下使用“netstat-an”查看系统端口状态，可以列出系统正在开放的端口号及其状态。在stat下面有一些英文，简单说一下这些英文具体都代表什么<span id="more-142"></span></p>
<p>LISTEN：侦听来自远方的TCP端口的连接请求<br />
SYN-SENT：再发送连接请求后等待匹配的连接请求<br />
SYN-RECEIVED：再收到和发送一个连接请求后等待对方对连接请求的确认<br />
ESTABLISHED：代表一个打开的连接<br />
FIN-WAIT-1：等待远程TCP连接中断请求，或先前的连接中断请求的确认<br />
FIN-WAIT-2：从远程TCP等待连接中断请求<br />
CLOSE-WAIT：等待从本地用户发来的连接中断请求<br />
CLOSING：等待远程TCP对连接中断的确认<br />
LAST-ACK：等待原来的发向远程TCP的连接中断请求的确认<br />
TIME-WAIT：等待足够的时间以确保远程TCP接收到连接中断请求的确认<br />
CLOSED：没有任何连接状态</p>
<p>“telnet 目标ip 对端port”，是不是可以测试对端的tcp上的该port是不是开启状态？ 这个方法经常用于调试穿越防火墙的连接吧？我有点疑问，这是什么原理啊？<br />
####可以，telnet客户进程和终端用户本身就是通过tcp建立连接的，当然前提是双方都打开了相应的port，如果失败，那就证明没有开放次端口（当然这个不是绝对的，例如防火墙限制）如果穿越防火墙的话，根据我的经验，udp相对容易些</p>
<p>从过程来看，“telnet 目标ip” 就是想连接目标ip的telnet服务嘛，而且要默认占用对端的23端口； 后面又跟上另外一个端口算怎么回事啊？<br />
####telnet服务目的端默认的端口是23，这是应用层的C/S，所以你telnet+ip地址是可以的，对于类似sqlserver 2000</p>
<p>telnet服务的端口是1433，所以你就需要telnet+ip+port</p>
<p>另外这种方法好像只能测试对端的tcp端口吧？ 如果要测试对方的udp端口呢？<br />
####是的，telnet的原理已经说明，udp是无连接的，所以不能通过telnet的方式进行测试，一般可以向目标主机的每个端口发出一个0字节的udp包如果我们收到端口不可达的icmp消息，端口就是关闭的，否则假设它是打开的。这个你找点扫描工具例如nmap 暗礁的xscan源码看看</p>
]]></content:encoded>
			<wfw:commentRss>http://www.sweetytang.com/archives/142.html/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>z/OS communication server IP configuration guide</title>
		<link>http://www.sweetytang.com/archives/137.html</link>
		<comments>http://www.sweetytang.com/archives/137.html#comments</comments>
		<pubDate>Mon, 22 Jul 2013 16:09:56 +0000</pubDate>
		<dc:creator>牧羊人</dc:creator>
				<category><![CDATA[师夷长技]]></category>

		<guid isPermaLink="false">http://www.sweetytang.com/?p=137</guid>
		<description><![CDATA[Steps to configure SMTP: Verify TCP/IP profile statements in the TCP/IP profile data set. Update the SMTP cataloged procedure SEZAINST(SMTPPROC). Customize the SMTPNOTE CLIST and modify parmlib members. Customize the SMTP mail headers (optional). Set up a TCP-to-NJE mail gateway &#8230; <a href="http://www.sweetytang.com/archives/137.html">继续阅读 <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p align="left"><strong>Steps to configure SMTP:</strong></p>
<ol>
<li>Verify TCP/IP profile statements in the TCP/IP profile data set.</li>
<li>Update the SMTP cataloged procedure SEZAINST(SMTPPROC).</li>
<li>Customize the SMTPNOTE CLIST and modify parmlib members.</li>
<li>Customize the SMTP mail headers (optional).</li>
<li>Set up a TCP-to-NJE mail gateway (optional).</li>
<li>Specify configuration statements in the SMTP configuration data set.</li>
<li>Create an SMTP security table (optional).</li>
<li>Enable SMTP domain name resolution.</li>
<li>Enable sending messages to SMTP users and users on an IP Network.</li>
<li>Optionally, design SMTP exit to inspect and filter unwanted mail (<em>spam</em>).</li>
</ol>
<p>Set up automation to monitor how much mail is queued.<span id="more-137"></span></p>
<p align="left"><strong>Step 1: Verify TCP/IP profile statements in the</strong></p>
<p align="left">Consider specifying the following TCP/IP profile statements.</p>
<p align="left"><strong>AUTOLOG</strong></p>
<p align="left">If you want the SMTP server to start automatically when the TCPIP address space is started, include the name of the member that contains the SMTP cataloged procedure in the AUTOLOG statement of the <em>hlq</em>.PROFILE.TCPIP data set.</p>
<p align="left">AUTOLOG</p>
<p align="left">  SMTP</p>
<p align="left">ENDAUTOLOG</p>
<p align="left"><strong>PORT</strong></p>
<p align="left">To ensure that port TCP 25 is reserved for SMTP, verify that the name of the member that contains the SMTP cataloged procedure has been added to the PORT statement in<em>hlq</em>.PROFILE.TCPIP.</p>
<p align="left">PORT</p>
<p align="left">  25 TCP SMTP</p>
<p align="left"><strong>Other TCP/IP profile considerations</strong></p>
<p align="left">The SMTP server uses the Pascal API MonQuery function to obtain the IPv4 IP addresses defined for the TCP/IP stack. The total number of IPv4 IP addresses that can be defined for the TCP/IP stack is limited to 255 IP addresses. This limit of 255 IP addresses applies to all IPv4 IP addresses, including loopback and dynamic VIPA.</p>
<p align="left">For more information about TCP/IP profile statements, see <a href="http://publib.boulder.ibm.com/infocenter/zos/v1r12/topic/com.ibm.zos.r12.halz001/f1a1b4a0.htm">z/OS Communications Server: IP Configuration Reference</a>.</p>
<p align="left"><strong>Step 2: Update the SMTP cataloged procedure</strong></p>
<p align="left">Update the SMTP cataloged procedure by copying the sample in SEZAINST(SMTPPROC) to your system or recognized PROCLIB. Specify SMTP parameters, and change the data set as required to suit your local configuration. See <a href="http://publib.boulder.ibm.com/infocenter/zos/v1r12/topic/com.ibm.zos.r12.halz001/f1a1b4a0.htm">z/OS Communications Server: IP Configuration Reference</a>for more detailed information about the procedure.</p>
<p align="left"><strong>Note:</strong></p>
<p align="left">SMTP does not support z/OS® UNIX® files.</p>
<p align="left"><strong>Step 3: Customize the SMTPNOTE CLIST and modify parmlib data</strong></p>
<p align="left">You must copy and customize the SMTPNOTE CLIST on every system where users will be able to send mail with the SMTPNOTE command. This includes TCP/IP nodes and each NJE node that sends mail through SMTP on a remote gateway node. SMTPNOTE uses the TSO transmit (XMIT) command to interface with SMTP.</p>
<p align="left">Copy SEZAINST(SMTPNOTE) into the system CLIST data set. Since the SEZAINST data set is in a fixed format, the SMTPNOTE member may be truncated if your system CLIST library is not in a fixed format.</p>
<p align="left">You should customize the following variables in the SMTPNOTE CLIST:</p>
<p align="left"><strong>DDNAME</strong></p>
<p align="left">The DDNAME that SMTPNOTE will use to allocate the input data set. The allocation is done to allow shared access to the data set. The default value is set to EZBSMTPN and should only be changed if this value will cause a conflict on your system.</p>
<p align="left"><strong>HOSTNAME</strong></p>
<p align="left">The name of the system on which this CLIST is installed. Typically, the name is the NJE node name of this system. The NJE node name of the system is the value of the NAME parameter on the NODE(nn) statement in the JES2PARM member of parmlib.</p>
<p align="left"><strong>SMTPNODE</strong></p>
<p align="left">The NJE node on which the SMTP server runs. Typically, HOSTNAME and SMTPNODE have the same value. When SMTPNODE is used on an NJE network in conjunction with a TCP-to-NJE gateway, the value of this parameter is the NJE node name of that gateway.</p>
<p align="left"><strong>SMTPJOB</strong></p>
<p align="left">The name of the address space in which SMTP runs at SMTPNODE. Usually this is SMTP. The SMTPJOB name must not be defined as a node name to JES and cannot begin with the characters R, RM, or RMT, since SMTPNOTE uses TSO XMIT to transmit the note to the SMTP address space.</p>
<p align="left"><strong>TEMPDSN</strong></p>
<p align="left">The name of the temporary data set used to store the contents of the note being created. This can be any arbitrary data set name that ends with the low-level qualifier, TEXT. Do not use a fully qualified name. If you do not fully qualify the name (no quotes), the data set name will be prefixed by the <em>userid</em>. If you enclose the name in single quotes, several users can use this temporary data set.</p>
<p align="left"><strong>TIMEZONE</strong></p>
<p align="left">The time zone for your system. This will appear in the “Date:” stamp of the RFC 822 header generated by SMTPNOTE. See RFC 822 for valid time zone formats. SMTPNOTE does not check the validity of the character string configured. If SYSTZ is configured, SMTPNOTE gets the TIMEZONE value from the MVS™ system using the local TIME/DATE offset in the communication vector table (CVT) associated with SMTPNOTE. This value is then converted to a string format of a plus sign (+) or a minus sign (-) followed by 4 digits (for example, -<em>HHMM</em>). The local TIME/DATE offset is controlled by the system administrator that sets the MVS system time/date and timezone parameters. For more information about the <a href="http://publib.boulder.ibm.com/infocenter/zos/v1r12/topic/com.ibm.zos.r12.ieae200/clock.htm">CLOCK<em>xx</em></a> parmlib member, see <a href="http://publib.boulder.ibm.com/infocenter/zos/v1r12/topic/com.ibm.zos.r12.ieae200/iea2e2b0.htm">z/OS MVS Initialization and Tuning Reference</a>. For more information about the MVS <a href="http://publib.boulder.ibm.com/infocenter/zos/v1r12/topic/com.ibm.zos.r12.ieag100/set.htm">SET CLOCK=<em>hh</em>.<em>mm</em>.<em>ss</em></a> or <a href="http://publib.boulder.ibm.com/infocenter/zos/v1r12/topic/com.ibm.zos.r12.ieag100/set.htm">SET TIMEZONE={W|E}.<em>hh</em>.<em>mm</em></a> commands, see <a href="http://publib.boulder.ibm.com/infocenter/zos/v1r12/topic/com.ibm.zos.r12.ieag100/iea2g1b0.htm">z/OS MVS System Commands</a>. For information about accessing RFCs, see <a href="http://publib.boulder.ibm.com/infocenter/zos/v1r12/topic/com.ibm.zos.r12.halz002/rfc.htm#rfc">Related protocol specifications</a>.</p>
<p align="left"><strong>Note:</strong></p>
<p align="left">SMTPNOTE does not alter any existing date/time and timezone headers in the mail.</p>
<p align="left"><strong>ATSIGN</strong></p>
<p align="left">Some foreign languages need to use a different character to represent the @ symbol. This input symbol is a single-byte representation of the @ symbol in their national language code page.</p>
<p align="left"><strong>DOMAIN</strong></p>
<p align="left">Some SMTP message transfer agents (MTAs) need a fully qualified name as an email address for the originator of the mail. If DOMAIN is set, then this string is appended to the HOSTNAME variable string provided in this CLIST, and the resulting fully qualified name string is <em>hostname</em>.<em>domain</em>. The resulting string is later used by the CLIST to create the SMTP MAIL FROM: command and the RFC 822 From: header in the mail message. The CLIST does not check validity of the content of the string. This variable should be set when sending mail to CSSMTP.</p>
<p align="left">You should also modify the following parmlib members:</p>
<p align="left"><strong>IEFSSNxx</strong></p>
<p align="left">When the SMTP server is running in the same host (or system) as the SMTPNOTE CLIST, the IEFSSNxx member can be modified in one of the following two ways:</p>
<ul>
<li>The following lines may be included:</li>
<li>   TNF,MVPTSSI</li>
</ul>
<p align="left">   VMCF,MVPXSSI, nodename</p>
<p align="left">where <em>nodename</em> is the NJE node name. The NJE node name, <em>nodename</em>, must be the same as the <em>hostname</em> and the <em>smtpnode</em> that are defined in the SMTPNOTE CLIST.</p>
<ul>
<li>If you are using restartable VMCF, you must make changes to IEFSSxx members in the SYS1.PARMLIB data set.</li>
</ul>
<p align="left">For introductory information on restartable VMCF, see <a href="http://publib.boulder.ibm.com/infocenter/zos/v1r12/topic/com.ibm.zos.r12.halz002/drestor.htm#drestor">Step 3: Configure VMCF and TNF</a>. For the MVS system changes required for restartable VMCF, see the TCP/IP for MVS Program Directory. For information on VMCF commands, see <a href="http://publib.boulder.ibm.com/infocenter/zos/v1r12/topic/com.ibm.zos.r12.hald001/f1a1c5a0.htm">z/OS Communications Server: IP Diagnosis Guide</a>.</p>
<p align="left"><strong>Note:</strong></p>
<p align="left">You should define the SystemName in the IEFSSNxx parmlib member to be the same as your JES2 or JES3 (NJE) nodename. This is required for correct delivery of SMTP mail. For example, if the following line is coded in your SMTPNOTE CLIST:</p>
<p align="left">SMTPNODE P390</p>
<p align="left">you need to code NAME=P390 in your IEFSSNxx parmlib member. As an alternative, instead of using the IEFSSNxx parmlib member to specify the JES node, you can use the keyword NJENODENAME within your SMTP configuration to a valid NJE node. For more information, see NJENODENAME.</p>
<p align="left"><strong>IKJTSOxx</strong></p>
<p align="left">The TRANSREC statement must contain the correct nodename, or the NODESMF parameter can be coded as NODESMF((*,*)). For more information on the TRANSREC statement, see <a href="http://publib.boulder.ibm.com/infocenter/zos/v1r12/topic/com.ibm.zos.r12.ieae200/iea2e2b0.htm">z/OS MVS Initialization and Tuning Reference</a>.</p>
<p align="left"><strong>Step 4: Customize the SMTP mail headers (Optional)</strong></p>
<p align="left">Electronic mail has a standardized syntax for text messages that are sent across networks. The standard syntax is described in RFC 822. Messages have an envelope and contents. Envelopes contain all necessary information to accomplish transmission and delivery of the message content. The fields within the envelope are in a standard format.</p>
<p align="left">In most cases, the IBM-supplied mail header defaults are adequate. To understand the IBM-supplied mail header defaults, see <a href="http://publib.boulder.ibm.com/infocenter/zos/v1r12/topic/com.ibm.zos.r12.halz002/cfgproc.htm#ssmdsr">Default SMTP rules</a>. If it is necessary for you to change them, you can use the REWRITE822HEADER statement in the SMTP configuration data set to control the way SMTP performs a rewrite of the RFC 822 mail headers. Mail headers are passed from the local system, or NJE network, to the TCP network. Mail headers passing from the TCP network to the local system or NJE network are not affected. Only the addresses under certain RFC 822 header fields can be subject to the header rewriting rules.</p>
<p align="left">The header fields affected by the REWRITE822HEADER statement are:</p>
<p align="left"><strong>Field</strong></p>
<p align="left"><strong>Description</strong></p>
<p align="left"><strong>From</strong></p>
<p align="left">The identity of the person sending the message.</p>
<p align="left"><strong>Resent-From</strong></p>
<p align="left">Indicates the person that forwarded the message.</p>
<p align="left"><strong>Reply-To</strong></p>
<p align="left">Provides a mechanism for indicating any mailboxes to which responses are to be sent.</p>
<p align="left"><strong>Resent-Reply-To</strong></p>
<p align="left">Indicates the person to whom you should forward the reply.</p>
<p align="left"><strong>Return-Path</strong></p>
<p align="left">This field is added by the mail transport service at the time of final delivery. It contains definitive information about the address and route back to the originator of the message.</p>
<p align="left"><strong>Sender</strong></p>
<p align="left">The authenticated identity of the agent that sent the message. An agent can be a person, system, or process.</p>
<p align="left"><strong>Resent-Sender</strong></p>
<p align="left">The authenticated identity of the agent that has resent the message.</p>
<p align="left"><strong>To</strong></p>
<p align="left">Contains the identity of the primary recipient of the message.</p>
<p align="left"><strong>Cc</strong></p>
<p align="left">Contains the identity of the secondary (informational) recipients of the message.</p>
<p align="left"><strong>Bcc</strong></p>
<p align="left">Contains the identity of additional recipients of the message. The contents of this field are not included in copies sent to the primary and secondary recipients of the message but are included in the author&#8217;s copy.</p>
<p align="left"><strong>The SMTP rules data set</strong></p>
<p align="left">You can override the default rules for header addresses by creating an SMTP rules data set. This allows you to customize the address transformations to the needs of a particular site. If you are customizing SMTP mail headers, this task is required.</p>
<p align="left">The SMTP rules data set is pointed to by the //SMTPRULE DD statement in the SMTP cataloged procedure. The SMTP rules data set consists of:</p>
<p align="left"><strong>Field definition</strong></p>
<p align="left">Contains the names of all header fields whose addresses are to be rewritten.</p>
<p align="left"><strong>Rules definition</strong></p>
<p align="left">Contains the rewrite rules for the header fields.</p>
<p align="left"><strong>Statement syntax</strong></p>
<p align="left">In creating the SMTP rules data set you must use the following syntax conventions:</p>
<ul>
<li>The data set statements are free-format. Tokens can be separated by an arbitrary number of spaces, and statements can span an arbitrary number of lines. However, you must end every statement with a semicolon (;).</li>
<li>A character string appearing within single quotation marks (&#8216;&#8230;&#8217;) is not case-sensitive. For example, &#8216;abc&#8217; represents &#8216;abc&#8217;, &#8216;Abc&#8217;, &#8216;ABC&#8217;, and so forth.</li>
<li>A character string appearing within double quotation marks (“&#8230;”) is case-sensitive. For example, “abc” only represents “abc”. It does not represent “Abc”, “ABC”, and so forth.</li>
</ul>
<p align="left">Special characters, such as @ and % are treated the same whether enclosed by single quotation marks or double quotation marks.</p>
<ul>
<li>Double-hyphens (“&#8211;”) are used to begin a comment. The comment extends to the end of the line.</li>
</ul>
<p align="left">The components of the SMTP rules data set are described in <a href="http://publib.boulder.ibm.com/infocenter/zos/v1r12/topic/com.ibm.zos.r12.halz002/cfgproc.htm#ssmffds">Format of the field definition section</a> and <a href="http://publib.boulder.ibm.com/infocenter/zos/v1r12/topic/com.ibm.zos.r12.halz002/cfgproc.htm#ssmfrds">Format of the rule definition section</a>.</p>
<p align="left"><strong>Format of the field definition section</strong></p>
<p align="left">The field definition section is the first section in any SMTP rules data set. It defines any applicable alias fields, and it is introduced by the following heading:</p>
<p align="left">Field Definition Section</p>
<p align="left">This section allows similar fields to be grouped under an alias or common name. This name, or alias, is used to represent the field list. You can define an arbitrary number of aliases representing a set of field lists.</p>
<p align="left">An alias name can be any alphanumeric sequence of characters that is not a predefined keyword within the SMTP rules (see the following). However, the alias name DefaultFields is treated specially by the SMTP configuration interpreter. If DefaultFields is defined, and if a rule is written that does not specify an associated field alias, the rules interpreter assumes thatDefaultFields is the associated field alias.</p>
<p align="left">The alias definition within this section is of the following form:</p>
<p align="left"><em>alias_name</em> = <em>alias_definition</em>; <em>optional comment</em></p>
<p align="left">where <em>alias_name</em> is the name of the alias and <em>alias_definition</em> is an expression describing which fields are to be grouped under this alias. This expression can be as simple as a single field name. For example:</p>
<p align="left">MyAlias = &#8216;To&#8217;;</p>
<p align="left">The aliases can be a list or set of field names. The field names <strong><em>To, From, Cc</em></strong>, and <strong><em>Bcc</em></strong>, in the following example are part of a set of field names referenced by the alias MyAlias.</p>
<p align="left">MyAlias = &#8216;To&#8217; &#8216;From&#8217; &#8216;Cc&#8217; &#8216;Bcc&#8217; ; &#8212; first list of fields</p>
<p align="left">You can combine field names and previously defined aliases to create a new alias. In the following example, the set of field names defined as MyAlias and the field names in the new alias YourAlias are combined to form a third set. The new alias TheirAlias is the union of both aliases and contains the fields of MyAlias and YourAlias.</p>
<p align="left">MyAlias    = &#8216;To&#8217; &#8216;From&#8217; &#8216;Cc&#8217; &#8216;Bcc&#8217;;</p>
<p align="left">YourAlias  = &#8216;Errors-To&#8217; &#8216;Warnings-To&#8217;;</p>
<p align="left">TheirAlias =  MyAlias YourAlias;</p>
<p align="left">In the previous example, TheirAlias is an alias that represents the following fields:</p>
<p align="left">TheirAlias:  &#8216;To&#8217; &#8216;From&#8217; &#8216;Cc&#8217; &#8216;Bcc&#8217; &#8216;Errors-To&#8217; &#8216;Warnings-To&#8217;</p>
<p align="left">You can perform the following operations on set members of the alias to create a subset of the initial alias:</p>
<ul>
<li>Union operations</li>
<li>Difference operations</li>
<li>Intersection operations</li>
</ul>
<p align="left"><strong>Union and difference operations</strong></p>
<p align="left">Certain field names can be added to or omitted from a new alias of field names by using a minus sign to omit set members and an optional plus sign to include another field name. In the mathematics of sets, when you add together 2 or more sets, they form a union. When set members are omitted, the remaining set is created by the difference operation. In the following example HerAlias and HisAlias are defined. The alias HisAlias is created from the union of TheirAlias, HerAlias, and the omission of Warning-To and Bcc from the sets:</p>
<p align="left">HerAlias   = &#8216;Reply-To&#8217; &#8216;Sender&#8217;;</p>
<p align="left">HisAlias   = TheirAlias &#8211; &#8216;Warnings-To&#8217; &#8211; &#8216;Bcc&#8217; + HerAlias;</p>
<p align="left">In the previous example, HisAlias is an alias that represents the following fields:</p>
<p align="left">HisAlias:  &#8216;To&#8217; &#8216;From&#8217; &#8216;Cc&#8217; &#8216;Errors-To&#8217; &#8216;Reply-To&#8217; &#8216;Sender&#8217;</p>
<p align="left"><strong>Intersection operations</strong></p>
<p align="left">A field definition can include an intersection operation. When the intersection operation is applied to two field expressions, the resulting set contains the fields common to both. In the following example, MyAlias and YourAlias are defined. The alias OurAlias is created from the intersection of MyAlias and YourAlias. The asterisk (*) is the intersection operator.</p>
<p align="left">MyAlias    = &#8216;Bcc&#8217; &#8216;Cc&#8217; &#8216;From&#8217; &#8216;Reply-To&#8217;;</p>
<p align="left">YourAlias  = &#8216;Resent-From&#8217; &#8216;Cc&#8217; &#8216;Sender&#8217; &#8216;To&#8217; &#8216;Bcc&#8217;;</p>
<p align="left">OurAlias   = MyAlias * YourAlias; &#8212; the intersection</p>
<p align="left">In the previous example, OurAlias represents the following fields:</p>
<p align="left">OurAlias:  &#8216;Bcc&#8217; &#8216;Cc&#8217;</p>
<p align="left">In the following complex example TheirAlias is created from the intersection of YourAlias with the sum of MyAlias plus Resent-From:</p>
<p align="left">TheirAlias = (MyAlias + &#8216;Resent-From&#8217;) * YourAlias;</p>
<p align="left">In the previous example, TheirAlias represents the following fields:</p>
<p align="left">TheirAlias: &#8216;Bcc&#8217; &#8216;Cc&#8217; &#8216;Resent-From&#8217;</p>
<p align="left">The parentheses within the definition of TheirAlias perform the same functions as in algebra. Field expressions are evaluated from left to right, but the intersection operation has greater priority than union and difference operations. If parentheses were not used in the definition ofTheirAlias, the result would be:</p>
<p align="left">TheirAlias: &#8216;Bcc&#8217; &#8216;Cc&#8217; &#8216;From&#8217; &#8216;Reply-To&#8217; &#8216;Resent-From&#8217;</p>
<p align="left"><strong>Format of the rule definition section</strong></p>
<p align="left">The rule definition section is the next section in any SMTP RULES data set. It contains the header rewriting rules that define the intended address transformations, and it is introduced by the following heading:</p>
<p align="left">Rule Definition Section</p>
<p align="left">The basic form of a rewrite rule is:</p>
<p align="left"><em>alias</em> :<em>before-address-pattern</em>  =&gt; <em>after-address-pattern</em>;</p>
<p align="left">where the alias name <em>alias</em> is an optional name representing the fields for which the rule is applicable. If the alias name <em>alias</em> : is omitted from this part of the rules, then DefaultFields is assumed.</p>
<p align="left">The sequence of tokens that define how a particular type of address is to be recognized is the<em>before-address-pattern</em> portion of the rules definition. The sequence of tokens that define how the address is to appear after the address has been rewritten is the <em>after-address-pattern</em>portion of the rules definition. The following example is the rule for converting host names:</p>
<p align="left">A &#8216;@&#8217; NJEHostName =&gt; A &#8216;@&#8217; TCPHostName; &#8212; convert host names</p>
<p align="left">In the previous example, A &#8216;@&#8217; NJEHostName is the <em>before-address-pattern</em> portion of this rule, andA &#8216;@&#8217; TCPHostName is the <em>after-address-pattern</em> portion. This rule specifies that the address to be rewritten has an arbitrary local name (A), an at sign (@), and the NJE host name (NJEHostName) of the current site. The rule also specifies that the rewritten address must contain the same arbitrary local name (A), an at sign, and the current site&#8217;s TCP host name TCPHostName.</p>
<p align="left"><strong>SMTP rules syntax conventions</strong></p>
<p align="left">Use the following syntax convention when writing SMTP rules:</p>
<ul>
<li>Some keywords have special meaning to the rules interpreter. For example, NJEHostNamekeyword means the NJE host name of the present system, and TCPHostName keyword means the TCP host name of the present system. For more information about valid keywords see <a href="http://publib.boulder.ibm.com/infocenter/zos/v1r12/topic/com.ibm.zos.r12.halz002/cfgproc.htm#ssmpkws">Predefined keywords within the SMTP rules</a>. Some keywords, such asTCPHostName, have single values. Other keywords, such as AltTCPHostName and AnyDomainName, can have many possible values. To avoid ambiguity, any keyword that can have multiple values, and is used in the <em>after-address-pattern</em> of a given rule, must appear exactly once within the <em>before-address-pattern</em> of that rule. The following rule example shows a valid syntax:</li>
</ul>
<ul>
<li>         A &#8216;@&#8217; AltTCPHostName &#8216;.&#8217; AltTCPHostName =&gt;</li>
<li>            A &#8216;%&#8217; TCPHostName &#8216;@&#8217; TCPHostName;</li>
</ul>
<p align="left">The following two rules have incorrect syntax because the first keyword AltTCPHostNamemust be rewritten to a keyword with specific values. The AltTCPHostName is attempting to be rewritten to the same AltTCPHostName but with unknown values, which is not valid.</p>
<p align="left">         A &#8216;@&#8217; AltTCPHostName &#8216;.&#8217; AltTCPHostName =&gt;</p>
<p align="left">            A &#8216;%&#8217; AltTCPHostName &#8216;@&#8217; TCPHostName;</p>
<p align="left">         A &#8216;@&#8217; TCPHostName =&gt; A &#8216;@&#8217; AltTCPHostName;</p>
<p align="left">Any rule whose <em>before-address-pattern</em> includes a keyword that has a null value is ignored during the header rewriting. Thus, if there is no AltNJEDomain defined in the system configuration data set, no rule that includes AltNJEDomain in the <em>before-address-pattern</em> is considered during the header rewriting.</p>
<ul>
<li>Alphanumeric identifiers that are not within single or double quotation marks, and that are not predefined keywords, are considered wildcards in the rule statement. Wildcards represent an arbitrary (non-null) sequence of characters. The identifier A, in the previous rule example, is a wildcard. Thus, if host were the NJE host name for the current site, and if tcphost were the TCP host name for the current site, the previous rule example recognizes abc@host and d@host as candidates for address rewriting, and rewrites them asabc@tcphost and d@tcphost respectively. To avoid ambiguity, within the <em>before-address-pattern</em> of a given rule, no two wildcards are allowed in a row, and the same wildcard cannot be used more than once. The following rules have valid syntax:</li>
</ul>
<ul>
<li>         A &#8216;@&#8217; B TCPHostName      =&gt; A &#8216;%&#8217; B &#8216;@&#8217; TCPHostName;</li>
</ul>
<p align="left">         A &#8216;%&#8217; B &#8216;@&#8217; NJEHostName =&gt; A B &#8216;@&#8217; TCPHostName;</p>
<p align="left">The following rules have incorrect syntax because the first rule has 2 wildcards in a rowA and B. The second rule has the same wildcard A repeated:</p>
<p align="left">         A B &#8216;@&#8217; TCPHostName      =&gt; A A &#8216;%&#8217; B &#8216;@&#8217; TCPHostName;</p>
<p align="left">         A &#8216;%&#8217; A &#8216;@&#8217; NJEHostName =&gt; A &#8216;@&#8217; TCPHostName;</p>
<ul>
<li>A character string appearing within single or double quotation marks tells the rules interpreter where a particular string is to appear within a header address. In the previous rule example, the &#8217;@' string in the <em>before-address-pattern</em> tells the rules interpreter that an at-sign (@) must appear between the arbitrary character string and the NJE host name. The &#8217;@' string in the <em>after-address-pattern</em> tells the rules interpreter that the address must be rewritten so an at-sign appears between the arbitrary string and the TCP host name. As previously mentioned, single quotation marks denote strings that are not case-sensitive, and double quotation marks denote case-sensitive strings.</li>
<li>The character sequence ”=&gt;”, with no spaces between the characters, separates the<em>before-address-pattern</em> from the <em>after-address-pattern</em>.</li>
<li>The order in which the rules are specified is important; the first rule encountered whose<em>before-address-pattern</em> matches the current address is the rule to dictate the address transformation. Once a matching rule has been found for an address, no other rule is considered.</li>
</ul>
<p align="left">In addition to the rules themselves, there is the capability for some simple logic to decide at system configuration time which rules within the data set should become active. These conditions are specified in the form of an IF-THEN-ELSE statement, as shown in the following example:</p>
<p align="left">   IF cond THEN</p>
<p align="left">      statement list</p>
<p align="left">   ELSE</p>
<p align="left">      statement list</p>
<p align="left">   ENDIF</p>
<p align="left">A statement list can consist of any number of rules or nested IF statements, or both. Each IF statement, regardless of whether it is nested, must be ended by an ENDIF keyword. As with IF statements in other programming languages, the ELSE clause is optional.</p>
<p align="left">There are only two conditions recognized by an IF statement:</p>
<ol>
<li>IF <em>predefined keyword</em> = &#8216;<em>character string</em>&#8216; THEN &#8230; ENDIF</li>
<li>IF <em>predefined keyword</em> CONTAINS &#8216;<em>character string</em>&#8216; THEN &#8230; ENDIF</li>
</ol>
<p align="left">The conditional operators = and CONTAINS can be prefixed by the word NOT to invert the conditions.</p>
<p align="left">The <em>predefined keyword</em> must be a keyword that resolves to a single value at system configuration time. The character string in the first condition can be null. A character string cannot span more than one line.</p>
<p align="left">The following example shows the use of IF statements.</p>
<p align="left">IF NJEDomain = ” THEN</p>
<p align="left">   A &#8216;@&#8217; AnyNJEHostName =&gt; A &#8216;%&#8217; AnyNJEHostName &#8216;@&#8217; TCPHostName;</p>
<p align="left">ELSE</p>
<p align="left">   A &#8216;@&#8217; NJEHostName &#8216;.&#8217; NJEDomain    =&gt; A &#8216;@&#8217; TCPHostName;</p>
<p align="left">   A &#8216;@&#8217; NJEHostName &#8216;.&#8217; AltNJEDomain =&gt; A &#8216;@&#8217; TCPHostName;</p>
<p align="left">   IF NJEDomain CONTAINS &#8216;.&#8217; THEN</p>
<p align="left">      A &#8216;@&#8217; AnyNJEHostName                   =&gt;</p>
<p align="left">         A &#8216;@&#8217; AnyNJEHostName &#8216;.&#8217; NJEDomain;</p>
<p align="left">      A &#8216;@&#8217; AnyNJEHostName &#8216;.&#8217; NJEDomain    =&gt;</p>
<p align="left">         A &#8216;@&#8217; AnyNJEHostName &#8216;.&#8217; NJEDomain;</p>
<p align="left">      A &#8216;@&#8217; AnyNJEHostName &#8216;.&#8217; AltNJEDomain =&gt;</p>
<p align="left">         A &#8216;@&#8217; AnyNJEHostName &#8216;.&#8217; NJEDomain;</p>
<p align="left">   ELSE</p>
<p align="left">      A &#8216;@&#8217; AnyNJEHostName                   =&gt;</p>
<p align="left">         A &#8216;%&#8217; AnyNJEHostName &#8216;.&#8217; NJEDomain &#8216;@&#8217; TCPHostName;</p>
<p align="left">      A &#8216;@&#8217; AnyNJEHostName &#8216;.&#8217; NJEDomain    =&gt;</p>
<p align="left">         A &#8216;%&#8217; AnyNJEHostName &#8216;.&#8217; NJEDomain &#8216;@&#8217; TCPHostName;</p>
<p align="left">      A &#8216;@&#8217; AnyNJEHostName &#8216;.&#8217; AltNJEDomain =&gt;</p>
<p align="left">         A &#8216;%&#8217; AnyNJEHostName &#8216;.&#8217; NJEDomain &#8216;@&#8217; TCPHostName;</p>
<p align="left">   ENDIF</p>
<p align="left">ENDIF</p>
<p align="left"><strong>Predefined keywords within the SMTP rules</strong></p>
<p align="left">The following predefined keywords can be used to define the header rewriting rules:</p>
<p align="left"><strong>AltNJEDomain</strong></p>
<p align="left">Matches the alternative domain name of the NJE network as defined by the ALTNJEDOMAIN statement in the SMTP configuration data set.</p>
<p align="left"><strong>AltTCPHostName</strong></p>
<p align="left">Matches any alternative TCP host name of the system, as defined by ALTTCPHOSTNAME statements in the SMTP configuration data set.</p>
<p align="left"><strong>AnyDomainName</strong></p>
<p align="left">Matches any fully qualified domain name. Any host name with a period (.) is considered to be a fully qualified domain name.</p>
<p align="left"><strong>AnyNJEHostName</strong></p>
<p align="left">Matches any (unqualified) NJE host name defined in the SMTPNJE.HOSTINFO data set.</p>
<p align="left"><strong>NJEDomain</strong></p>
<p align="left">Matches the domain name of the NJE network as defined by the NJEDOMAIN statement in the SMTP configuration data set.</p>
<p align="left"><strong>NJEHostName</strong></p>
<p align="left">Matches the NJE host name of the system.</p>
<p align="left"><strong>SecureNickAddr</strong></p>
<p align="left">Matches an address of the form <em>NJE_user_id@NJE_node_id</em>, where <em>NJE_user_id</em>, and<em>NJE_node_id</em> are defined with a nickname in the SMTP security data set.</p>
<p align="left"><strong>Note:</strong></p>
<p align="left">This only matches user and node IDs that are defined with nicknames.</p>
<p align="left">When SecureNickAddr is specified in the <em>before-address-pattern</em> of a rule, SMTP automatically associates the keyword SecureNickName with the corresponding nickname. This allows SecureNickName to be specified in the <em>after-address-pattern</em>.</p>
<p align="left"><strong>SecureNickName</strong></p>
<p align="left">Matches a nickname defined in the SMTP security data set. When SecureNickName is specified in the <em>before-address-pattern</em> of a rule, SMTP automatically associates the keyword SecureNickAddr with the corresponding <em>NJE_user_id@NJE_node_id</em>. This allows SecureNickAddr to be specified in the <em>after-address-pattern</em>.</p>
<p align="left"><strong>ShortTCPHostName</strong></p>
<p align="left">Matches the first portion of the TCP host name of the system, as defined by the HOSTNAME statement in the TCPIP.DATA data set. For example, if the TCP host name was mvs1.acme.com, the value of ShortTCPHostName is mvs1.</p>
<p align="left"><strong>TCPHostName</strong></p>
<p align="left">Matches the TCP host name of the system as defined by the concatenation of the HOSTNAME and DOMAINORIGIN statements in the TCPIP.DATA data set.</p>
<p align="left"><strong>TCPHostNameDomain</strong></p>
<p align="left">Matches the domain portion of the TCP host name of the system as defined by the DOMAINORIGIN statement in the TCPIP.DATA data set. For example, if the TCP host name was mvs1.acme.com, the value of TCPHostNameDomain is acme.com.</p>
<p align="left">The predefined keywords can consist of any combination of uppercase and lowercase characters; the rules interpreter does not distinguish between them.</p>
<p align="left">The secure keywords are only valid when SMTP is configured to be a secure gateway.</p>
<p align="left"><strong>Default SMTP rules</strong></p>
<p align="left">If the //SMTPRULE DD statement is not found, SMTP uses a default set of rules. The default set used depends on whether SMTP is configured as a secure gateway.</p>
<p align="left"><strong>SMTP nonsecure gateway configuration defaults</strong></p>
<p align="left">If SMTP is not configured as a secure gateway, SMTP uses the following defaults:</p>
<p align="left">FIELD DEFINITION SECTION</p>
<p align="left">DEFAULTFIELDS = &#8216;BCC&#8217; &#8216;CC&#8217; &#8216;FROM&#8217; &#8216;REPLY-TO&#8217; &#8216;RESENT-FROM&#8217;</p>
<p align="left">                &#8216;RESENT-REPLY-TO&#8217; &#8216;RESENT-SENDER&#8217; &#8216;RETURN-PATH&#8217;</p>
<p align="left">                &#8216;SENDER&#8217; &#8216;TO&#8217;;</p>
<p align="left">RULE DEFINITION SECTION</p>
<p align="left">A &#8216;@&#8217; NJEHOSTNAME =&gt; A &#8216;@&#8217; TCPHOSTNAME;</p>
<p align="left">IF NJEDOMAIN = ” THEN</p>
<p align="left">   A &#8216;@&#8217; ANYNJEHOSTNAME =&gt; A &#8216;%&#8217; ANYNJEHOSTNAME &#8216;@&#8217; TCPHOSTNAME;</p>
<p align="left">ELSE</p>
<p align="left">   A &#8216;@&#8217; NJEHOSTNAME &#8216;.&#8217; NJEDOMAIN    =&gt; A &#8216;@&#8217; TCPHOSTNAME;</p>
<p align="left">   A &#8216;@&#8217; NJEHOSTNAME &#8216;.&#8217; ALTNJEDOMAIN =&gt; A &#8216;@&#8217; TCPHOSTNAME;</p>
<p align="left">   IF NJEDOMAIN CONTAINS &#8216;.&#8217; THEN</p>
<p align="left">      A &#8216;@&#8217; ANYNJEHOSTNAME                  =&gt;</p>
<p align="left">         A &#8216;@&#8217; ANYNJEHOSTNAME &#8216;.&#8217; NJEDOMAIN;</p>
<p align="left">      A &#8216;@&#8217; ANYNJEHOSTNAME &#8216;.&#8217; NJEDOMAIN    =&gt;</p>
<p align="left">         A &#8216;@&#8217; ANYNJEHOSTNAME &#8216;.&#8217; NJEDOMAIN;</p>
<p align="left">      A &#8216;@&#8217; ANYNJEHOSTNAME &#8216;.&#8217; ALTNJEDOMAIN =&gt;</p>
<p align="left">         A &#8216;@&#8217; ANYNJEHOSTNAME &#8216;.&#8217; NJEDOMAIN;</p>
<p align="left">    ELSE</p>
<p align="left">       A &#8216;@&#8217; ANYNJEHOSTNAME                  =&gt;</p>
<p align="left">          A &#8216;%&#8217; ANYNJEHOSTNAME &#8216;.&#8217; NJEDOMAIN &#8216;@&#8217; TCPHOSTNAME;</p>
<p align="left">       A &#8216;@&#8217; ANYNJEHOSTNAME &#8216;.&#8217; NJEDOMAIN    =&gt;</p>
<p align="left">          A &#8216;%&#8217; ANYNJEHOSTNAME &#8216;.&#8217; NJEDOMAIN &#8216;@&#8217; TCPHOSTNAME;</p>
<p align="left">       A &#8216;@&#8217; ANYNJEHOSTNAME &#8216;.&#8217; ALTNJEDOMAIN =&gt;</p>
<p align="left">          A &#8216;%&#8217; ANYNJEHOSTNAME &#8216;.&#8217; NJEDOMAIN &#8216;@&#8217; TCPHOSTNAME;</p>
<p align="left">    ENDIF</p>
<p align="left"> ENDIF</p>
<p align="left">A &#8216;@&#8217; TCPHOSTNAME       =&gt; A &#8216;@&#8217; TCPHOSTNAME;</p>
<p align="left">A &#8216;@&#8217; SHORTTCPHOSTNAME  =&gt; A &#8216;@&#8217; TCPHOSTNAME;</p>
<p align="left">A &#8216;@&#8217; ALTTCPHOSTNAME    =&gt; A &#8216;@&#8217; TCPHOSTNAME;</p>
<p align="left">A &#8216;@&#8217; ANYDOMAINNAME     =&gt; A &#8216;@&#8217; ANYDOMAINNAME;</p>
<p align="left">A &#8216;@&#8217; B                 =&gt; A &#8216;@&#8217; B &#8216;.&#8217; TCPHOSTNAMEDOMAIN;</p>
<p align="left"><strong>SMTP secure gateway configuration defaults</strong></p>
<p align="left">If SMTP is configured as a secure gateway, SMTP uses the following defaults:</p>
<p align="left">FIELD DEFINITION SECTION</p>
<p align="left">DEFAULTFIELDS = &#8216;BCC&#8217; &#8216;CC&#8217; &#8216;FROM&#8217; &#8216;REPLY-TO&#8217; &#8216;RESENT-FROM&#8217;</p>
<p align="left">                &#8216;RESENT-REPLY-TO&#8217; &#8216;RESENT-SENDER&#8217; &#8216;RETURN-PATH&#8217;</p>
<p align="left">                &#8216;SENDER&#8217; &#8216;TO&#8217;;</p>
<p align="left">RULE DEFINITION SECTION</p>
<p align="left">SECURENICKADDR    =&gt; SECURENICKNAME &#8216;@&#8217; TCPHOSTNAME;</p>
<p align="left">A &#8216;@&#8217; NJEHOSTNAME =&gt; A &#8216;@&#8217; TCPHOSTNAME;</p>
<p align="left">IF NJEDOMAIN NOT = ” THEN</p>
<p align="left">   SECURENICKADDR &#8216;.&#8217; NJEDOMAIN    =&gt; SECURENICKNAME &#8216;@&#8217; TCPHOSTNAME;</p>
<p align="left">   SECURENICKADDR &#8216;.&#8217; ALTNJEDOMAIN =&gt; SECURENICKNAME &#8216;@&#8217; TCPHOSTNAME;</p>
<p align="left">   A &#8216;@&#8217; NJEHOSTNAME &#8216;.&#8217; NJEDOMAIN    =&gt; A &#8216;@&#8217; TCPHOSTNAME;</p>
<p align="left">   A &#8216;@&#8217; NJEHOSTNAME &#8216;.&#8217; ALTNJEDOMAIN =&gt; A &#8216;@&#8217; TCPHOSTNAME;</p>
<p align="left">   IF NJEDOMAIN CONTAINS &#8216;.&#8217; THEN</p>
<p align="left">      A &#8216;@&#8217; ANYNJEHOSTNAME                  =&gt;</p>
<p align="left">         A &#8216;@&#8217; ANYNJEHOSTNAME &#8216;.&#8217; NJEDOMAIN;</p>
<p align="left">      A &#8216;@&#8217; ANYNJEHOSTNAME &#8216;.&#8217; NJEDOMAIN    =&gt;</p>
<p align="left">         A &#8216;@&#8217; ANYNJEHOSTNAME &#8216;.&#8217; NJEDOMAIN;</p>
<p align="left">      A &#8216;@&#8217; ANYNJEHOSTNAME &#8216;.&#8217; ALTNJEDOMAIN =&gt;</p>
<p align="left">         A &#8216;@&#8217; ANYNJEHOSTNAME &#8216;.&#8217; NJEDOMAIN;</p>
<p align="left">    ELSE</p>
<p align="left">       A &#8216;@&#8217; ANYNJEHOSTNAME                  =&gt;</p>
<p align="left">          A &#8216;%&#8217; ANYNJEHOSTNAME &#8216;.&#8217; NJEDOMAIN &#8216;@&#8217; TCPHOSTNAME;</p>
<p align="left">       A &#8216;@&#8217; ANYNJEHOSTNAME &#8216;.&#8217; NJEDOMAIN    =&gt;</p>
<p align="left">          A &#8216;%&#8217; ANYNJEHOSTNAME &#8216;.&#8217; NJEDOMAIN &#8216;@&#8217; TCPHOSTNAME;</p>
<p align="left">       A &#8216;@&#8217; ANYNJEHOSTNAME &#8216;.&#8217; ALTNJEDOMAIN =&gt;</p>
<p align="left">          A &#8216;%&#8217; ANYNJEHOSTNAME &#8216;.&#8217; NJEDOMAIN &#8216;@&#8217; TCPHOSTNAME;</p>
<p align="left">    ENDIF</p>
<p align="left"> ENDIF</p>
<p align="left"> A &#8216;@&#8217; TCPHOSTNAME       =&gt; A &#8216;@&#8217; TCPHOSTNAME;</p>
<p align="left"> A &#8216;@&#8217; SHORTTCPHOSTTNAME =&gt; A &#8216;@&#8217; TCPHOSTNAME;</p>
<p align="left"> A &#8216;@&#8217; ALTTCPHOSTNAME    =&gt; A &#8216;@&#8217; TCPHOSTNAME;</p>
<p align="left"> A &#8216;@&#8217; ANYDOMAINNAME     =&gt; A &#8216;@&#8217; ANYDOMAINNAME;</p>
<p align="left"> A &#8216;@&#8217; B                 =&gt; A &#8216;@&#8217; B &#8216;.&#8217; TCPHOSTNAMEDOMAIN;</p>
<p align="left"><strong>Examples of header rewrite rules</strong></p>
<p align="left">The following examples show how the header rewriting rules affect an SMTP mail header. The example site is not a secure gateway and is configured as follows:</p>
<p align="left">   TCPHostName      = mvs1.acme.com</p>
<p align="left">   ShortTCPHostName = mvs1</p>
<p align="left">   AltTCPHostName   = seeds.acme.com</p>
<p align="left">   NJEHostName     = mvs1</p>
<p align="left">   NJEDomain       = acmenet</p>
<p align="left">   AltNJEDomain    = centralnet</p>
<p align="left">Note that the above keywords are configured according to the definitions found in <a href="http://publib.boulder.ibm.com/infocenter/zos/v1r12/topic/com.ibm.zos.r12.halz002/cfgproc.htm#ssmpkws">Predefined keywords within the SMTP rules</a> (for example, from TCPIP.DATA). In addition, assume that the following are known to be other NJE hosts:</p>
<p align="left">   bird</p>
<p align="left">   iron</p>
<p align="left">Then the following header:</p>
<p align="left">   From: abc@mvs1 (Brendan Beeper)</p>
<p align="left">   To: Jenny Bird &lt;def@bird&gt;</p>
<p align="left">   Cc: ghi@iron.acmenet, j@mvs1,</p>
<p align="left">    k@seeds.acme.com,</p>
<p align="left">    Mailing List &lt;owner@acmenet&gt;,</p>
<p align="left">    lmno@iron.centralnet</p>
<p align="left">   Subject: New Ore</p>
<p align="left">is rewritten by the default header rewriting rules as:</p>
<p align="left">   From: abc@mvs1.acme.com (Brendan Beeper)</p>
<p align="left">   To: Jenny Bird &lt;def%bird.acmenet@mvs1.acme.com&gt;</p>
<p align="left">   Cc: ghi%iron.acmenet@mvs1.acme.com, j@mvs1.acme.com,</p>
<p align="left">    k@mvs1.acme.com,</p>
<p align="left">    Mailing List &lt;owner%acmenet@mvs.acme.com&gt;,</p>
<p align="left">    lmno%iron.acmenet@mvs1.acme.com</p>
<p align="left">   Subject: New Ore</p>
<p align="left">The next example deviates from the defaults listed in <a href="http://publib.boulder.ibm.com/infocenter/zos/v1r12/topic/com.ibm.zos.r12.halz002/cfgproc.htm#ssmdsr">Default SMTP rules</a>. On the configuration for nonsecure gateways, if you change the rule before the 2 ENDIFs to:</p>
<p align="left">   A &#8216;@&#8217; AnyNJEHostName &#8216;.&#8217; AltNJEDomain =&gt;</p>
<p align="left">      &#8216;&lt;@&#8217; TCPHostName &#8216;:&#8217; A &#8216;@&#8217; AnyNJEHostName &#8216;.&#8217; NJEDomain &#8216;&gt;&#8217;;</p>
<p align="left">then the last address in the Cc: field within our header is rewritten as:</p>
<p align="left">   Cc: &lt;@mvs1.acme.com:lmno@iron.acmenet&gt;</p>
<p align="left"><strong>Note:</strong></p>
<p align="left">Do not make the change shown in the previous example; it is intended only as a demonstration of the capabilities of the pattern-matching language.</p>
<p align="left"><strong>Step 5: Set up a TCP-to-NJE mail gateway (Optional)</strong></p>
<p align="left">You can configure the SMTP server to run as a mail gateway between TCP network users and users located on a NJE network attached to the local host. This way NJE users can send mail or data sets to users on TCP hosts using SMTPNOTE. See <a href="http://publib.boulder.ibm.com/infocenter/zos/v1r12/topic/com.ibm.zos.r12.halu001/f1a1b990.htm">z/OS Communications Server: IP User&#8217;s Guide and Commands</a> for more information about SMTPNOTE. For JES2, see <a href="http://publib.boulder.ibm.com/infocenter/zos/v1r12/topic/com.ibm.zos.r12.hasa300/has2a390.htm">z/OS JES2 Initialization and Tuning Guide</a> and <a href="http://publib.boulder.ibm.com/infocenter/zos/v1r12/topic/com.ibm.zos.r12.hasa400/has2a4a0.htm">z/OS JES2 Initialization and Tuning Reference</a>. For JES3, see<a href="http://publib.boulder.ibm.com/infocenter/zos/v1r12/topic/com.ibm.zos.r12.iata600/iat2a690.htm">z/OS JES3 Initialization and Tuning Guide</a> and <a href="http://publib.boulder.ibm.com/infocenter/zos/v1r12/topic/com.ibm.zos.r12.iata800/iat2a890.htm">z/OS JES3 Initialization and Tuning Reference</a>.</p>
<p align="left">Follow these steps to set up your TCP-to-NJE mail gateway:</p>
<ol>
<li>Add the GATEWAY statement to the SMTP configuration data set. Add other related statements, such as ALTDOMAIN, NJECLASS, NJEDOMAIN, and NJEFORMAT, as required by your configuration.</li>
<li>Issue the SMTPNJE command.</li>
<li>&gt;&gt;-SMTPNJE&#8211;<em>data_set_name(member)</em>&#8211;+&#8212;&#8212;&#8212;&#8212;+&#8212;&#8212;&#8212;&#8212;&#8211;&gt;&lt;</li>
<li>                                   |   .-JES2-. |</li>
<li>                                   &#8217;-(-+-JES3-+-&#8217;</li>
<li></li>
</ol>
<p align="left"><strong><em>data_set_name(member)</em></strong><strong></strong></p>
<p align="left">The name of the input data set for SMTPNJE. It specifies the initialization data set of the JES2 or JES3 subsystem that is scanned for NJE nodes by SMTPNJE. The data set name is the same name as defined on ddname HASPPARM in your JES2 procedure or in the JES3IN ddname in your JES3 procedure.</p>
<p align="left"><em>member</em> is the JES2PARM member that contains the NODE and DESTID entries for your installation.</p>
<p align="left"><strong>(</strong></p>
<p align="left">Required delimiter.</p>
<p align="left"><strong>JES2 or JES3</strong></p>
<p align="left">Denotes whether the initialization data set being pointed to is for JES2 or JES3. If omitted, the default is JES2. For JES2, the SMTPNJE program scans for the keywords NODE and DESTID from which it extracts the information. For JES3, the keyword scanned for is NJERMT.</p>
<p align="left">The SMTPNJE program creates the NJE host table data set called<em>user_id</em>.SMTPNJE.HOSTINFO. You can rename this data set and include the name of the data set on the SMTPNJE DD statement in the SMTP cataloged procedure. The //SMTPNJE DD statement is required.</p>
<ol>
<li>Install the SMTP server (along with the TCPIP address space) on the gateway node. Use the GATEWAY, NJEDOMAIN, and NJEFORMAT statements in the configuration data set. Optionally, you can use either the RESTRICT or the SECURE statements to limit which users can use the gateway.</li>
</ol>
<p align="left"><strong>Step 6: Specify configuration statements in SMTP configuration</strong></p>
<p align="left">Copy the member SEZAINST(SMTPCONF) to your own SMTP configuration data set and modify it for your site using the SMTP configuration statements.</p>
<p align="left"><strong>Note:</strong></p>
<p align="left">If the SMTP configuration data set is a sequential data set, you cannot edit the data set while SMTP is running. If the data set is a PDS member, it can be edited while SMTP is running.</p>
<p align="left"><strong>Summary of SMTP configuration statements</strong></p>
<p align="left">The SMTP configuration statements are summarized in <a href="http://publib.boulder.ibm.com/infocenter/zos/v1r12/topic/com.ibm.zos.r12.halz002/cfgproc.htm#xtsmtp">Table 70</a> .</p>
<p align="left"><strong>Note:</strong></p>
<p align="left">See <a href="http://publib.boulder.ibm.com/infocenter/zos/v1r12/topic/com.ibm.zos.r12.halz001/f1a1b4a0.htm">z/OS Communications Server: IP Configuration Reference</a> for more information about these statements.</p>
<table width="100%" border="1" cellpadding="0">
<thead>
<tr>
<td colspan="2">
<p align="left"><em>Table 70. Summary of SMTP configuration statements</em></p>
</td>
</tr>
<tr>
<td valign="bottom" width="33%">
<p align="left"><strong>Statement</strong></p>
</td>
<td valign="bottom" width="66%">
<p align="left"><strong>Description</strong></p>
</td>
</tr>
</thead>
<tbody>
<tr>
<td valign="top">
<p align="left">ALTNJEDOMAIN</p>
</td>
<td valign="top">
<p align="left">Specifies an alternative domain name of the NJE network, if SMTP is running as a mail gateway.</p>
</td>
</tr>
<tr>
<td valign="top">
<p align="left">ALTTCPHOSTNAME</p>
</td>
<td valign="top">
<p align="left">Specifies an additional host name for the local host. Mail received for this host name is accepted and delivered locally.</p>
</td>
</tr>
<tr>
<td>
<p align="left">ATSIGN</p>
</td>
<td>
<p align="left">Enables SMTP to replace the @ symbol used in addressing strings.</p>
</td>
</tr>
<tr>
<td valign="top">
<p align="left">BADSPOOLFILEID</p>
</td>
<td valign="top">
<p align="left">Specifies the user ID on the local system where SMTP transfers unreadable spool files and looping mail.</p>
</td>
</tr>
<tr>
<td valign="top">
<p align="left">CHECKSPOOLSIZE</p>
</td>
<td valign="top">
<p align="left">Enables SMTP to check the size of the JES spool file prior to writing the data to the hlq.TEMP.NOTE file.</p>
</td>
</tr>
<tr>
<td valign="top">
<p align="left">DBCS</p>
</td>
<td valign="top">
<p align="left">Specifies that DBCS code conversion be performed on the mail.</p>
</td>
</tr>
<tr>
<td valign="top">
<p align="left">DEBUG</p>
</td>
<td valign="top">
<p align="left">Records all SMTP commands and replies.</p>
</td>
</tr>
<tr>
<td valign="top">
<p align="left">DELETEBADSPOOLFILE</p>
</td>
<td valign="top">
<p align="left">Permits SMTP to delete the spool file from the JES spool that would cause an ABENDS001 when accessed by SMTP.</p>
</td>
</tr>
<tr>
<td valign="top">
<p align="left">DISALLOWCMD</p>
</td>
<td valign="top">
<p align="left">Enables the SMTP server to discontinue support for certain specified SMTP commands.</p>
</td>
</tr>
<tr>
<td valign="top">
<p align="left">EXITDIRECTION</p>
</td>
<td valign="top">
<p align="left">Enables SMTP to call the SMTP exit provided by the customer for data coming from the JES spool.</p>
</td>
</tr>
<tr>
<td valign="top">
<p align="left">FINISHOPEN</p>
</td>
<td valign="top">
<p align="left">Specifies the SMTP wait time for connection.</p>
</td>
</tr>
<tr>
<td valign="top">
<p align="left">GATEWAY</p>
</td>
<td valign="top">
<p align="left">Specifies operation of SMTP as a gateway.</p>
</td>
</tr>
<tr>
<td valign="top">
<p align="left">INACTIVE</p>
</td>
<td valign="top">
<p align="left">Specifies the SMTP wait time before closing an inactive connection.</p>
</td>
</tr>
<tr>
<td valign="top">
<p align="left">INBOUNDOPENLIMIT</p>
</td>
<td valign="top">
<p align="left">Specifies a limit on the maximum number of simultaneous TCP connections over which the SMTP server will receive mail.</p>
</td>
</tr>
<tr>
<td valign="top">
<p align="left">IPMAILERADDRESS</p>
</td>
<td valign="top">
<p align="left">Specifies the IP address of an SMTP server that can resolve network addresses of unknown hosts.</p>
</td>
</tr>
<tr>
<td valign="top">
<p align="left">IPMAILERNAME</p>
</td>
<td valign="top">
<p align="left">Enables SMTP to forward non-local mail to the specified IP mailer name.</p>
</td>
</tr>
<tr>
<td valign="top">
<p align="left">LISTENONADDRESS</p>
</td>
<td valign="top">
<p align="left">Allows you to restrict which IP address is used to receive and send mail on a multihomed system.</p>
</td>
</tr>
<tr>
<td valign="top">
<p align="left">LOCALCLASS</p>
</td>
<td valign="top">
<p align="left">Specifies the spool data set class for local mail delivery.</p>
</td>
</tr>
<tr>
<td valign="top">
<p align="left">LOCALFORMAT</p>
</td>
<td valign="top">
<p align="left">Specifies the spool data set format for local host mail delivery.</p>
</td>
</tr>
<tr>
<td valign="top">
<p align="left">LOG</p>
</td>
<td valign="top">
<p align="left">Directs SMTP to log all SMTP traffic.</p>
</td>
</tr>
<tr>
<td valign="top">
<p align="left">MAILER</p>
</td>
<td valign="top">
<p align="left">Specifies the address of the batch SMTP server that receives mail.</p>
</td>
</tr>
<tr>
<td valign="top">
<p align="left">MAILFILEDSPREFIX</p>
</td>
<td valign="top">
<p align="left">Specifies the prefix to add to mail data sets.</p>
</td>
</tr>
<tr>
<td valign="top">
<p align="left">MAILFILESUNIT</p>
</td>
<td valign="top">
<p align="left">Specifies the unit where SMTP mail data sets reside.</p>
</td>
</tr>
<tr>
<td valign="top">
<p align="left">MAILFILEVOLUME</p>
</td>
<td valign="top">
<p align="left">Specifies the volume where newly allocated SMTP data sets reside.</p>
</td>
</tr>
<tr>
<td valign="top">
<p align="left">MAXMAILBYTES</p>
</td>
<td valign="top">
<p align="left">Specifies the maximum size of mail that is accepted over a TCP connection.</p>
</td>
</tr>
<tr>
<td valign="top">
<p align="left">MAXMSGSENT</p>
</td>
<td valign="top">
<p align="left">Enables control of the SMTP client code by limiting the number of messages sent on a single TCP/IP connection.</p>
</td>
</tr>
<tr>
<td valign="top">
<p align="left">NJECLASS</p>
</td>
<td valign="top">
<p align="left">Specifies the spool data set class for mail delivered on an NJE network.</p>
</td>
</tr>
<tr>
<td valign="top">
<p align="left">NJEDOMAIN</p>
</td>
<td valign="top">
<p align="left">Specifies the domain name of the NJE network if SMTP functions as a gateway.</p>
</td>
</tr>
<tr>
<td valign="top">
<p align="left">NJEFORMAT</p>
</td>
<td valign="top">
<p align="left">Specifies the spool data set format for mail delivered on the NJE network.</p>
</td>
</tr>
<tr>
<td valign="top">
<p align="left">NJENODENAME</p>
</td>
<td valign="top">
<p align="left">Specifies the node name of the local JES2 or JES3 node for mail delivered on the NJE network.</p>
</td>
</tr>
<tr>
<td valign="top">
<p align="left">NOLOG</p>
</td>
<td valign="top">
<p align="left">Turns off the logging of mail transactions.</p>
</td>
</tr>
<tr>
<td valign="top">
<p align="left">NOSOURCEROUTE</p>
</td>
<td valign="top">
<p align="left">Enables SMTP to <em>not</em> generate source routing addressing strings on certain RFC 821 SMTP commands.</p>
</td>
</tr>
<tr>
<td valign="top">
<p align="left">OUTBOUNDOPENLIMIT</p>
</td>
<td valign="top">
<p align="left">Specifies a limit on the maximum number of simultaneous TCP connections over which SMTP actively delivers mail.</p>
</td>
</tr>
<tr>
<td valign="top">
<p align="left">PORT</p>
</td>
<td valign="top">
<p align="left">Specifies an alternative port number for the SMTP server during testing.</p>
</td>
</tr>
<tr>
<td valign="top">
<p align="left">POSTMASTER</p>
</td>
<td valign="top">
<p align="left">Specifies the address (or addresses) for mail addressed to the postmaster at the local host.</p>
</td>
</tr>
<tr>
<td valign="top">
<p align="left">RCPTREPLY452</p>
</td>
<td valign="top">
<p align="left">Enables SMTP to handle reply code 452 differently for the RCPT command.</p>
</td>
</tr>
<tr>
<td valign="top">
<p align="left">RCPTRESPONSEDELAY</p>
</td>
<td valign="top">
<p align="left">Specifies how long the SMTP server delays responding to the RCPT commands.</p>
</td>
</tr>
<tr>
<td valign="top">
<p align="left">REMOTEPORT</p>
</td>
<td valign="top">
<p align="left">Specifies the remote port to which the SMTP client connects.</p>
</td>
</tr>
<tr>
<td valign="top">
<p align="left">RESOLVERRETRYINT</p>
</td>
<td valign="top">
<p align="left">Specifies the number of minutes SMTP waits between attempts to resolve domain names.</p>
</td>
</tr>
<tr>
<td>
<p align="left">RESOLVERUSAGE</p>
</td>
<td>
<p align="left">Specifies whether SMTP will send queries to the domain name servers if they are configured in the TCPIP.DATA file.</p>
</td>
</tr>
<tr>
<td valign="top">
<p align="left">RESTRICT</p>
</td>
<td valign="top">
<p align="left">Specifies addresses of users who are not allowed to use SMTP mail services.</p>
</td>
</tr>
<tr>
<td valign="top">
<p align="left">RETRYAGE</p>
</td>
<td valign="top">
<p align="left">Specifies the number of days after which mail is returned as undeliverable.</p>
</td>
</tr>
<tr>
<td valign="top">
<p align="left">RETRYINT</p>
</td>
<td valign="top">
<p align="left">Specifies the number of minutes between attempts to send mail to an inactive TCP host.</p>
</td>
</tr>
<tr>
<td valign="top">
<p align="left">REWRITE822HEADER</p>
</td>
<td valign="top">
<p align="left">Prevents SMTP from rewriting RFC 822 headers with source routing.</p>
</td>
</tr>
<tr>
<td valign="top">
<p align="left">SECURE</p>
</td>
<td valign="top">
<p align="left">Specifies that SMTP operates as a secure mail gateway between TCP network sites and NJE network sites.</p>
</td>
</tr>
<tr>
<td valign="top">
<p align="left">SMSGAUTHLIST</p>
</td>
<td valign="top">
<p align="left">Specifies the addresses of users authorized to issue privileged SMTP SMSG commands.</p>
</td>
</tr>
<tr>
<td valign="top">
<p align="left">SPOOLPOLLINTERVAL</p>
</td>
<td valign="top">
<p align="left">Specifies the interval for SMTP to check the spool for incoming batch data sets.</p>
</td>
</tr>
<tr>
<td valign="top">
<p align="left">STOPONRENF</p>
</td>
<td valign="top">
<p align="left">Enables control of the SMTP server such that if a RENAME failure occurs on a data set associated with the batch connection (257), the SMTP server terminates normally.</p>
</td>
</tr>
<tr>
<td valign="top">
<p align="left">TEMPERRORRETRIES</p>
</td>
<td valign="top">
<p align="left">Specifies the number of times SMTP tries to redeliver mail to a host with a temporary problem.</p>
</td>
</tr>
<tr>
<td valign="top">
<p align="left">TIMEZONE</p>
</td>
<td valign="top">
<p align="left">Sets the printable name of the local time zone.</p>
</td>
</tr>
<tr>
<td valign="top">
<p align="left">WARNINGAGE</p>
</td>
<td valign="top">
<p align="left">Specifies the number of days after which a copy of the mail is returned to the sender, indicating that the mail has so far been undeliverable and that SMTP will continue to retry delivery for RETRYAGE days.</p>
</td>
</tr>
</tbody>
</table>
<p align="left"><strong>Sample SMTP configuration data set (SMTPCONF)</strong></p>
<p align="left">The sample SMTP Configuration data set can be found in SEZAINST(SMTPCONF). See <a href="http://publib.boulder.ibm.com/infocenter/zos/v1r12/topic/com.ibm.zos.r12.halz001/f1a1b4a0.htm">z/OS Communications Server: IP Configuration Reference</a> for more information on configuration data set parameters.</p>
<p align="left"><strong>Step 7: Create an SMTP security table (Optional)</strong></p>
<p align="left">If you want to set up a secure TCP-to-NJE gateway, you need to:</p>
<ul>
<li>Include the SECURE statement in the SMTP configuration data set.</li>
<li>Create a security data set that contains a list of NJE users who are authorized to use the gateway.</li>
<li>Create a mailfiledsprefix.SECURITY.MEMO data set. The contents data set are sent to unauthorized NJE users whose mail is rejected. See <a href="http://publib.boulder.ibm.com/infocenter/zos/v1r12/topic/com.ibm.zos.r12.halz002/cfgproc.htm#secmem">Rejected mail examples</a> for sample contents of this data set. This data set must be defined as LRECL=255 and RECFM=VB. It will be dynamically allocated by SMTP when needed.</li>
</ul>
<p align="left">The SMTP security data set is pointed to by //SECTABLE DD statement. The security table data set must be allocated with LRECL=255 and RECFM=VB. Records whose first nonblank character is an asterisk (*) are treated as comments and are ignored.</p>
<p align="left">Use the following format when creating the list of NJE users:</p>
<p align="left">&gt;&gt;-<em>NJE_userid</em>&#8211;<em>NJE_nodeid</em>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&gt;</p>
<p align="left">&gt;&#8211;+&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-+&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&gt;&lt;</p>
<p align="left">   &#8216;-<em>nickname</em>&#8211;<em>primary_nick?</em>&#8211;<em>primary_mbox?</em>-&#8217;</p>
<p align="left"><strong><em>NJE_userid</em></strong><strong></strong></p>
<p align="left">The NJE user ID of the authorized user.</p>
<p align="left"><strong><em>NJE_nodeid</em></strong><strong></strong></p>
<p align="left">The NJE node ID of the authorized user.</p>
<p align="left"><strong><em>nickname</em></strong><strong></strong></p>
<p align="left">The name by which this user is known on the TCP side of the gateway. This name must not contain any special characters, such as &lt; &gt; ( ) [ ] \ . , ; : @ and “.</p>
<p align="left"><strong><em>primary_nick?</em></strong><strong></strong></p>
<p align="left">Either Y or N. If Y is specified, then mail addressed to <em>nickname</em>@smtp-gateway is automatically forwarded to <em>NJE_userid</em> at <em>NJE_nodeid</em>. Each nickname can have only one<em>primary_nick?</em> record set to Y.</p>
<p align="left"><strong><em>primary_mbox?</em></strong><strong></strong></p>
<p align="left">Either Y or N. If Y is specified, then mail from <em>NJE_userid</em> at <em>NJE_nodeid</em> is converted to<em>nickname</em>@smtp-gateway before it is sent to the TCP recipient. Each <em>NJE_userid</em>, <em>NJE_nodeid</em>pair can only have one <em>primary_mbox?</em> record.</p>
<p align="left"><strong>SMTP security data set examples</strong></p>
<p align="left">The following example shows an SMTP security data set:</p>
<p align="left">*  Records for Jane Doe, within IBM</p>
<p align="left">JDOE   ALMADEN</p>
<p align="left">JDOE   AUSTIN</p>
<p align="left">*  Records for John Smith, within IBM</p>
<p align="left">SMITH  RALEIGH   JOHNNY  Y  N</p>
<p align="left">SMITH  YORKTOWN  JOHNNY  N  Y</p>
<p align="left">SMITH  DALLAS    JOHNNY  N  N</p>
<p align="left">SMITH  RALEIGH   JSMITH  Y  Y</p>
<p align="left">For example, mail sent from the following NJE network addresses through the SMTP gateway is rewritten to the following TCP network addresses. Assume the host name of the gateway isSMTP-GATEWAY.IBM.COM.</p>
<p align="left">NJE Address               TCP Address</p>
<p align="left">&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-</p>
<p align="left">JDOE  at ALMADEN          JDOE%ALMADEN@SMTP-GATEWAY.IBM.COM</p>
<p align="left">JDOE  at AUSTIN           JDOE%AUSTIN@SMTP-GATEWAY.IBM.COM</p>
<p align="left">SMITH at RALEIGH          JSMITH@SMTP-GATEWAY.IBM.COM</p>
<p align="left">SMITH at YORKTOWN         JOHNNY@SMTP-GATEWAY.IBM.COM</p>
<p align="left">SMITH at DALLAS           JOHNNY%DALLAS@SMTP-GATEWAY.IBM.COM</p>
<p align="left">Mail sent from the TCP network to the following TCP network addresses is forwarded to the following NJE network addresses. Assume the host name of the gateway is SMTP-GATEWAY.IBM.COM.</p>
<p align="left">TCP Address                                NJE Address</p>
<p align="left">&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-</p>
<p align="left">JDOE%ALMADEN@SMTP-GATEWAY.IBM.COM          JDOE  at ALMADEN</p>
<p align="left">JDOE%AUSTIN@SMTP-GATEWAY.IBM.COM           JDOE  at AUSTIN</p>
<p align="left">JSMITH@SMTP-GATEWAY.IBM.COM                SMITH at RALEIGH</p>
<p align="left">JOHNNY@SMTP-GATEWAY.IBM.COM                SMITH at RALEIGH</p>
<p align="left">SMITH%DALLAS@SMTP-GATEWAY.IBM.COM          SMITH at DALLAS</p>
<p align="left"><strong>Rejected mail examples</strong></p>
<p align="left">SMTP rejects mail to or from an unauthorized NJE user. If the mail is from the TCP network, SMTP rejects the RCPT TO command with the error:</p>
<p align="left">550 User is not a registered gateway user</p>
<p align="left">If the mail is from the NJE network, SMTP rejects the MAIL FROM command with the error:</p>
<p align="left">550 User is not a registered gateway user</p>
<p align="left">and includes the <em>mailfiledsprefix</em>.SECURITY.MEMO data set as an explanation.</p>
<p align="left">The following example shows a sample <em>mailfiledsprefix</em>.SECURITY.MEMO data set:</p>
<p align="left">The mail you sent to this SMTP gateway cannot be delivered because</p>
<p align="left">you are not a registered user of this gateway.  Contact your local</p>
<p align="left">administrator for instructions on how to be authorized to use this</p>
<p align="left">SMTP gateway.</p>
<p align="left">The following is an example of rejected mail that was sent to an unregistered NJE user:</p>
<p align="left">Date: Fri, 5 Jul 91 10:55:59 EST</p>
<p align="left">From: SMTP@MVS1.ACME.COM</p>
<p align="left">To: DANIEL@MVS1</p>
<p align="left">Subject: Undeliverable Mail</p>
<p align="left">MVS1.ACME.COM unable to deliver following mail to recipient(s):</p>
<p align="left">    &lt;MATT@SMTP-GATEWAY.IBM.COM&gt;</p>
<p align="left">MVS1.ACME.COM received negative reply from host:</p>
<p align="left">    SMTP-GATEWAY</p>
<p align="left">550 User &#8216;MATT@SMTP-GATEWAY&#8217; is not a registered gateway user</p>
<p align="left">           ** Text of Mail follows **</p>
<p align="left">Date: Fri, 5 Jul 91 10:55:56 EDT</p>
<p align="left">From: &lt;DANIEL@MVS1.ACME.COM&gt;</p>
<p align="left">To:   &lt;MATT@SMTP-GATEWAY.IBM.COM&gt;</p>
<p align="left">Subject:  Lunch</p>
<p align="left">Matt,</p>
<p align="left">Do you have time to meet for lunch next week?  I want to discuss the</p>
<p align="left">shipment of ACME iron birdseed.</p>
<p align="left">Daniel</p>
<p align="left">The following is an example of rejected mail that was sent from an unregistered NJE user:</p>
<p align="left">Date: Fri, 5 Jul 91 11:35:18 EST</p>
<p align="left">From: &lt;SMTP@SMTP-GATEWAY.IBM.COM&gt;</p>
<p align="left">To: &lt;MATT@SMTP-GATEWAY.IBM.COM&gt;</p>
<p align="left">Subject: Undeliverable Mail</p>
<p align="left">Unable to deliver mail to some/all recipients.</p>
<p align="left">050 MAIL FROM:&lt;MATT@SMTP-GATEWAY.IBM.COM&gt;</p>
<p align="left">550-User &#8216;MATT@SMTP-GATEWAY&#8217; is not a registered gateway user.</p>
<p align="left">550-</p>
<p align="left">550-The mail you sent to this SMTP gateway cannot be delivered because</p>
<p align="left">550-you are not a registered user of this gateway.  Contact your local</p>
<p align="left">550-administrator for instructions on how to be authorized to use this</p>
<p align="left">550 SMTP gateway.</p>
<p align="left">           ** Text of Mail follows **</p>
<p align="left">HELO SMTP-GATEWAY.IBM.COM</p>
<p align="left">MAIL FROM:&lt;MATT@SMTP-GATEWAY.IBM.COM&gt;</p>
<p align="left">RCPT TO:&lt;DANIEL@MVS1.ACME.COM&gt;</p>
<p align="left">DATA</p>
<p align="left">Date: Fri, 5 Jul 91 11:34:17 EST</p>
<p align="left">From: &lt;MATT@SMTP-GATEWAY.IBM.COM&gt;</p>
<p align="left">To:   &lt;DANIEL@MVS1.ACME.COM&gt;</p>
<p align="left">Subject:  Awaiting your message</p>
<p align="left">Daniel,</p>
<p align="left">When are you going to contact me about the iron birdseed and giant</p>
<p align="left">electromagnet that I ordered?  I would like to meet with you soon.</p>
<p align="left">Matt</p>
<p align="left"> .</p>
<p align="left">QUIT</p>
<p align="left"><strong>Step 8: Enable SMTP domain name resolution</strong></p>
<p align="left">The SMTP server&#8217;s RESOLVERUSAGE statement indicates if domain name resolution is to be used or not. If name resolution is not desired, RESOLVERUSAGE NO should be specified. See<a href="http://publib.boulder.ibm.com/infocenter/zos/v1r12/topic/com.ibm.zos.r12.halz002/cfgproc.htm#step9es">Step 9: Enable sending of non-local messages to other mail servers</a>.</p>
<p align="left">If the RESOLVERUSAGE statement is not specified or is specified as RESOLVERUSAGE YES, the SMTP server will resolve domain names. Resolver TCPIP.DATA statements must be configured before you can use domain name resolution for SMTP. For a description of how TCPIP.DATA statements can be specified, see <a href="http://publib.boulder.ibm.com/infocenter/zos/v1r12/topic/com.ibm.zos.r12.halz002/newresolve.htm#newresolve">The resolver</a>.</p>
<p align="left">For more information on the SMTP RESOLVERUSAGE statement and the TCPIP.DATA resolver statements, see <a href="http://publib.boulder.ibm.com/infocenter/zos/v1r12/topic/com.ibm.zos.r12.halz001/f1a1b4a0.htm">z/OS Communications Server: IP Configuration Reference</a>.</p>
<p align="left">To use a domain name server, configure the TCPIP.DATA data set with the IP address of one or more name servers. If the TCPIP.DATA data set does not point to any name servers, the local site tables are used by SMTP. However, if the SMTP server is configured to use name servers, SMTP does not use the site tables.</p>
<p align="left">To determine which DSN the SMTP server is using, look for message number EZA5231I in the output data set specified by the OUTPUT statement in SEZAINST(SMTPPROC).</p>
<p align="left">When SMTP uses a domain name server, it asks the domain name server for the MX records for the host to which it is trying to connect. If SMTP does not find MX records for a host, it delivers mail only to the primary host listed in the A records. The MX and A records are coded in the domain name server database.</p>
<p align="left">The basic idea behind MX records is to send the mail as close as possible to the final destination. The destination host may currently be inactive, for example, because it is in another time zone. SMTP needs a synchronous connection to deliver the mail, but due to the different time zones, two systems might never be active at the same time and would never be able to exchange mail.</p>
<p align="left">Using MX records would allow the SMTP server to deliver the mail to an alternate host if the first one is unavailable. SMTP tries to deliver mail to the host with the lowest MX record count. If the host is not currently available, it tries the host with the next lowest count.</p>
<p align="left">For example, if SMTP wants to send mail to USER@BASKET, it checks the name server for MX records and finds the following:</p>
<p align="left">MVS20  BASKET  A</p>
<p align="left">       BASKET  MX  0    MVS20</p>
<p align="left">       BASKET  MX  5    MVS18</p>
<p align="left">       BASKET  MX  10   VMQ</p>
<p align="left">SMTP delivers the mail to the BASKET with the lowest count on its MX record. If MVS20 is unable to receive the mail, SMTP then tries to deliver it to MVS18. If MVS18 cannot receive the mail, it triesVMQ. If none of the hosts can receive the mail, SMTP stores the mail and queues it for later delivery, at which time the process repeats.</p>
<p align="left">For more information about how to add MX records to your name server, consult RFC 974, “Mail Routing and the Domain System.”</p>
<p align="left">To receive a detailed trace on how SMTP is resolving a particular host name, you can issue the SMSG SMTP TRACE command at the console or use a SYSTCPT DD statement in the SMTP cataloged procedure. You can also add the TRACE RESOLVER statement when configuring the TCPIP.DATA data set, but this will also trace the name resolution for all the other applications using the name server. To prevent the console log from becoming too large, only use the TRACE RESOLVER statement for debugging.</p>
<p align="left">If changes to the domain name server requires you to resolve already queued mail again, use the SMSG SMTP EXPIRE command as described in the <a href="http://publib.boulder.ibm.com/infocenter/zos/v1r12/topic/com.ibm.zos.r12.halu001/f1a1b990.htm">z/OS Communications Server: IP User&#8217;s Guide and Commands</a>. You can also query operating statistics, such as mail delivery queues of the SMTP server, by using the SMSG SMTP command. This and other administrative tasks are discussed in more detail in the <a href="http://publib.boulder.ibm.com/infocenter/zos/v1r12/topic/com.ibm.zos.r12.halu001/f1a1b990.htm">z/OS Communications Server: IP User&#8217;s Guide and Commands</a>.</p>
<p align="left"><strong>Step 9: Enable sending of non-local messages to other mail</strong></p>
<p align="left">Non-local mail is mail that must go through a Mail Transfer Agent (MTA) to get to another host. SMTP supports the following configuration statements to assist in forwarding non-local mail:</p>
<ul>
<li>IPMAILERNAME, for non-local mail destined for SMTP servers in the IP network using a hostname</li>
<li>IPMAILERADDRESS, for non-local mail destined for SMTP servers in the IP network using a static IP address</li>
<li>MAILER, for non-local mail destined for SMTP servers in the NJE network using the JES spool</li>
</ul>
<p align="left"><strong>Restriction:</strong> You cannot use the IPMAILERNAME statement, the IPMAILERADDRESS statement, or the MAILER statement with the UNKNOWN option simultaneously.</p>
<p align="left">For more information regarding these configuration statements, see <a href="http://publib.boulder.ibm.com/infocenter/zos/v1r12/topic/com.ibm.zos.r12.halz001/f1a1b4a0.htm">z/OS Communications Server: IP Configuration Reference</a>.</p>
<p align="left">The SMTP server can be configured to send all your non-local TCP/IP SMTP mail to a specified mail server, or mail relay. You might need to do this if you have installed a firewall. One way to accomplish this is by using IPMAILERADDRESS, making both of the following changes to your<em>hlq</em>.SMTP.CONFIG data set:</p>
<ol>
<li>Inhibit SMTP from attempting to resolve non-local hostnames by specifying the following statement in your SMTP.CONFIG data set:</li>
</ol>
<p align="left">RESOLVERUSAGE NO</p>
<ol>
<li>Update the SMTP.CONFIG file to redirect mail to a specific server using the IPMAILERADDRESS statement:</li>
</ol>
<p align="left">IPMAILERADDRESS ip_address</p>
<p align="left">where ip_address is address of the mail server that can perform the hostname resolution.</p>
<p align="left"><strong>Step 10: Design SMTP exit to inspect and filter unwanted mail</strong></p>
<p align="left">The SMTP exit facility allows an installation to better control the volume of unwanted mail (spam) that is entering the installation. SMTP makes use of the Dynamic Exit Facility (CSVDYNEX macro) provided by MVS. See <a href="http://publib.boulder.ibm.com/infocenter/zos/v1r12/topic/com.ibm.zos.r12.ieaa800/iea2a8b0.htm">z/OS MVS Programming: Authorized Assembler Services Guide</a> for more information. The exit is provided by the customer to implement policies that they deem workable. Based on user-defined (and implemented) criteria, individual mail items may be rejected before they consume other resources. SMTPEXIT is provided as a programming guide to aid in the implementation of the local policies. It can be found in SEZAINST. This exit must be REENTRANT and AMODE 31, in an authorized library. In using the SMTP exit a name token (EZBTCPIPSMTPEXIT) needs to be established in SYS1.PARMLIB(PROGxx).</p>
]]></content:encoded>
			<wfw:commentRss>http://www.sweetytang.com/archives/137.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>DCT变换</title>
		<link>http://www.sweetytang.com/archives/55.html</link>
		<comments>http://www.sweetytang.com/archives/55.html#comments</comments>
		<pubDate>Tue, 17 Jul 2012 05:54:47 +0000</pubDate>
		<dc:creator>牧羊人</dc:creator>
				<category><![CDATA[师夷长技]]></category>
		<category><![CDATA[DCT变换]]></category>
		<category><![CDATA[视频图像]]></category>

		<guid isPermaLink="false">http://www.sweetytang.com/?p=55</guid>
		<description><![CDATA[在图像压缩中，一般把图像分解为8×8的子块，然后对每一个子块进行DCT变换、量化，并对量化后的数据进行Huffman编码。DCT变换可以消除图像的空间冗余，Huffman编码可以消除图像的信息熵冗余。 DCT 是无损的，它只将图像从空间域转换到变换域上，使之更能有效地被编码。对一个图像子块而言，将对变换后的64个系数进行量化，并对Z字顺序扫描系数表进行 编码。这种排列方法有助于将低频非0系数置于高频系数之前，直流系数由于包含了所有图像特征中的关键部分而被单独编码。量化后的系数经过熵编码进一步无损 压缩，通常采用的是Huffman编码。这种压缩编码方法中，图像质量的降低主要是由于对系数的量化造成，且不可恢复。假设子图像为f(x, y)，则DCT变换可以由下面的公式实现： 其中式(1)的f(u, v)表示变换域的高频成分，也称为交流系数；式(2)中F(0, 0)表示变换域中的低频成分，也称为直流系数。对变换结果进行分析，可以看出能量主要集中到左上角。DCT变换具有良好的去相关特性。在图像的压缩编码中，N一般取8。 在解码时首先得到各点的DCT系数，然后根据下面的DCT反变换即可恢复出原图像。DCT的反变换公式为： 利用公式(3)可以无损地恢复原图像。在实际的应用中，使用DCT变换的矩阵描述形式更容易理解。 &#160; &#160;]]></description>
			<content:encoded><![CDATA[<p>在图像压缩中，一般把图像分解为8×8的子块，然后对每一个子块进行DCT变换、量化，并对量化后的数据进行Huffman编码。DCT变换可以消除图像的空间冗余，Huffman编码可以消除图像的信息熵冗余。<span id="more-55"></span></p>
<p>DCT 是无损的，它只将图像从空间域转换到变换域上，使之更能有效地被编码。对一个图像子块而言，将对变换后的64个系数进行量化，并对Z字顺序扫描系数表进行 编码。这种排列方法有助于将低频非0系数置于高频系数之前，直流系数由于包含了所有图像特征中的关键部分而被单独编码。量化后的系数经过熵编码进一步无损 压缩，通常采用的是Huffman编码。这种压缩编码方法中，图像质量的降低主要是由于对系数的量化造成，且不可恢复。假设子图像为f(x, y)，则DCT变换可以由下面的公式实现：</p>
<p><a href="http://www.sweetytang.com/wp-content/uploads/2012/07/equation.jpg"><img class="alignnone size-medium wp-image-56" title="equation" src="http://www.sweetytang.com/wp-content/uploads/2012/07/equation-300x63.jpg" alt="" width="300" height="63" /></a></p>
<p>其中式(1)的f(u, v)表示变换域的高频成分，也称为交流系数；式(2)中F(0, 0)表示变换域中的低频成分，也称为直流系数。对变换结果进行分析，可以看出能量主要集中到左上角。DCT变换具有良好的去相关特性。在图像的压缩编码中，N一般取8。</p>
<p>在解码时首先得到各点的DCT系数，然后根据下面的DCT反变换即可恢复出原图像。DCT的反变换公式为：</p>
<p><a href="http://www.sweetytang.com/wp-content/uploads/2012/07/equation1.jpg"><img class="alignnone size-medium wp-image-57" title="equation1" src="http://www.sweetytang.com/wp-content/uploads/2012/07/equation1-300x51.jpg" alt="" width="300" height="51" /></a></p>
<p>利用公式(3)可以无损地恢复原图像。在实际的应用中，使用DCT变换的矩阵描述形式更容易理解。</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.sweetytang.com/archives/55.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Matlab中rem()和mod()函数的区别</title>
		<link>http://www.sweetytang.com/archives/52.html</link>
		<comments>http://www.sweetytang.com/archives/52.html#comments</comments>
		<pubDate>Mon, 16 Jul 2012 10:57:06 +0000</pubDate>
		<dc:creator>牧羊人</dc:creator>
				<category><![CDATA[师夷长技]]></category>
		<category><![CDATA[Matlab]]></category>

		<guid isPermaLink="false">http://www.sweetytang.com/?p=52</guid>
		<description><![CDATA[rem(x,y):求整除x/y的余数 mod(x,y):求模 rem(x,y)=x-y.*fix(x./y);  (fix()向0取整) mod(x,y)=x-y.*floor(x./y); （floor()向左取整） 如果x和y的符号相同（同为‘+’，同为‘-’），那么rem(x,y)=mod(x,y)（正数与正数，负数与负数，取整结果两个函数效果一样） 如果x和y的符号相反，那么mod(x,y)=rem(x,y)+y(正数与负数的取整，看你希望得到什么结果就选择用什么函数) 当正数与负数取余时，当得到的余数结果的符号希望跟除数(x)一样，用rem()函数；当得到的余数结果的符号希望跟被除数(y)一样，用mod()函数 例如： rem(3,2)=1;mod(3,2)=1; rem(-3,-2)=-1;mod(-3,-2)=-1; rem(3,-2)=1;mod(3,-2)=-1; rem(-3,2)=-1;mod(-3,2)=1; mod(3,2)=rem(3,2)=1; mod(3,-2)=rem(3,-2)-2=1-2=-1; mod(-3,2)=rem(-3,2)+2=-1+2=1;]]></description>
			<content:encoded><![CDATA[<p>rem(x,y):求整除x/y的余数</p>
<p>mod(x,y):求模</p>
<p>rem(x,y)=x-y.*fix(x./y);  (fix()向0取整)</p>
<p>mod(x,y)=x-y.*floor(x./y); （floor()向左取整）<span id="more-52"></span></p>
<p>如果x和y的符号相同（同为‘+’，同为‘-’），那么rem(x,y)=mod(x,y)（正数与正数，负数与负数，取整结果两个函数效果一样）</p>
<p>如果x和y的符号相反，那么mod(x,y)=rem(x,y)+y(正数与负数的取整，看你希望得到什么结果就选择用什么函数)</p>
<p>当正数与负数取余时，当得到的余数结果的符号希望跟除数(x)一样，用rem()函数；当得到的余数结果的符号希望跟被除数(y)一样，用mod()函数</p>
<p>例如：</p>
<p>rem(3,2)=1;mod(3,2)=1;</p>
<p>rem(-3,-2)=-1;mod(-3,-2)=-1;</p>
<p>rem(3,-2)=1;mod(3,-2)=-1;</p>
<p>rem(-3,2)=-1;mod(-3,2)=1;</p>
<p>mod(3,2)=rem(3,2)=1;</p>
<p>mod(3,-2)=rem(3,-2)-2=1-2=-1;</p>
<p>mod(-3,2)=rem(-3,2)+2=-1+2=1;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.sweetytang.com/archives/52.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
