<?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</title>
	<atom:link href="http://www.unixsurgeon.com/kb/category/exim/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 Error [ 550 &quot;REJECTED - Bad HELO - Host impersonating ]….</title>
		<link>http://www.unixsurgeon.com/kb/exim-error-550-rejected-bad-helo-host-impersonating-%e2%80%a6.html</link>
		<comments>http://www.unixsurgeon.com/kb/exim-error-550-rejected-bad-helo-host-impersonating-%e2%80%a6.html#comments</comments>
		<pubDate>Fri, 13 Aug 2010 20:07:27 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Exim]]></category>
		<category><![CDATA[Mail Server]]></category>
		<category><![CDATA[550 "rejected-bad helo"]]></category>
		<category><![CDATA[Exim error bad helo]]></category>

		<guid isPermaLink="false">http://www.unixsurgeon.com/kb/?p=104</guid>
		<description><![CDATA[550 “REJECTED – Bad HELO – Host impersonating
If you found this error for any  particular domain say unixsurgeon.com, then first check the mx record for this domain. If the MX record is pointing to a different server, then just remove the domain entry unixsurgeon.com from the /etc/localdomains, And add the same entry in /etc/remotedomains. [...]]]></description>
			<content:encoded><![CDATA[<p><strong>550 “REJECTED – Bad HELO – Host impersonating</strong></p>
<p>If you found this error for any  particular domain say unixsurgeon.com, then first check the mx record for this domain. If the MX record is pointing to a different server, then just remove the domain entry unixsurgeon.com from the /etc/localdomains, And add the same entry in /etc/remotedomains. After that restart the exim service.</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>[root@p-root]#  /etc/init.d/exim  stop</p>
<p>[root@p-root]#  /etc/init.d/exim  start</p>
<p>It will solve your problem. And Other option is  find the following line in exim.conf  and  comment it.</p>
<p>[root@p-root]#  vi  /etc/exim.conf</p>
<p>drop<br />
condition = ${if match{$sender_helo_name}{$primary_hostname}}<br />
message   = “REJECTED – Bad HELO – Host impersonating [$sender_helo_name]“</p>
<p>======================================================================================</p>
<p>Enjoy Linux !!!</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-error-550-rejected-bad-helo-host-impersonating-%e2%80%a6.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Howto change interface ip address in Exim.</title>
		<link>http://www.unixsurgeon.com/kb/howto-change-interface-ip-address-in-exim.html</link>
		<comments>http://www.unixsurgeon.com/kb/howto-change-interface-ip-address-in-exim.html#comments</comments>
		<pubDate>Sun, 19 Apr 2009 08:10:42 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Exim]]></category>
		<category><![CDATA[Mail Server]]></category>
		<category><![CDATA[interface ip address]]></category>
		<category><![CDATA[mail server ip blacklisted]]></category>

		<guid isPermaLink="false">http://www.unixsurgeon.com/?p=18</guid>
		<description><![CDATA[Some times your server&#8217;s either main or shared IP address may get black listed by most of RBLs due to some reasons like(spamming,virus infacted mails &#38; trojans.
In such situations, it would be very difficult to receive/send some important emails due to this black list.And it affact your mail server reputation in all over the world.
In [...]]]></description>
			<content:encoded><![CDATA[<p>Some times your server&#8217;s either main or shared IP address may get black listed by most of RBLs due to some reasons like(spamming,virus infacted mails &amp; trojans.</p>
<p>In such situations, it would be very difficult to receive/send some important emails due to this black list.And it affact your mail server reputation in all over the world.</p>
<p>In such situation a quick resolution is to route/relay the emails through a secondary IP address on the same server which is not black listed under those RBLs.</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>The mail server on cpanel i.e exim allows you to change the default IP address used by the mail server so that you would be able to route all emails through this new secondary IP address.</p>
<p>Method 1. :-** Send outgoing mail from the ip that matches the domain name in /etc/mailips (*: IP can be added to the file to change the main outgoing interface)**</p>
<p>Add an secondary ip address in to this file and save and exit.</p>
<p>Restart the exim service.<br />
# /etc/init.d/exim restart</p>
<p>Method 2 :- Here are the step by step instructions for you to configure your exim mail server to use new IP address.</p>
<p>1 :- Shutdown the exim service.<br />
# service exim stop or /etc/init.d/exim stop</p>
<p>2 :- Edit your exim configuration file.<br />
# vi /etc/exim.conf</p>
<p>3 :- go to &#8220;remote_smtp&#8221; section under &#8220;TRANSPORTS CONFIGURATION&#8221;.<br />
By default it would look like below:</p>
<p>remote_smtp:<br />
driver = smtp<br />
interface = ${if exists {/etc/mailips}{${lookup{$sender_address_domain}lsearch{/etc/mailips}{$value}{}}}{}}<br />
helo_data = ${if exists {/etc/mailhelo}{${lookup{$sender_address_domain}lsearch{/etc/mailhelo}{$value}{$primary_hostname}}}{$primary_ho stname}}</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>
<br />
4 :- Comment line containing &#8220;interface&#8221; and &#8220;helo_data&#8221; and add new &#8220;interface&#8221; to match with that of your new IP address. It should look like as follows:</p>
<p>remote_smtp:<br />
driver = smtp<br />
interface = 10.10.10.10 # Your IP address.</p>
<p>5 :- Save your changes and exit out from your exim configuration file.</p>
<p>Note :- Dont forget to set read only attributes on exim configuration file, so that it won&#8217;t get reset to default automatically.</p>
<p>You can do it using following command:</p>
<p># chattr +aui /etc/exim.conf</p>
<p>6 :- start exim service on your server.<br />
# service exim restart or /etc/init.d/exim restart</p>
<p>7 :- Make sure to set reverse DNS for this new IP address to point a valid FQDN.</p>
<p>8 :- Try sending a test email and you will find that, it was sent using this new IP address configured under your exim configuration.</p>
<p>You can verify it by checking the header of new email under exim&#8217;s log file i.e /var/log/exim_mainlog</p>
<p>Enjoy linux !!! <img src='http://www.unixsurgeon.com/kb/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </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/howto-change-interface-ip-address-in-exim.html/feed</wfw:commentRss>
		<slash:comments>3</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>

