<?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>Simpleman &#38; Simple Life &#187; Blat</title>
	<atom:link href="http://xuming.info/tag/blat/feed/" rel="self" type="application/rss+xml" />
	<link>http://xuming.info</link>
	<description>Learn to write and appreciate</description>
	<lastBuildDate>Sat, 11 Dec 2010 03:05:06 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.2</generator>
		<item>
		<title>关于 NetBackup 邮件提醒脚本的补充</title>
		<link>http://xuming.info/2007/06/1008/</link>
		<comments>http://xuming.info/2007/06/1008/#comments</comments>
		<pubDate>Mon, 04 Jun 2007 12:48:44 +0000</pubDate>
		<dc:creator>xuming</dc:creator>
				<category><![CDATA[NetBackup]]></category>
		<category><![CDATA[Blat]]></category>
		<category><![CDATA[mail]]></category>
		<category><![CDATA[Script]]></category>
		<category><![CDATA[Veritas]]></category>

		<guid isPermaLink="false">http://xuming.info/?p=1008</guid>
		<description><![CDATA[NetBackup 脚本里面所说的 NB_MAIL_SCRIPT，在 Windows 平台上对应的就是 NetBackup\Bin\nbmail.cmd。 如果 nbmail.cmd 存在的话，NetBackup 会传递三个参数给这个 CMD 文件： %1 is the recipient&#39;s address %2 is the subject line %3 is the message file name NetBackup 推荐使用 BLAT 这个免费工具发送邮件通知。这个工具的安装很简单，将 blat.exe 放在 system32 目录下即可。设定方法： blat -install &#60;smtp server address&#62; &#60;sender&#39;s address&#62; 完整语法如下： -install &#60;server addr&#62; &#60;sender&#39;s addr&#62; [&#60;try n times&#62; [&#60;port&#62; [&#60;profile&#62; [&#60;username&#62; [...]]]></description>
			<content:encoded><![CDATA[<p>NetBackup 脚本里面所说的 NB_MAIL_SCRIPT，在 Windows 平台上对应的就是 NetBackup\Bin\nbmail.cmd。</p>
<p>如果 nbmail.cmd 存在的话，NetBackup 会传递三个参数给这个 CMD 文件：</p>
<ul>
<li>%1 is the recipient&#39;s address </li>
<li>%2 is the subject line </li>
<li>%3 is the message file name </li>
</ul>
<p>NetBackup 推荐使用 BLAT 这个免费工具发送邮件通知。这个工具的安装很简单，将 blat.exe 放在 system32 目录下即可。设定方法： <br /><strong>blat -install &lt;smtp server address&gt; &lt;sender&#39;s address&gt;</strong></p>
<p>完整语法如下： <br /><strong>-install &lt;server addr&gt; &lt;sender&#39;s addr&gt; [&lt;try n times&gt; [&lt;port&gt; [&lt;profile&gt; [&lt;username&gt; [&lt;password&gt;]]]]] </strong></p>
<p>nbmail.com 调用 BLAT 的语句是：</p>
<pre class="input">@blat %3 -s %2 -t %1 -i NetBackup -server WARTHOG -q
</pre>
<p>其中：</p>
<ol>
<li>-i 参数后面跟的是发送者的名称，对应邮件里面的 From。如果在安装 blat 的时候已经设定了发送者，这个参数此处可以不配置。 </li>
<li>-server 参数后面跟的是 smtp server 的名称。如果不配置这个选项，默认使用 blat 安装时候的配置。 </li>
<li>-q 表示 Tell Blat to be quite when storing install settings in the registry. </li>
</ol>
<p class="hint"><strong>Attention!!!</strong></p>
<p>总结：nbmail.com 调用 BLAT 的语句可以简写为： <br /><strong>@blat %3 -s %2 -t %1 -i</strong><br />其余参数可以采用 blat -install 时候的设置。 </p>
<h4>NetBackup 和邮件通知相关的批处理脚本（部分）</h4>
<table border="0" width="600">
<tbody>
<tr>
<td width="50">backup_notify.cmd </td>
<td width="450">
<ul>
<li>This script is called when a backup image is completed </li>
<li>This script receives one parameter: the program and the backup image name or path </li>
</ul>
</td>
</tr>
<tr>
<td width="50">backup_exit_notify.cmd </td>
<td>
<ul>
<li>This script is called when a backup is completed </li>
<li>This script receives six parameters<br />%1 = CLIENT &#8211; the client hostname<br />%2 = POLICY &#8211; the policy label<br />%3 = SCHEDULE &#8211; the schedule label<br />%4 = SCHEDULE_TYPE &#8211; the type of schedule: FULL INCR UBAK UARC<br />%5 = STATUS &#8211; the backup status for this job<br />%6 = STREAM &#8211; the backup stream number for this job </li>
</ul>
</td>
</tr>
<tr>
<td width="50">bpstart_notify.bat </td>
<td>
<ul>
<li>This script is called when bpbkar is started for a client backup </li>
<li>This script receives six parameters<br />%1 = CLIENT_NAME<br />%2 = POLICY_NAME<br />%3 = SCHEDULE_NAME<br />%4 = SCHEDULE_TYPE, one of the following: FULL, INCR, CINC, UBAK, UARC<br />%5 = STATUS, always 0<br />%6 = RESULT_FILE </li>
</ul>
</td>
</tr>
<tr>
<td width="50">bpend_notify.bat </td>
<td>
<ul>
<li>This script is called when bpbkar is finished with a backup job </li>
<li>During an archive this script is called after the backup is complete and before the files are deleted </li>
<li>This script receives six parameters: <br />%1 = CLIENT_NAME<br />%2 = POLICY_NAME <br />%3 = SCHEDULE_NAME <br />%4 = SCHEDULE_TYPE, one of the following: FULL, INCR, CINC, UBAK, UARC<br />%5 = Status of backup<br />%6 = RESULT_FILE </li>
</ul>
</td>
</tr>
<tr>
<td width="50">session_notify.cmd </td>
<td>
<ul>
<li>This script is called each time at least one regularly scheduled backup completes </li>
<li>This script receives no parameters </li>
</ul>
</td>
</tr>
<tr>
<td width="50">session_start_notify.cmd </td>
<td>
<ul>
<li>This script is called prior to any backup or archive jobs </li>
<li>This script receives no parameters </li>
</ul>
</td>
</tr>
<tr>
<td width="50">nbmail.cmd </td>
<td>
<ul>
<li>This script is used to configure email alerts when a job completes. </li>
<li>This script receives three parameters.<br />%1 = recipient&#39;s email address<br />%2 = the subject line of the email to be sent<br />%3 = the file to put into the body of the email </li>
</ul>
</td>
</tr>
<tr>
<td width="50">dbbackup_notify.cmd </td>
<td>
<ul>
<li>This script is called after all databases have been backed up </li>
<li>This script receives no parameters </li>
</ul>
</td>
</tr>
<tr>
<td width="50">userreq_notify.cmd </td>
<td>
<ul>
<li>This script is called when BPRD gets list, backup, archive, or restore request </li>
<li>This script receives three parameters.<br />%1 = operation requested<br />%2 = client who requested the operation<br />%3 = user who initiated the request </li>
</ul>
</td>
</tr>
<tr>
<td width="50">diskfull_notify.cmd </td>
<td>
<p>This script is useful if a disk reaches capacity. This script can be used to remove old files to free up space. By default this script will cause the operation to suspend for 5 minutes and then retry.</p>
<ul>
<li>This script is called when a disk in full condition is encountered </li>
<li>This script receives two parameters. <br />%1 = program name (bpdm or bptm)<br />%2 = image file being written </li>
</ul>
</td>
</tr>
<tr>
<td width="50">restore_notify.cmd </td>
<td>
<ul>
<li>This script is called when a restore, verify, duplicate, or import is attempted </li>
<li>This script receives one triplet parameter<br />%1 = program name (bptm or bpdm) the image name and the operation requested. </li>
</ul>
</td>
</tr>
</tbody>
</table>
]]></content:encoded>
			<wfw:commentRss>http://xuming.info/2007/06/1008/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Troubleshooting email notification</title>
		<link>http://xuming.info/2007/05/1006/</link>
		<comments>http://xuming.info/2007/05/1006/#comments</comments>
		<pubDate>Mon, 28 May 2007 09:16:22 +0000</pubDate>
		<dc:creator>xuming</dc:creator>
				<category><![CDATA[NetBackup]]></category>
		<category><![CDATA[Blat]]></category>
		<category><![CDATA[mail]]></category>

		<guid isPermaLink="false">http://xuming.info/?p=1006</guid>
		<description><![CDATA[Troubleshooting email notification can be difficult, due to the fact that no output is displayed. The best way to determine if the nbmail.cmd script and Blat are working correctly is to remove the -q from the end of the Blat command and redirect the output of the command to a text file. For example, Original [...]]]></description>
			<content:encoded><![CDATA[<p>Troubleshooting email notification can be difficult, due to the fact that no output is displayed. The best way to determine if the nbmail.cmd script and Blat are working correctly is to remove the -q from the end of the Blat command and redirect the output of the command to a text file.</p>
<p>For example,</p>
<ul>
<li>Original Blat command from the nbmail.cmd script:
<pre class="input">
	@blat %3 -s %2 -t %1 -i NetBackup -q
	</pre>
<li>Modified Blat command used for troubleshooting:
<pre class="input">
	@blat %3 -s %2 -t %1 -i NetBackup >C:\nbmail_test.txt
	</pre>
</ul>
<p>This change will output exactly what the Blat utility is sending to the mail server and should return any errors that the server returns.</p>
<p>Below is an example of the output:</p>
<pre class="output">
Sending C:\WINNT\TEMP\nb_AC6.tmp to email_address@veritas.com
Subject:NetBkup on test client - 150 started
Login name is user.name@veritas.com
</pre>
]]></content:encoded>
			<wfw:commentRss>http://xuming.info/2007/05/1006/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>nbmail.cmd troubleshooting</title>
		<link>http://xuming.info/2007/05/1005/</link>
		<comments>http://xuming.info/2007/05/1005/#comments</comments>
		<pubDate>Mon, 28 May 2007 08:57:26 +0000</pubDate>
		<dc:creator>xuming</dc:creator>
				<category><![CDATA[Shells & Scripts]]></category>
		<category><![CDATA[Blat]]></category>
		<category><![CDATA[mail]]></category>
		<category><![CDATA[NetBackup]]></category>
		<category><![CDATA[troubleshooting]]></category>

		<guid isPermaLink="false">http://xuming.info/?p=1005</guid>
		<description><![CDATA[Top ten reasons why nbmail can fail: BLAT is commented out in the nbmail.cmd script &#8212; remove the &#8216;@rem&#8217; from in front of the BLAT command. No email address configured or email address incorrectly configured on Universal Settings tab. The BLAT line in nbmail.cmd is not correctly configured; syntax has changed in the later versions [...]]]></description>
			<content:encoded><![CDATA[<h4>Top ten reasons why nbmail can fail:</h4>
<ol>
<li>BLAT is commented out in the nbmail.cmd script &#8212; remove the &#8216;@rem&#8217; from in front of the BLAT command.
<li>No email address configured or email address incorrectly configured on Universal Settings tab.
<li>The BLAT line in nbmail.cmd is not correctly configured; syntax has changed in the later versions &#8212; check the readme for your version of BLAT.
<li>BLAT is not on the path, and no path was specified in nbmail.cmd &#8212; place the blat.exe program in a directory on your path, or add the path before BLAT in the script.
<li>BLAT version is greater than 1.84, and no profile was created &#8212; see the BLAT readme for details on profiles.
<li>Mail account did not exist on email server &#8212; create the account.
<li>Mail server required authentication for Simple Mail Transfer Protocol (SMTP), and the account used for VERITAS NetBackup &#8482; client process is not authorized &#8212; change user account for NetBackup Client Service (default is local system, which may not have permission to send mail).
<li> BLAT sometimes needs the -ti &lt;n&gt; timeout parameter if there are delays in the system &#8212; &lt;n&gt; is in seconds.
<li>Command line extensions are not enabled &#8212; The registry key HKEY_CURRENT_USER\Software\Microsoft\Command Processor\EnableExtensions should be set to 0&#215;1.
<li>BLAT binary is corrupt or incompatible with email system &#8212; download a newer version.
</ol>
<h3>如何查看 NetBackup 程序调用了 nbmail.cmd 呢？</h3>
<p>答案是通过setting up the BPCD log。具体步骤如下：</p>
<ol>
<li>Select Client sends mail on Universal Settings tab (properties on the master server). The option Server sends mail does not log anything in the BPCD log, so even if you require this option, test it with the Client setting first.
<li>Make sure that an email address is configured on the Universal Settings tab.
<li>Make sure the call to BLAT is uncommented in the nbmail.cmd script.
<li>Make sure that a directory called BPCD exists in NetBackup\Logs on the master server.
<li>a. For NetBackup 3.4 only: Launch the NetBackup client, click Actions | Configure and go to the Troubleshooting tab.  Enter 2 for General and 9 for Verbose. <br />
	b. For NetBackup 4.5 only &#8211; Launch the Backup, Archive and Restore program, click File | NetBackup Client Properties and go to the Troubleshooting tab. Enter 2 for General and 5 for Verbose.</p>
<li>Re-start the NetBackup Client Service to make sure these settings take effect.
<li>Run a backup of a directory on the master server.
<li>The BPCD log should contain something similar to the following: <br />
07:34:04.128 [3864.4052] &lt;2&gt; bpcd main: BPCD_SEND_MAIL_RQST <br />
07:34:04.128 [3864.4052] &lt;2&gt; bpcd main: mailaddr = joe.bloggs@veritas.com <br />
07:34:04.128 [3864.4052] &lt;2&gt; bpcd main: subject = Backup on MYMASTER &#8211; 0 started <br />
07:34:04.128 [3864.4052] &lt;2&gt; bpcd main: message = Backup on client MYMASTER by root succeeded. </p>
<p>File list<br />
&#8212;&#8212;&#8212;<br />
C:\WINNT\system32\drivers\etc</p>
<p>07:34:04.128 [3864.4052] &lt;2&gt; sendViaScript: attempting to send mail<br />
07:34:04.198 [3864.4052] &lt;2&gt; bpcd main: BPCD_DISCONNECT_RQST
</ol>
<p>If you don&#8217;t see this in the log, then nbmail is not being called, and you have a configuration problem within NetBackup itself. If you see the entries in the log, but receive no email, then verify whether the email address is correct and valid. If the email address is correct, then the problem lies either with the nbmail.cmd script itself, or with BLAT.</p>
<h3>Troubleshooting BLAT:</h3>
<p>The later versions of BLAT (from version 1.82 onwards) use profiles. The idea is that you configure your user or server and any other settings for the mail system in a profile and then just specify this when you use the command. The following technote describes this: <a href="http://support.veritas.com/docs/244258"> http://support.veritas.com/docs/244258 </a></p>
<p>So an appropriate change in nbmail.cmd would be to change the BLAT line as follows: </p>
<pre class="input">
@blat %3 -s %2 -t %1 -p NetBackup -q
</pre>
<p>where NetBackup is a profile you created. </p>
<p>When testing BLAT, you need to remove the -q switch and pipe the output to a file; you could replace the above line with: </p>
<pre class="input">
@echo:Testing %1 ,%2 ,%3 >>C:\Testing.txt
&lt;blat&gt; %3 -s %2 -t %1 -p NetBackup>>c:\Testing.txt
</pre>
<p>*** Note the emission of -q switch *** </p>
<p>When you test nbmail.cmd from the command line, it is helpful to use the same account that NetBackup client service is using, this will help highlight any account permission issues that may stop the process from working. </p>
]]></content:encoded>
			<wfw:commentRss>http://xuming.info/2007/05/1005/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>blat 基本用法</title>
		<link>http://xuming.info/2007/05/1003/</link>
		<comments>http://xuming.info/2007/05/1003/#comments</comments>
		<pubDate>Mon, 28 May 2007 08:14:08 +0000</pubDate>
		<dc:creator>xuming</dc:creator>
				<category><![CDATA[NetBackup]]></category>
		<category><![CDATA[Shells & Scripts]]></category>
		<category><![CDATA[Blat]]></category>

		<guid isPermaLink="false">http://xuming.info/?p=1003</guid>
		<description><![CDATA[blat -to xnming21@163.com -cc xnming21@hotmail.com -subject test -body "This is a test." -attach 20070523.txt 具体语法如下 Blat v2.5.0 w/GSS encryption (build : Sep 14 2005 22:46:29) Win32 console utility to send mail via SMTP or post to usenet via NNTP by P.Mendes,M.Neal,G.Vollant,T.Charron,T.Musson,H.Pesonen,A.Donchey,C.Hyde http://www.blat.net syntax: Blat &#60;filename&#62; -to &#60;recipient&#62; [optional switches (see below)] Blat -install &#60;server addr&#62; [...]]]></description>
			<content:encoded><![CDATA[<pre class="input">
blat -to xnming21@163.com -cc xnming21@hotmail.com -subject test -body "This is a test." -attach 20070523.txt
</pre>
<h4>具体语法如下</h4>
<pre class="output">
Blat v2.5.0 w/GSS encryption (build : Sep 14 2005 22:46:29)

Win32 console utility to send mail via SMTP or post to usenet via NNTP
by P.Mendes,M.Neal,G.Vollant,T.Charron,T.Musson,H.Pesonen,A.Donchey,C.Hyde

http://www.blat.net

syntax:
  Blat &lt;filename&gt; -to &lt;recipient&gt; [optional switches (see below)]
  Blat -install &lt;server addr&gt; &lt;sender's addr&gt; [&lt;try&gt;[&lt;port&gt;[&lt;profile&gt;]]] [-q]
  Blat -profile [-delete | "&lt;default&gt;"] [profile1] [profileN] [-q]
  Blat -h

-------------------------------- Installation ---------------------------------
-install[SMTP|NNTP|POP3] &lt;server addr&gt; &lt;sender's email addr&gt; [&lt;try n times&gt;
                [&lt;port&gt; [&lt;profile&gt; [&lt;username&gt; [&lt;password&gt;]]]]]
                : set server, sender, number of tries and port for profile
                  (&lt;try n times&gt; and &lt;port&gt; may be replaced by '-')
                  port defaults are SMTP=25, NNTP=119, POP3=110
                  default profile can be specified with a '-'
                  username and/or password may be stored to the registry
                  order of options is specific
                  use -installNNTP for storing NNTP information
                  use -installPOP3 for storing POP3 information
                      (sender and try are ignored, use '-' in place of these)

--------------------------------- The Basics ----------------------------------
&lt;filename&gt;      : file with the message body to be sent
                  if your message body is on the command line, use a hyphen (-)
                  as your first argument, and -body followed by your message
                  if your message will come from the console/keyboard, use the
                  hyphen as your first argument, but do not use -body option.
-of &lt;file&gt;      : text file containing more options (also -optionfile)
-to &lt;recipient&gt; : recipient list (also -t) (comma separated)
-tf &lt;file&gt;      : recipient list filename
-cc &lt;recipient&gt; : carbon copy recipient list (also -c) (comma separated)
-cf &lt;file&gt;      : cc recipient list filename
-bcc &lt;recipient&gt;: blind carbon copy recipient list (also -b)
                  (comma separated)
-bf &lt;file&gt;      : bcc recipient list filename
-maxNames &lt;x&gt;   : send to groups of &lt;x&gt; number of recipients
-ur             : set To: header to Undisclosed Recipients if not using the
                  -to and -cc options
-subject &lt;subj&gt; : subject line, surround with quotes to include spaces(also -s)
-ss             : suppress subject line if not defined
-sf &lt;file&gt;      : file containing subject line
-body &lt;text&gt;    : message body, surround with quotes to include spaces
-sig &lt;file&gt;     : text file containing your email signature
-tag &lt;file&gt;     : text file containing taglines, to be randomly chosen
-ps &lt;file&gt;      : final message text, possibly for unsubscribe instructions

----------------------------- Registry overrides ------------------------------
-p &lt;profile&gt;    : send with server, user, and port defined in &lt;profile&gt;
                : use username and password if defined in &lt;profile&gt;
-profile        : list all profiles in the Registry
-server &lt;addr&gt;  : specify SMTP server to be used (optionally, addr:port)
-serverSMTP &lt;addr&gt;
                : same as -server
-serverNNTP &lt;addr&gt;
                : specify NNTP server to be used (optionally, addr:port)
-serverPOP3 &lt;addr&gt;
                : specify POP3 server to be used (optionally, addr:port)
                  when POP3 access is required before sending email
-f &lt;sender&gt;     : override the default sender address (must be known to server)
-i &lt;addr&gt;       : a 'From:' address, not necessarily known to the server
-port &lt;port&gt;    : port to be used on the SMTP server, defaults to SMTP (25)
-portSMTP &lt;port&gt;: same as -port
-portNNTP &lt;port&gt;: port to be used on the NNTP server, defaults to NNTP (119)
-portPOP3 &lt;port&gt;: port to be used on the POP3 server, defaults to POP3 (110)
-u &lt;username&gt;   : username for AUTH LOGIN (use with -pw)
-pw &lt;password&gt;  : password for AUTH LOGIN (use with -u)
-pu &lt;username&gt;  : username for POP3 LOGIN (use with -ppw)
-ppw &lt;password&gt; : password for POP3 LOGIN (use with -pu)

---------------------- Miscellaneous RFC header switches ----------------------
-organization &lt;organization&gt;
                : Organization field (also -o and -org)
-ua             : include User-Agent header line instead of X-Mailer
-x &lt;X-Header: detail&gt;
                : custom 'X-' header.  eg: -x "X-INFO: Blat is Great!"
-noh            : prevent X-Mailer/User-Agent header from showing Blat homepage
-noh2           : prevent X-Mailer header entirely
-d              : request disposition notification
-r              : request return receipt
-charset &lt;cs&gt;   : user defined charset.  The default is ISO-8859-1
-a1 &lt;header&gt;    : add custom header line at the end of the regular headers
-a2 &lt;header&gt;    : same as -a1, for a second custom header line
-dsn &lt;nsfd&gt;     : use Delivery Status Notifications (RFC 3461)
                  n = never, s = successful, f = failure, d = delayed
                  can be used together, however N takes precedence
-hdrencb        : use base64 for encoding headers, if necessary
-hdrencq        : use quoted-printable for encoding headers, if necessary
-priority &lt;pr&gt;  : set message priority 0 for low, 1 for high

----------------------- Attachment and encoding options -----------------------
-attach &lt;file&gt;  : attach binary file(s) to message (filenames comma separated)
-attacht &lt;file&gt; : attach text file(s) to message (filenames comma separated)
-attachi &lt;file&gt; : attach text file(s) as INLINE (filenames comma separated)
-embed &lt;file&gt;   : embed file(s) in HTML.  Object tag in HTML must specify
                  content-id using cid: tag.  eg: &lt;img src="cid:image.jpg"&gt;
-af &lt;file&gt;      : file containing list of binary file(s) to attach (comma
                  separated)
-atf &lt;file&gt;     : file containing list of text file(s) to attach (comma
                  separated)
-aef &lt;file&gt;     : file containing list of embed file(s) to attach (comma
                  separated)
-base64         : send binary files using base64 (binary MIME)
-uuencode       : send binary files UUEncoded
-enriched       : send an enriched text message (Content-Type=text/enriched)
-unicode        : message body is in 16- or 32-bit Unicode format
-html           : send an HTML message (Content-Type=text/html)
-alttext &lt;text&gt; : plain text for use as alternate text
-alttextf &lt;file&gt;: plain text file for use as alternate text
-mime           : MIME Quoted-Printable Content-Transfer-Encoding
-8bitmime       : ask for 8bit data support when sending MIME
-multipart &lt;size&gt;
                : send multipart messages, breaking attachments on &lt;size&gt;
                  KB boundaries, where &lt;size&gt; is per 1000 bytes
-nomps                : do not allow multipart messages

---------------------------- NNTP specific options ----------------------------
-groups &lt;usenet groups&gt;
                : list of newsgroups (comma separated)

-------------------------------- Other options --------------------------------
-h              : displays this help (also -?, /?, -help or /help)
-q              : suppresses all output to the screen
-debug          : echoes server communications to a log file or screen
                  (overrides -q if echoes to the screen)
-log &lt;file&gt;     : log everything but usage to &lt;file&gt;
-timestamp      : when -log is used, a timestamp is added to each log line
-ti &lt;n&gt;         : set timeout to 'n' seconds.  Blat will wait 'n' seconds for
                  server responses
-try &lt;n times&gt;  : how many times blat should try to send (1 to 'INFINITE')
-binary         : do not convert ASCII | (pipe, 0x7c) to CrLf in the message
                  body
-hostname &lt;hst&gt; : select the hostname used to send the message via SMTP
                  this is typically your local machine name
-raw            : do not add CR/LF after headers
-delay &lt;x&gt;      : wait x seconds between messages being sent when used with
                  -maxnames or -multipart
-comment &lt;char&gt; : use this character to mark the start of commments in
                  options files and recipient list files.  The default is ;
-superdebug     : hex/ascii dump the data between Blat and the server
-superdebugT    : ascii dump the data between Blat and the server
-------------------------------------------------------------------------------

Note that if the '-i' option is used, &lt;sender&gt; is included in 'Reply-to:'
and 'Sender:' fields in the header of the message.

Optionally, the following options can be used instead of the -f and -i
options:

-mailfrom &lt;addr&gt;   The RFC 821 MAIL From: statement
-from &lt;addr&gt;       The RFC 822 From: statement
-replyto &lt;addr&gt;    The RFC 822 Reply-To: statement
-returnpath &lt;addr&gt; The RFC 822 Return-Path: statement
-sender &lt;addr&gt;     The RFC 822 Sender: statement

For backward consistency, the -f and -i options have precedence over these
RFC 822 defined options.  If both -f and -i options are omitted then the
RFC 821 MAIL FROM statement will be defaulted to use the installation-defined
default sender address.
</pre>
]]></content:encoded>
			<wfw:commentRss>http://xuming.info/2007/05/1003/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>在 NetBackup 环境中配置 Windows 客户端邮件通知</title>
		<link>http://xuming.info/2007/05/1002/</link>
		<comments>http://xuming.info/2007/05/1002/#comments</comments>
		<pubDate>Sun, 27 May 2007 03:33:09 +0000</pubDate>
		<dc:creator>xuming</dc:creator>
				<category><![CDATA[NetBackup]]></category>
		<category><![CDATA[Blat]]></category>
		<category><![CDATA[Veritas]]></category>

		<guid isPermaLink="false">http://xuming.info/?p=1002</guid>
		<description><![CDATA[原文网址http://seer.entsupport.symantec.com/docs/254809.htm BLAT is a open source utility and the most recent version of BLAT can be downloaded from this site: http://sourceforge.net/projects/blat/ I. Installing and Configuring the BLAT executable Download the .ZIP file from the download page specified above Extract the files to their own folder. Note: Most of the files in this .ZIP file are [...]]]></description>
			<content:encoded><![CDATA[<p>原文网址<a href="http://seer.entsupport.symantec.com/docs/254809.htm">http://seer.entsupport.symantec.com/docs/254809.htm</a></p>
<p>BLAT is a open source utility and the most recent version of BLAT can be downloaded from this site:  <a href="http://sourceforge.net/projects/blat/">http://sourceforge.net/projects/blat/</a> </p>
<h2>I. Installing and Configuring the BLAT executable</h2>
<ol>
<li>Download the .ZIP file from the download page specified above
<li>Extract the files to their own folder. <br />Note: Most of the files in this .ZIP file are informational and is source code for developmental purposes.
<li>Copy the blat.exe file to the \WINNT\System32 directory in Windows
<li>From a command prompt, run the following command (Note: This will be the primary account that will send the emails from the specified server): 
<pre class="input">
% blat -install &lt;server addr&gt; &lt;sender's addr&gt;
	</pre>
<p>	Note: &#8220;&lt;server addr&gt;&#8221; is the hostname or IP address of the email server that will send the email notifications. <br />
	&#8220;&lt;sender&#8217;s addr&gt;&#8221; is the account that will be the primary sender of the email notifications. <br />
	Example: </p>
<pre class="input">
% blat -install emailserver.company.com useraccount@company.com
	</pre>
<li>Test the installation of blat by creating a text file C:\testfile.txt with a message and emailing it to the NetBackup administrator.
<pre class="input">
% blat C:\testfile.txt -s test_subject -to useraccount@company.com
	</pre>
<p>	If blat is working correctly, the NetBackup administrator should receive the contents of the C:\testfile.txt file.
</ol>
<h2>II. Configuring the nbmail.cmd script</h2>
<ol>
<li>Open <b>nbmail.cmd</b> using <b>notepad.exe</b> or some other text editor. The file can be found on a NetBackup Server/Client install for Windows at <b>&lt;install_path&gt;\VERITAS\NetBackup\bin</b>.  <br />Please make a backup copy of this script before modifying it.<br />
<b>Note</b>: When using Notepad to modify a script do not use the Word Wrap option.  If this option is enabled, then it will need to be unchecked.  Using this option can result in extra line feeds being added to the script which will render it non-functional.</p>
<li>Most of the lines in the <b>nbmail.cmd</b> file are informational. The following line(s) are what need to be adjusted: <br />
For NetBackup 4.5 and 5.x systems find the line: </p>
<pre class="output">
@rem @blat %3 -s %2 -t %1 -i NetBackup -server WARTHOG -q
</pre>
<p>For NetBackup 6.0 systems find the section: </p>
<pre class="output">
@REM @IF "%~4"=="" (
@REM blat %3 -s %2 -t %1 -i NetBackup -server WARTHOG -q
@REM ) ELSE (
@REM blat %3 -s %2 -t %1 -i NetBackup -server WARTHOG -q -attach %4
@REM )
</pre>
<li>Remove &#8220;@rem&#8221; from the beginning of each line.  This will activate the sections needed for blat to run.
<li>Replace &#8220;WARTHOG&#8221; with the name of the email server. An example of how this line should now appear is: <br />
Example on NetBackup 4.5 and 5.x systems: </p>
<pre class="input">
@blat %3 -s %2 -t %1 -i NetBackup -server emailserver.company.com -q
</pre>
<p>Example on NetBackup 6.0 systems: </p>
<pre class="input">
@IF "%~4"=="" (
blat %3 -s %2 -t %1 -i NetBackup -server emailserver.company.com -q
) ELSE (
blat %3 -s %2 -t %1 -i NetBackup -server emailserver.company.com -q -attach %4
)
</pre>
<li>Save the <b>nbmail.cmd</b> file
<li>Example of an email sent by NetBackup using blat:
<pre class="output">
Backup on client <hostname> by root was partially successful.
File list
---------
C:\Documents and Settings
</pre>
<p>Options explained: </p>
<ul>
<li>%3 is the file that BLAT will send in the body of the email. This is generated by one of the other scripts, backup_notification.cmd for example.
<li>-s is the subject line of the email
<li>%2 is the contents of the subject line. This is generated by another script that calls on blat, backup_notification.cmd, for example.
<li>-t is who will receive the email.
<li>%1 &#8211; is the email address. This is by default the contents of the Email Address for the administrator of this NetBackup Client field.
<li>-i is the &#8220;From&#8221; portion of the email. This is not necessarily known to the email server. In this case it will be &#8220;From NetBackup.&#8221;
<li>-server is the name of the SMTP server to use.
<li>-q will suppress all output to the screen.
</ul>
</ol>
<h2>III. Configure NetBackup to use email notification</h2>
<h4>To allow a master server to send emails for all failed client backups that end with a non-zero status, do the following:</h4>
<ol>
<li>Open the NetBackup Administration Console
<li>Open the Host Properties for the master server and go to the Global Attributes tab
<li>At the bottom of this page, enter the email address for the NetBackup administrator in the field called Administrator e-mail address: (separate multiple entries with commas)
</ol>
<h4>To allow a specific client to send emails for all successful and failed jobs, do the following:</h4>
<ol>
<li>Open the NetBackup Administration Console
<li>Open the Host Properties for the Client and go to the Universal Settings tab
<li>Under the Administrator section of this page, enter the email address for the NetBackup administrator in the field called Client Administrator&#8217;s e-mail (separate multiple entries with commas)
</ol>
<p>NetBackup should send email notifications at this point. To get more information sent to the administrator configure some of the &lt;install_path&gt;\VERITAS\NetBackup\bin\*.cmd files. This would result in additional information for the administrator. </p>
<h2>IV. Additional ways to use BLAT and nbmail.cmd</h2>
<p>Sending to multiple users can be done in two ways: by creating an administrative group SMTP account on an email server and configuring NetBackup and nbmail.cmd to use that SMTP address, or by configuring the nbmail.cmd file to send to multiple users.</p>
<p>Providing more email address for BLAT can be done by adding additional email addresses after the %1 in the nbmail.cmd file.  Here is an example of the syntax required:</p>
<p>Example on NetBackup 4.5 and 5.x systems:</p>
<pre class="input">
@blat %3 -s %2 -t %1,name1@acme.com,name2@acme.com,name3@acme.com -i NetBackup -server emailserver.company.com -q
</pre>
<p>Example on NetBackup 6.0 systems:</p>
<pre class="input">
@IF "%~4"=="" (
blat %3 -s %2 -t %1,name1@acme.com,name2@acme.com,name3@acme.com -i NetBackup -server emailserver.company.com -q
) ELSE (
blat %3 -s %2 -t %1,name1@acme.com,name2@acme.com,name3@acme.com -i NetBackup -server emailserver.company.com -q -attach %4
)
</pre>
<p>Configured this way, four emails will be sent out. It is important to separate the email addresses with commas (,) and no spaces in between.</p>
<h2>V. Troubleshooting BLAT</h2>
<ol>
<li>It may be necessary to do some troubleshooting of BLAT. If BLAT is run from a straight command line, and it has an error, it will produce a message in the command line results. To make a &#8220;log&#8221; file for BLAT, make an entry at the end of the nbmail.cmd &#8220;@blat&#8221; line similar to this: <br />
	Example on NetBackup 4.5 and 5.x systems: </p>
<pre class="input">
@blat %3 -s %2 -t %1 -i NetBackup -server emailserver.company.com -q >>"C:\program files\veritas\netbackup\logs\blat.out.txt"
	</pre>
<p>	Example on NetBackup 6.0 systems: </p>
<pre class="input">
@IF "%~4"=="" (
blat %3 -s %2 -t %1 -i NetBackup -server emailserver.company.com -q >>"C:\program files\veritas\netbackup\logs\blat.out.txt"
) ELSE (
blat %3 -s %2 -t %1 -i NetBackup -server emailserver.company.com -q -attach %4 >>"C:\program files\veritas\netbackup\logs\blat.out.txt"
)
	</pre>
<p>This will create a .txt file in the specified directory and will append to the bottom of that file. If there is an error message from BLAT it will show in the specified file. </p>
<li>There have been instances where email notification is working, but Vault will not send reports correctly. To correct this, a modification to the &#8220;blat&#8221; line in the nbmail.cmd file is necessary. If you are experiencing this, make the following modification to the nbmail.cmd file: <br />
Example on NetBackup 4.5 and 5.x systems: </p>
<pre class="input">
@blat %3 -s %2 -t %1 -i NetBackup -server emailserver.company.com -q -mime
</pre>
<p>Example on NetBackup 6.0 systems:</p>
<pre class="input">
@IF "%~4"=="" (
blat %3 -s %2 -t %1 -i NetBackup -server emailserver.company.com -q -mime
) ELSE (
blat %3 -s %2 -t %1 -i NetBackup -server emailserver.company.com -q -attach %4 -mime
)
</pre>
<li>There have been instances where email notification is configured correctly, BLAT is configured correctly, but emails are not received. Try making the following modification to the nbmail.cmd file: <br />
	Example on NetBackup 4.5 and 5.x systems:</p>
<pre class="input">
@blat %3 -s %2 -t %1 -i NetBackup -server emailserver.company.com -q -enriched
	</pre>
<p>	Example on NetBackup 6.0 systems: </p>
<pre class="input">
@IF "%~4"=="" (
blat %3 -s %2 -t %1 -i NetBackup -server emailserver.company.com -q -enriched
) ELSE (
blat %3 -s %2 -t %1 -i NetBackup -server emailserver.company.com -q -attach %4 -enriched
)
	</pre>
</ol>
<h3>Related Documents:</h3>
<p><a href="http://support.veritas.com/docs/248387">248387: </a>Will VERITAS NetBackup &#8482; 4.5 work with command line Simple Mail Transfer Protocol tools other than BLAT? </p>
<p><a href="http://support.veritas.com/docs/256043">256043: </a>DOCUMENTATION: The nbmail.cmd mail notification &#8212; a mini workshop with troubleshooting tips and details of how to get it working</p>
<p><a href="http://support.veritas.com/docs/268192">268192: </a>VERITAS NetBackup &#8482; 5.1 System Administrator&#8217;s Guide, Volume I for Windows</p>
<p><a href="http://support.veritas.com/docs/268610">268610: </a>DOCUMENTATION: How to configure email notification and the different methods to email backup exit statuses from a UNIX master in NetBackup</p>
]]></content:encoded>
			<wfw:commentRss>http://xuming.info/2007/05/1002/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

