<?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>Unix Surgeon &#187; Exim Commands</title>
	<atom:link href="http://www.unixsurgeon.com/kb/tag/exim-commands/feed" rel="self" type="application/rss+xml" />
	<link>http://www.unixsurgeon.com/kb</link>
	<description>Linux Hosting Solution, Linux Web Hosting Solution, Learn Linux, How to, Server Management , Web Hosting Solution , Linux Solution , KnowledgeBase , Linux Tutorial</description>
	<lastBuildDate>Mon, 06 Feb 2012 10:42:49 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.6</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>How to monitor all outgoing emails in exim</title>
		<link>http://www.unixsurgeon.com/kb/how-to-monitor-all-outgoing-emails-in-exim.html</link>
		<comments>http://www.unixsurgeon.com/kb/how-to-monitor-all-outgoing-emails-in-exim.html#comments</comments>
		<pubDate>Thu, 03 Mar 2011 10:38:16 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Exim]]></category>
		<category><![CDATA[Linux tutorials]]></category>
		<category><![CDATA[Mail Server]]></category>
		<category><![CDATA[Open Source Applications]]></category>
		<category><![CDATA[catchall]]></category>
		<category><![CDATA[Exim Commands]]></category>
		<category><![CDATA[monitor all mails in exim]]></category>
		<category><![CDATA[monitor all outgoing mails in WHM/Cpanel]]></category>

		<guid isPermaLink="false">http://www.unixsurgeon.com/kb/?p=239</guid>
		<description><![CDATA[Every Day  I receive such type of request that….client wants to monitor all outgoing email (to see what his peoples/employees are sending their customers).
What&#8217;s the easiest way to set this up? If it&#8217;s possible, probably invisibly forwarding all outgoing email to his private email box would work.
Question :- Simply How can we send a copy [...]]]></description>
			<content:encoded><![CDATA[<p>Every Day  I receive such type of request that….client wants to monitor all outgoing email (to see what his peoples/employees are sending their customers).</p>
<p>What&#8217;s the easiest way to set this up? If it&#8217;s possible, probably invisibly forwarding all outgoing email to his private email box would work.</p>
<p><strong>Question :-</strong> Simply How can we send a copy of all outgoing messages to another mailbox?</p>
<p><strong>Answer :-</strong> The most straightforward way is to set up a system filter, and include a command such as:</p>
<pre><strong>unseen deliver mailbox@whatever.domain</strong></pre>
<p>This sends a copy of every message to <em>mailbox@yourdomain.com</em> (unless the message already has that recipient &#8211; Exim never does duplicate deliveries). To save only <em>outgoing</em> messages, you need to come up with a definition of what <em>outgoing</em> means. Typically, this might be a check on the sender address and/or on the originating host. Here is an example:</p>
<pre><strong>if $sender_address_domain is mydomain.com and</strong></pre>
<pre><strong>   ${mask:$sender_host_address/24} is 192.168.124.0/24</strong></pre>
<pre><strong>then</strong></pre>
<pre><strong>  unseen deliver mailbox@whatever.domain</strong></pre>
<pre><strong>endif</strong></pre>
<p style="text-align: center;"><script type="text/javascript"><!--
google_ad_client = "pub-7877248176171699";
google_ad_slot = "4635030684";
google_ad_width = 468;
google_ad_height = 60;
//--></script>
<script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></script>
</p>
<p><strong>Detailed Description :-</strong></p>
<p>Login to WHM as root:</p>
<p>Main &gt;&gt; Service Configuration &gt;&gt; Exim Configuration Editor</p>
<p>Check the name &amp; location of &#8220;System_Filter_file&#8221;, mine is at<br />
/etc/cpanel_exim_system_filter  or /usr/local/cpanel/base/eximacl/antivirusandspam.exim</p>
<p>Now edit this file in your favorite editor and insert this code:</p>
<p><strong>For collecting outgoing mails only</strong></p>
<p><strong>Code:</strong></p>
<p>### START OF OUTGOING MAIL FORWARDING ###</p>
<p>if first_delivery</p>
<p>and (&#8221;$h_from:&#8221; contains &#8220;user@domain.com&#8221;)</p>
<p>then</p>
<p>unseen deliver &#8220;monitor@domain.com&#8221;</p>
<p>endif</p>
<p>### END OF OUTGOING MAIL FORWARDING ###</p>
<p><strong>For collecting both outgoing and incoming mails:</strong></p>
<p><strong>Code:</strong></p>
<p>### START OF OUTGOING + INCOMING MAIL FORWARDING ###</p>
<p>if first_delivery</p>
<p>and (&#8221;$h_to:, $h_cc:&#8221; contains &#8220;user@domain.com&#8221;)</p>
<p>or (&#8221;$h_from:&#8221; contains &#8220;user@domain.com&#8221;)</p>
<p>then</p>
<p>unseen deliver &#8220;monitor@domain.com&#8221;</p>
<p>endif</p>
<p>### END OF OUTGOING + INCOMING MAIL FORWARDING ###</p>
<p>Above method will silently/invisibly forward mails to the mail ID <a href="mailto:monitor@domain.com">monitor@domain.com</a> (change it to actual mail ID where you want all the mails to be delivered, this could be an internal or external mail ID)</p>
<p>Change <a href="mailto:user@domain.com">user@domain.com</a> to actual mail ID that is to be monitored.</p>
<p>You have to make one entry per user between the comments.</p>
<p><strong>Code:</strong></p>
<p>### START OF OUTGOING + INCOMING MAIL FORWARDING Company-1###</p>
<p>Entry &#8211; 1</p>
<p>Entry &#8211; 2</p>
<p>Entry &#8211; 3</p>
<p>### END OF OUTGOING + INCOMING MAIL FORWARDING Company-1 ###</p>
<p>### START OF OUTGOING + INCOMING MAIL FORWARDING Company-2###</p>
<p>Entry &#8211; 1</p>
<p>Entry &#8211; 2</p>
<p>Entry &#8211; 3</p>
<p>### END OF OUTGOING + INCOMING MAIL FORWARDING Company-2 ###</p>
<p>Important: If the system filter mentioned in WHM is &#8220;/etc/cpanel_exim_system_filter&#8221; change it to something like &#8220;/etc/cpanel_exim_system_filter_custom&#8221;, otherwise cPanel update will overwrite it.</p>
<p><strong>For Catchall Account : –</strong> Just put a domain name to catch all emails on specified mailbox:</p>
<p><strong>Code:</strong></p>
<p>### START OF OUTGOING + INCOMING MAIL FORWARDING ###</p>
<p>if first_delivery</p>
<p>and (&#8221;$h_to:, $h_cc:&#8221; contains &#8220;@domain.com&#8221;)</p>
<p>or (&#8221;$h_from:&#8221; contains &#8220;@domain.com&#8221;)</p>
<p>then</p>
<p>unseen deliver &#8220;monitor@domain.com&#8221;</p>
<p>endif</p>
<p>### END OF OUTGOING + INCOMING MAIL FORWARDING ###</p>
<p>You must already be having an entry if there is no entry then put the below code:-</p>
<p><strong>Code:</strong></p>
<p>if not first_delivery</p>
<p>then</p>
<p>finish</p>
<p>endif</p>
<p>So put the filter code below that. Save the file, and don’t forget to restart exim.</p>
<p style="text-align: center;"><script type="text/javascript"><!--
google_ad_client = "pub-7877248176171699";
google_ad_slot = "4635030684";
google_ad_width = 468;
google_ad_height = 60;
//--></script>
<script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></script>
</p>
<p>Enjoy Linux….!!!!!!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.unixsurgeon.com/kb/how-to-monitor-all-outgoing-emails-in-exim.html/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Exim command-line shortcuts.</title>
		<link>http://www.unixsurgeon.com/kb/exim-command-line-shortcats.html</link>
		<comments>http://www.unixsurgeon.com/kb/exim-command-line-shortcats.html#comments</comments>
		<pubDate>Fri, 20 Mar 2009 07:35:33 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Exim]]></category>
		<category><![CDATA[Mail Server]]></category>
		<category><![CDATA[Exim Commands]]></category>

		<guid isPermaLink="false">http://www.unixsurgeon.com/?p=17</guid>
		<description><![CDATA[==== REMOVE MAILS BY ID ====
/usr/sbin/exim -v -Mrm (MAIL ID HERE)
==== LIST QUEDED MAILS ====
/usr/sbin/exim -bp
==== OUTPUT NUMBER OF QUEDED MAILS ====
/usr/sbin/exim -bpc



==== DELETE FROZEN MAILS ====
/usr/sbin/exim -bp &#124; awk &#8216;$6~&#8221;frozen&#8221; { print $3 }&#8217; &#124; xargs exim -Mrm
==== DELIVER FORCEFULLY EMAILS ====
/usr/sbin/exim -qff -v -C /etc/exim.conf &#38;
==== FREEZE MAILS FROM SENDER ====
/usr/sbin/exiqgrep -i -f [...]]]></description>
			<content:encoded><![CDATA[<p>==== REMOVE MAILS BY ID ====</p>
<p><strong>/usr/sbin/exim -v -Mrm (MAIL ID HERE)</strong></p>
<p>==== LIST QUEDED MAILS ====</p>
<p><strong>/usr/sbin/exim -bp</strong></p>
<p>==== OUTPUT NUMBER OF QUEDED MAILS ====</p>
<p><strong>/usr/sbin/exim -bpc</strong></p>
<p style="text-align: center;"><script type="text/javascript"><!--
google_ad_client = "pub-7877248176171699";
google_ad_slot = "4635030684";
google_ad_width = 468;
google_ad_height = 60;
//--></script>
<script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></script>
</p>
<p>==== DELETE FROZEN MAILS ====</p>
<p><strong>/usr/sbin/exim -bp | awk &#8216;$6~&#8221;frozen&#8221; { print $3 }&#8217; | xargs exim -Mrm</strong></p>
<p>==== DELIVER FORCEFULLY EMAILS ====</p>
<p><strong>/usr/sbin/exim -qff -v -C /etc/exim.conf &amp;</strong></p>
<p>==== FREEZE MAILS FROM SENDER ====</p>
<p><strong>/usr/sbin/exiqgrep -i -f (MAIL ADDRESS HERE) | xargs exim -Mf</strong></p>
<p>==== REMOVE MAILS FROM SENDER ====</p>
<p><strong>/usr/sbin/exiqgrep -i -f (MAIL ADDRESS HERE) | xargs exim -Mrm</strong></p>
<p>==== REMOVE MAILS FROM RECIPIENT ====</p>
<p><strong>exiqgrep -i -r (MAIL ADDRESS HERE) | xargs exim -Mrm</strong></p>
<p>=====COUNT HOW MANY FROZEN MAILS IN QUEUE===</p>
<p><strong>exim -bpr | grep frozen | wc -l</strong></p>
<p>====DELETE ALL FROZEN MAILS FROM QUEUE=======</p>
<p><strong>exim -bpr | grep frozen | awk {&#8217;print $3&#8242;} | xargs exim -Mrm</strong></p>
<p>======DELETE MAILS THAT ARE OLDER THEN ONE DAY=======</p>
<p><strong>exiqgrep -o 86400 -i | xargs exim -Mrm</strong></p>
<p>&#8220;If you want to delete mails more then 1 day please multiply it to 86400 means that you want to delete mails older then 3 days then use :- exiqgrep -o 257200 -i | xargs exim -Mrm   (86400 *3 =257200) &#8221;</p>
<p>=======TO REMOVE ALL FROZEN MAILS=====</p>
<p><strong>exim -bp | awk &#8216;/frozen/ {print $3 }&#8217;| xargs exim -Mrm</strong></p>
<p style="text-align: center;"><script type="text/javascript"><!--
google_ad_client = "pub-7877248176171699";
google_ad_slot = "4635030684";
google_ad_width = 468;
google_ad_height = 60;
//--></script>
<script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></script>
</p>
]]></content:encoded>
			<wfw:commentRss>http://www.unixsurgeon.com/kb/exim-command-line-shortcats.html/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>

