<?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>Shekhar Govindarajan's Blog &#187; Append</title>
	<atom:link href="http://www.shekhargovindarajan.com/tag/append/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.shekhargovindarajan.com</link>
	<description>My Notepad on the Web</description>
	<lastBuildDate>Sat, 04 Feb 2012 04:58:00 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.1.3</generator>
<atom:link rel="hub" href="http://pubsubhubbub.appspot.com/" />
			<item>
		<title>Postfix: Log E-mails&#8217; Subject</title>
		<link>http://www.shekhargovindarajan.com/tips-n-tricks/postfix-log-e-mails-subject/?&#038;owa_medium=feed&#038;owa_sid=&#038;utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=postfix-log-e-mails-subject</link>
		<comments>http://www.shekhargovindarajan.com/tips-n-tricks/postfix-log-e-mails-subject/#comments</comments>
		<pubDate>Mon, 29 Jun 2009 14:56:03 +0000</pubDate>
		<dc:creator>Shekhar</dc:creator>
				<category><![CDATA[Tips N Tricks]]></category>
		<category><![CDATA[Append]]></category>
		<category><![CDATA[CentOS]]></category>
		<category><![CDATA[E-mail]]></category>
		<category><![CDATA[email]]></category>
		<category><![CDATA[Fedora]]></category>
		<category><![CDATA[Find]]></category>
		<category><![CDATA[header_checks]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[log]]></category>
		<category><![CDATA[logging]]></category>
		<category><![CDATA[mail]]></category>
		<category><![CDATA[mail server]]></category>
		<category><![CDATA[maillog]]></category>
		<category><![CDATA[postfix]]></category>
		<category><![CDATA[production mail server]]></category>
		<category><![CDATA[redhat]]></category>
		<category><![CDATA[subject]]></category>
		<category><![CDATA[text editor]]></category>

		<guid isPermaLink="false">http://www.shekhargovindarajan.com/?p=731</guid>
		<description><![CDATA[In Linux, you can view the statistics of incoming and outgoing E-mails by peeking into a log file called maillog (typically found in /var/log directory). Maillog provides the general information about the mails, for example, the sender and recipient(s), status &#8211; sent, rejected, bounced etc. I typically use maillog to check the destiny of mails. [...]]]></description>
			<content:encoded><![CDATA[<p>In Linux, you can view the statistics of incoming and outgoing E-mails by peeking into a log file called maillog (typically found in /var/log directory). Maillog provides the general information about the mails, for example, the sender and recipient(s), status &#8211; sent, rejected, bounced etc. I typically use maillog to check the destiny of mails. At times, it becomes difficult to spot a particular mail due to the sheer volume of mails being logged &#8211; especially on a production mail server.</p>
<p>For example: what if we need to check whether a particular mail sent by Person A has been delivered to Person B. Note that Person A might be sending lots of mails to Person B but we need to spot that one particular mail &#8211; say the one, which was sent by Person A but did not reach Person B. The only identifier, to identify a particular mail, in the maillog is the cryptic message ID. A better and more readable identifier would be the subject of an E-mail.Unfortunately, the subject of the mails is not logged, by default, in the maillog. But we can configure a mail server like Postfix to log the subject line.<span id="more-731"></span></p>
<p><a href="http://www.postfix.org/" target="_blank">Postfix</a> is a popular E-mail server a.k.a. MTA (Mail Transfer Agent) in the Linux world. With Postfix, it is easy to dump the subject line of every E-mail (incoming and outgoing) in the maillog. Assuming that you have a setup, configured and running Postfix, following is how to achieve it. Note that the path of the configuration files mentioned below are typical to <a href="http://www.redhat.com/" target="_blank">RedHat</a>, <a href="http://www.centos.org/" target="_blank">CentOS</a> and <a href="http://fedoraproject.org/" target="_blank">Fedora</a> Linux.</p>
<ul>
<li>Open the file called main.cf, found in /etc/postfix, in a text editor</li>
<li>Find and uncomment (by removing the preceding #) the line which says:<em>header_checks = regexp:/etc/postfix/header_checks<br />
</em></li>
<li>Save the file</li>
<li>Next, open the file named header_checks, found in the directory /etc/postfix, in a text editor</li>
<li>Append the following line to the file:/^Subject:/ WARN</li>
<li>Save the file and activate the Postfix&#8217;s configuration changes by issuing &#8216;service postfix reload&#8217;</li>
</ul>
<p>That&#8217;s it. Now in the maillog,  you will see the subject line of every incoming and outgoing mail. It will show  as follows:</p>
<p>Jun 29 06:16:28 mailer postfix/cleanup[473]: 1A96CD40CA: warning: header Subject: It Works! from mailsrv.foo.com[10.1.1.50]; from=&lt;personA@foo.com&gt; to=&lt;personB@foo1.com&gt; &#8230;</p>
<p>Note that the Subject (&#8220;It Works!&#8221; in this case) is logged in the maillog to identify the E-mail quite easily.</p>
<img src="http://www.shekhargovindarajan.com/?ak_action=api_record_view&id=731&type=feed" alt="" />]]></content:encoded>
			<wfw:commentRss>http://www.shekhargovindarajan.com/tips-n-tricks/postfix-log-e-mails-subject/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

