<?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>InstaCarma Blog &#187; exim</title>
	<atom:link href="http://www.instacarma.com/blog/tag/exim/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.instacarma.com/blog</link>
	<description>Information Resource for Web Hosting Technical Support and Server Management</description>
	<lastBuildDate>Tue, 24 May 2011 10:01:02 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2</generator>
		<item>
		<title>How to set up a forwarder for outgoing emails?</title>
		<link>http://www.instacarma.com/blog/technical/how-to-set-up-a-forwarder-for-outgoing-emails/</link>
		<comments>http://www.instacarma.com/blog/technical/how-to-set-up-a-forwarder-for-outgoing-emails/#comments</comments>
		<pubDate>Thu, 06 May 2010 19:40:28 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Articles and tutorials]]></category>
		<category><![CDATA[Technical]]></category>
		<category><![CDATA[email]]></category>
		<category><![CDATA[exim]]></category>
		<category><![CDATA[filter]]></category>
		<category><![CDATA[forwarding]]></category>
		<category><![CDATA[mail]]></category>

		<guid isPermaLink="false">http://instacarma.com/blog/?p=1200</guid>
		<description><![CDATA[Filed under: email, exim, filter, forwarding, mail Issue : How can emails going out from a particular domain be copied to a common email address ? Solution : In order to set up a forwarder for outgoing emails from a particular domain to another email address, use the following steps : First, open the file [...]]]></description>
			<content:encoded><![CDATA[<p>Filed under: <a href='http://www.instacarma.com/blog/tag/email/'>email</a>, <a href='http://www.instacarma.com/blog/tag/exim/'>exim</a>, <a href='http://www.instacarma.com/blog/tag/filter/'>filter</a>, <a href='http://www.instacarma.com/blog/tag/forwarding/'>forwarding</a>, <a href='http://www.instacarma.com/blog/tag/mail/'>mail</a></p>
<p><strong>Issue : </strong></p>
<p>How can emails going out from a particular domain be copied to a common email address ? </p>
<p><strong>Solution : </strong></p>
<p>In order to set up a forwarder for outgoing emails from a particular domain to another  email address, use the following steps : </p>
<p>First, open the file <em>/etc/cpanel_exim_system_filter</em> using any of your favorite editors.</p>
<p>Add the following content to it : </p>
<blockquote><p>if (<br />
$received_protocol is &#8220;local&#8221; or<br />
$received_protocol is &#8220;esmtpa&#8221; or<br />
$received_protocol is &#8220;smtp&#8221;<br />
) and (<br />
$header_from contains &#8220;@domainname.com&#8221; )<br />
then<br />
unseen deliver username@domainname.com<br />
endif</p></blockquote>
<p>Now, if you DO NOT want to forward outgoing emails from a particular email address on that domain, you can add the following code in the <em>/etc/cpanel_exim_system_filter</em> file :</p>
<blockquote><p>if (<br />
$received_protocol is &#8220;local&#8221; or<br />
$received_protocol is &#8220;esmtpa&#8221; or<br />
$received_protocol is &#8220;smtp&#8221;<br />
) and (<br />
$sender_address is not &#8221; username_escape@domainname.com<br />
and (<br />
$header_from contains &#8220;@domainname.com&#8221; )<br />
then<br />
unseen deliver username@domainname.com<br />
endif</p></blockquote>
<p>Finally, you should replace the values of the variables used in the above codes.</p>
<p>domainname.com &#8211; the actual domain<br />
username@domainname.com &#8211; email address to which you want to forward.<br />
username_escape@domainname.com  &#8211; email address that you don&#8217;t want to forward</p>
<p>Save and exit the file.</p>
<p>Restart Exim using any of the the following commands : </p>
<p><em>/scripts/restartsrv_exim</em> or</p>
<p><em>/etc/init.d/exim restar</em>t or</p>
<p><em>service exim restart</em></p>
<div class="alignright"><div class="g-plusone" data-href="http://www.instacarma.com/blog/technical/how-to-set-up-a-forwarder-for-outgoing-emails/" size="standard" count="true"></div></div>]]></content:encoded>
			<wfw:commentRss>http://www.instacarma.com/blog/technical/how-to-set-up-a-forwarder-for-outgoing-emails/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>SpamAssassin : WHM ACL Options : Reject mails with spam score at SMTP time</title>
		<link>http://www.instacarma.com/blog/technical/spamassassin-how-to-change-the-value-of-spam-score-for-rejecting-the-mails/</link>
		<comments>http://www.instacarma.com/blog/technical/spamassassin-how-to-change-the-value-of-spam-score-for-rejecting-the-mails/#comments</comments>
		<pubDate>Tue, 23 Mar 2010 15:46:53 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Quick fixes]]></category>
		<category><![CDATA[Technical]]></category>
		<category><![CDATA[ACL]]></category>
		<category><![CDATA[email]]></category>
		<category><![CDATA[exim]]></category>
		<category><![CDATA[mail]]></category>
		<category><![CDATA[SMTP]]></category>
		<category><![CDATA[spam]]></category>
		<category><![CDATA[spamassassin]]></category>
		<category><![CDATA[WHM]]></category>

		<guid isPermaLink="false">http://instacarma.com/blog/?p=1186</guid>
		<description><![CDATA[Filed under: ACL, email, exim, mail, SMTP, spam, spamassassin, WHM Issue : It seems that by default, it is set to reject mails with a spam score of more than 20 at SMTP time. How to change the value of spam score for rejecting the mails at SMTP time ? Solution : You can do [...]]]></description>
			<content:encoded><![CDATA[<p>Filed under: <a href='http://www.instacarma.com/blog/tag/acl/'>ACL</a>, <a href='http://www.instacarma.com/blog/tag/email/'>email</a>, <a href='http://www.instacarma.com/blog/tag/exim/'>exim</a>, <a href='http://www.instacarma.com/blog/tag/mail/'>mail</a>, <a href='http://www.instacarma.com/blog/tag/smtp/'>SMTP</a>, <a href='http://www.instacarma.com/blog/tag/spam/'>spam</a>, <a href='http://www.instacarma.com/blog/tag/spamassassin/'>spamassassin</a>, <a href='http://www.instacarma.com/blog/tag/whm/'>WHM</a></p>
<p><strong>Issue : </strong></p>
<p>It seems that by default, it is set to reject mails with a spam score of more than 20 at SMTP time. How to change the value of spam score for rejecting the mails at SMTP time ?</p>
<p><strong>Solution : </strong></p>
<p>You can do that by doing the following : </p>
<p>1. Go to WHM >> Main >> Service Configuration >> Exim Configuration Editor<br />
2. Look for the section &#8216;ACL Options&#8217; .<br />
3. The first parameter under that deals with the spam score setting at SMTP time. De-select the check box corresponding to that.<br />
4. When you de-select the check box, it will give you the other available options. Check the box corresponding to the desired value.<br />
5. Click on &#8216;Save&#8217; at the bottom to save the settings.</p>
<div class="alignright"><div class="g-plusone" data-href="http://www.instacarma.com/blog/technical/spamassassin-how-to-change-the-value-of-spam-score-for-rejecting-the-mails/" size="standard" count="true"></div></div>]]></content:encoded>
			<wfw:commentRss>http://www.instacarma.com/blog/technical/spamassassin-how-to-change-the-value-of-spam-score-for-rejecting-the-mails/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to block emails from a specific address using Exim</title>
		<link>http://www.instacarma.com/blog/technical/how-to-block-emails-from-a-specific-address-using-exim/</link>
		<comments>http://www.instacarma.com/blog/technical/how-to-block-emails-from-a-specific-address-using-exim/#comments</comments>
		<pubDate>Sun, 07 Feb 2010 15:20:19 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Quick fixes]]></category>
		<category><![CDATA[Technical]]></category>
		<category><![CDATA[block]]></category>
		<category><![CDATA[email]]></category>
		<category><![CDATA[exim]]></category>
		<category><![CDATA[mail]]></category>
		<category><![CDATA[WHM]]></category>

		<guid isPermaLink="false">http://instacarma.com/blog/?p=1144</guid>
		<description><![CDATA[Filed under: block, email, exim, mail, WHM Issue : How to block emails from a specific address on a cPanel/WHM server using Exim ? Solution : This is fairly easy to achieve with Exim. First you&#8217;ll need to find the system filter file for Exim. This can be found out through WHM >> Main >> [...]]]></description>
			<content:encoded><![CDATA[<p>Filed under: <a href='http://www.instacarma.com/blog/tag/block/'>block</a>, <a href='http://www.instacarma.com/blog/tag/email/'>email</a>, <a href='http://www.instacarma.com/blog/tag/exim/'>exim</a>, <a href='http://www.instacarma.com/blog/tag/mail/'>mail</a>, <a href='http://www.instacarma.com/blog/tag/whm/'>WHM</a></p>
<p><strong>Issue : </strong></p>
<p>How to block emails from a specific address on a cPanel/WHM server using Exim ?</p>
<p><strong>Solution : </strong></p>
<p>This is fairly easy to achieve with Exim.<br />
First you&#8217;ll need to find the system filter file for Exim. This can be found out through WHM >> Main >> Service Configuration >> Exim Configuration Editor.<br />
Towards the middle of the page, under the section &#8216;Filters&#8217; , you &#8216;ll find the path to the file.<br />
Open that file via SSH using your favorite editor and add the following to it : </p>
<blockquote><p>if first_delivery<br />
and ( (&#8220;$h_from:&#8221; contains &#8220;emailtoblock@domainname.com&#8221;)<br />
)<br />
then fail<br />
endif</p></blockquote>
<p>If you would like a copy of the email to be sent to you after the message fails, use the following code :</p>
<blockquote><p>if first_delivery<br />
and ( (&#8220;$h_from:&#8221; contains &#8220;emailtoblock@domainname.com&#8221;)<br />
)<br />
then<br />
unseen deliver &#8220;youremail@yourdomainname.com&#8221;<br />
fail<br />
endif</p></blockquote>
<p>Make sure that you substitute the correct email addresses in the above code.</p>
<div class="alignright"><div class="g-plusone" data-href="http://www.instacarma.com/blog/technical/how-to-block-emails-from-a-specific-address-using-exim/" size="standard" count="true"></div></div>]]></content:encoded>
			<wfw:commentRss>http://www.instacarma.com/blog/technical/how-to-block-emails-from-a-specific-address-using-exim/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to limit the overall size of emails</title>
		<link>http://www.instacarma.com/blog/technical/how-to-limit-the-overall-size-of-emails/</link>
		<comments>http://www.instacarma.com/blog/technical/how-to-limit-the-overall-size-of-emails/#comments</comments>
		<pubDate>Sun, 07 Feb 2010 14:37:51 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Quick fixes]]></category>
		<category><![CDATA[Technical]]></category>
		<category><![CDATA[email]]></category>
		<category><![CDATA[exim]]></category>
		<category><![CDATA[mail]]></category>
		<category><![CDATA[WHM]]></category>

		<guid isPermaLink="false">http://instacarma.com/blog/?p=1149</guid>
		<description><![CDATA[Filed under: email, exim, mail, WHM Issue : How can the overall size of an email including attachment, encoding etc. be limited to a pre-defined value? Solution : This can be done in the following way : Go to WHM >> Main >> Service Configuration >> Exim Configuration Editor In the first box where you [...]]]></description>
			<content:encoded><![CDATA[<p>Filed under: <a href='http://www.instacarma.com/blog/tag/email/'>email</a>, <a href='http://www.instacarma.com/blog/tag/exim/'>exim</a>, <a href='http://www.instacarma.com/blog/tag/mail/'>mail</a>, <a href='http://www.instacarma.com/blog/tag/whm/'>WHM</a></p>
<p><strong>Issue : </strong></p>
<p>How can the overall size of an email including attachment, encoding etc. be limited to a pre-defined value?</p>
<p><strong>Solution : </strong></p>
<p>This can be done in the following way :<br />
Go to  WHM >> Main >> Service Configuration >> Exim Configuration Editor<br />
In the first box where you can type ( right below where you see &#8216;#!!# cPanel Exim 4 Config&#8217; ), add the following directive : </p>
<blockquote><p>message_size_limit = 100M</p></blockquote>
<p>This will limit the overall size of the message to 100Mb</p>
<div class="alignright"><div class="g-plusone" data-href="http://www.instacarma.com/blog/technical/how-to-limit-the-overall-size-of-emails/" size="standard" count="true"></div></div>]]></content:encoded>
			<wfw:commentRss>http://www.instacarma.com/blog/technical/how-to-limit-the-overall-size-of-emails/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Allowing exim to run automatically on ports other than 25 and 26</title>
		<link>http://www.instacarma.com/blog/technical/allowing-exim-to-run-automatically-on-ports-apart-from-25-and-26/</link>
		<comments>http://www.instacarma.com/blog/technical/allowing-exim-to-run-automatically-on-ports-apart-from-25-and-26/#comments</comments>
		<pubDate>Tue, 10 Nov 2009 17:21:57 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Articles and tutorials]]></category>
		<category><![CDATA[Technical]]></category>
		<category><![CDATA[exim]]></category>
		<category><![CDATA[port]]></category>

		<guid isPermaLink="false">http://instacarma.com/blog/?p=961</guid>
		<description><![CDATA[Filed under: exim, port We can achieve this by starting exim on the particular port (say 588) using the following command: /usr/sbin/exim -oX 588 -bd But to get this done automatically whenever exim starts, do the following: 1) In /etc/chkserv.d, add a file called exim_588 (to run it on port 588). Note the underscore there. [...]]]></description>
			<content:encoded><![CDATA[<p>Filed under: <a href='http://www.instacarma.com/blog/tag/exim/'>exim</a>, <a href='http://www.instacarma.com/blog/tag/port/'>port</a></p>
<p>We can achieve this by starting exim on the particular port (say 588) using the following command:</p>
<blockquote><p>/usr/sbin/exim -oX 588 -bd</p></blockquote>
<p>But to get this done automatically whenever exim starts, do the following:</p>
<p>1) In <em>/etc/chkserv.d</em>, add a file called exim_588 (to run it on port 588).</p>
<p>Note the underscore there. Do not replace it with hyphen as there is another file exim-26 that uses that. The content of the file would be:</p>
<blockquote><p>service[exim-588]=588,QUIT,220,/etc/rc.d/init.d/exim stop;/etc/rc.d/init.d/exim stop;/etc/rc.d/init.d/exim stop;/etc/rc.d/init.d/exim start;/usr/sbin/exim -oX 588 -bd
</p></blockquote>
<p>2) Enable it in <em>/etc/chkserv.d/chkservd.conf</em></p>
<p>exim_588:1</p>
<p>3) Now make the following changes in <em>/etc/init.d/exim</em>. Search for ALTPORT and add the following lines below that:</p>
<blockquote><p>if [ "`echo $file | awk -F_ '{ print $1 }'`" = "exim" ]; then<br />
ALTPORT2=&#8221;`echo $file | awk -F_ &#8216;{ print $2 }&#8217;`&#8221;<br />
fi
</p></blockquote>
<p>Again search for it and add these lines:</p>
<blockquote><p>if [ "$ALTPORT2" != "" -a "`grep \"daemon_smtp_port.* $ALTPORT2\" /etc/exim.conf`" = "" ]; then<br />
echo -n &#8220;Starting exim-$ALTPORT2: &#8221;<br />
TMPDIR=/tmp $DAEMONIZE /usr/sbin/exim -bd -oX $ALTPORT2<br />
echo $RESULT<br />
fi</p></blockquote>
<p>This will ensure that exim runs on port 588  on start. You can also see it enabled in Whm >> Service Manager.</p>
<div class="alignright"><div class="g-plusone" data-href="http://www.instacarma.com/blog/technical/allowing-exim-to-run-automatically-on-ports-apart-from-25-and-26/" size="standard" count="true"></div></div>]]></content:encoded>
			<wfw:commentRss>http://www.instacarma.com/blog/technical/allowing-exim-to-run-automatically-on-ports-apart-from-25-and-26/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Configuring Exim to run on another port</title>
		<link>http://www.instacarma.com/blog/technical/configuring-exim-to-run-on-another-port/</link>
		<comments>http://www.instacarma.com/blog/technical/configuring-exim-to-run-on-another-port/#comments</comments>
		<pubDate>Sun, 27 Sep 2009 19:04:32 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Quick fixes]]></category>
		<category><![CDATA[Technical]]></category>
		<category><![CDATA[exim]]></category>
		<category><![CDATA[WHM]]></category>

		<guid isPermaLink="false">http://instacarma.com/blog/?p=866</guid>
		<description><![CDATA[Filed under: exim, WHM Issue : Port 25 blocked is blocked by ISPs. How to add an alternate port ? Fix : Assuming that you want to use , say , port 666. Put the following line in the first text box in Advanced Exim Editor : daemon_smtp_ports = 25 : 666 OR Go to [...]]]></description>
			<content:encoded><![CDATA[<p>Filed under: <a href='http://www.instacarma.com/blog/tag/exim/'>exim</a>, <a href='http://www.instacarma.com/blog/tag/whm/'>WHM</a></p>
<p><strong>Issue : </strong></p>
<p>Port 25 blocked is blocked by ISPs. How to add an alternate port ?</p>
<p><strong>Fix : </strong></p>
<p>Assuming that you want to use , say , port 666.<br />
Put the following line in the first text box in Advanced Exim Editor :</p>
<blockquote><p>
daemon_smtp_ports = 25 : 666</p></blockquote>
<p>OR</p>
<p>Go to WHM >> Service Configuration >> Service Manager and check the check-box for &#8220;exim on another port.&#8221; </p>
<div class="alignright"><div class="g-plusone" data-href="http://www.instacarma.com/blog/technical/configuring-exim-to-run-on-another-port/" size="standard" count="true"></div></div>]]></content:encoded>
			<wfw:commentRss>http://www.instacarma.com/blog/technical/configuring-exim-to-run-on-another-port/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Some SSH tricks for Exim</title>
		<link>http://www.instacarma.com/blog/technical/some-ssh-tricks-for-exim/</link>
		<comments>http://www.instacarma.com/blog/technical/some-ssh-tricks-for-exim/#comments</comments>
		<pubDate>Sun, 02 Aug 2009 14:36:45 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Quick fixes]]></category>
		<category><![CDATA[Technical]]></category>
		<category><![CDATA[exim]]></category>
		<category><![CDATA[ssh]]></category>

		<guid isPermaLink="false">http://instacarma.com/blog/?p=690</guid>
		<description><![CDATA[Filed under: exim, ssh Removing Bad Mail for i in `exiqgrep -i -f nobody`; do exim -Mrm $i; done >> Removes Nobody Mail for i in `exiqgrep -i -o 259200`; do exim -Mrm $i; done >> Removes Mail older than 3 Days for i in `exiqgrep -i -f &#8220;^$&#8221;`; do exim -Mrm $i; done >> [...]]]></description>
			<content:encoded><![CDATA[<p>Filed under: <a href='http://www.instacarma.com/blog/tag/exim/'>exim</a>, <a href='http://www.instacarma.com/blog/tag/ssh/'>ssh</a></p>
<p><strong>Removing Bad Mail</strong></p>
<blockquote><p>for i in `exiqgrep -i -f nobody`; do exim -Mrm $i; done >> Removes Nobody Mail</p>
<p>for i in `exiqgrep -i -o 259200`; do exim -Mrm $i; done >> Removes Mail older than 3 Days</p>
<p>for i in `exiqgrep -i -f &#8220;^<>$&#8221;`; do exim -Mrm $i; done >> Removes Mail with weird Characters (Spam)</p></blockquote>
<p><strong>Delete mails from a particular domain</strong></p>
<blockquote><p>for i in `exiqgrep -i -f domain.com`; do exim -Mrm $i; done</p></blockquote>
<p><strong><br />
Delete mails to a particular domain</strong></p>
<blockquote><p>
for i in `exiqgrep -i -r domain.com`; do exim -Mrm $i; done</p></blockquote>
<p><strong>Flush the entire  Mail queue</strong></p>
<blockquote><p>for i in `exiqgrep -i -f `; do exim -Mrm $i; done</p></blockquote>
<p><strong>Run Mail queue</strong></p>
<blockquote><p>runq -qqff&#038;</p></blockquote>
<p><strong>Who is having large number of emails?</strong></p>
<blockquote><p>exim -bp | exiqsumm</p></blockquote>
<p><strong><br />
To check message header</strong></p>
<blockquote><p>exim -Mvh messageid</p></blockquote>
<p><strong>To check message content</strong></p>
<blockquote><p>exim -Mvb messageid</p></blockquote>
<div class="alignright"><div class="g-plusone" data-href="http://www.instacarma.com/blog/technical/some-ssh-tricks-for-exim/" size="standard" count="true"></div></div>]]></content:encoded>
			<wfw:commentRss>http://www.instacarma.com/blog/technical/some-ssh-tricks-for-exim/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Script for clearing unwanted queued emails from the server</title>
		<link>http://www.instacarma.com/blog/technical/script-for-clearing-unwanted-queued-emails-from-the-server/</link>
		<comments>http://www.instacarma.com/blog/technical/script-for-clearing-unwanted-queued-emails-from-the-server/#comments</comments>
		<pubDate>Sun, 24 May 2009 16:51:22 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Quick fixes]]></category>
		<category><![CDATA[Technical]]></category>
		<category><![CDATA[email]]></category>
		<category><![CDATA[exim]]></category>
		<category><![CDATA[script]]></category>

		<guid isPermaLink="false">http://instacarma.com/blog/?p=388</guid>
		<description><![CDATA[Filed under: email, exim, script Here is a small but handy script which will clear the queued emails from the server. exim -bpc exim -bpru &#124; grep frozen &#124; awk {&#8216;print $3&#8242;}&#124;xargs exim -Mrm exim -bpru &#124; grep &#8220;&#60;&#62;&#8221; &#124; awk {&#8216;print $3&#8242;}&#124;xargs exim -Mrm exim -bpru &#124; grep &#8220;nobody&#8221; &#124; awk {&#8216;print $3&#8242;}&#124;xargs exim [...]]]></description>
			<content:encoded><![CDATA[<p>Filed under: <a href='http://www.instacarma.com/blog/tag/email/'>email</a>, <a href='http://www.instacarma.com/blog/tag/exim/'>exim</a>, <a href='http://www.instacarma.com/blog/tag/script/'>script</a></p>
<p>Here is a small but handy script which will clear the queued emails from the server.</p>
<blockquote><p>exim -bpc<br />
exim -bpru | grep frozen | awk {&#8216;print $3&#8242;}|xargs exim -Mrm<br />
exim -bpru | grep &#8220;&lt;&gt;&#8221; | awk {&#8216;print $3&#8242;}|xargs exim -Mrm<br />
exim -bpru | grep &#8220;nobody&#8221; | awk {&#8216;print $3&#8242;}|xargs exim -Mrm<br />
exim -bpru|awk {&#8216;print $3&#8242;}|xargs exim -Mrm<br />
exiqgrep -o 86400 -i | xargs exim -Mrm<br />
exim -bpc</p></blockquote>
<p>This script will display the number of queued emails before clearing, then clear them and display the number after clearing them.</p>
<div class="alignright"><div class="g-plusone" data-href="http://www.instacarma.com/blog/technical/script-for-clearing-unwanted-queued-emails-from-the-server/" size="standard" count="true"></div></div>]]></content:encoded>
			<wfw:commentRss>http://www.instacarma.com/blog/technical/script-for-clearing-unwanted-queued-emails-from-the-server/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Tutorial on clearing  Disk Space on a Server</title>
		<link>http://www.instacarma.com/blog/technical/tutorial-on-clearing-out-disk-space/</link>
		<comments>http://www.instacarma.com/blog/technical/tutorial-on-clearing-out-disk-space/#comments</comments>
		<pubDate>Sun, 24 May 2009 13:47:03 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Articles and tutorials]]></category>
		<category><![CDATA[Popular Posts]]></category>
		<category><![CDATA[Quick fixes]]></category>
		<category><![CDATA[Technical]]></category>
		<category><![CDATA[apache]]></category>
		<category><![CDATA[backup]]></category>
		<category><![CDATA[cPanel]]></category>
		<category><![CDATA[disk]]></category>
		<category><![CDATA[exim]]></category>
		<category><![CDATA[Mysql]]></category>
		<category><![CDATA[space]]></category>

		<guid isPermaLink="false">http://instacarma.com/blog/?p=375</guid>
		<description><![CDATA[Filed under: apache, backup, cPanel, disk, exim, Mysql, space Running out of disk space is a very common issue.  Be it a web-hosting service provider or the end-user.  I wanted to share a few tips that the technical support staff  at InstaCarma use to resolve disk-space issues on a cPanel server. As we all know, [...]]]></description>
			<content:encoded><![CDATA[<p>Filed under: <a href='http://www.instacarma.com/blog/tag/apache/'>apache</a>, <a href='http://www.instacarma.com/blog/tag/backup/'>backup</a>, <a href='http://www.instacarma.com/blog/tag/cpanel/'>cPanel</a>, <a href='http://www.instacarma.com/blog/tag/disk/'>disk</a>, <a href='http://www.instacarma.com/blog/tag/exim/'>exim</a>, <a href='http://www.instacarma.com/blog/tag/mysql/'>Mysql</a>, <a href='http://www.instacarma.com/blog/tag/space/'>space</a></p>
<p>Running out of disk space is a very common issue.  Be it a <strong>web-hosting </strong>service provider or the end-user.  I wanted to share a few tips that the<strong> technical support</strong> staff  at <strong>InstaCarma</strong> use to resolve disk-space issues on a <strong>cPanel</strong> server. As we all know, there are various partitions on a server which are meant for different purposes. So, the methods used to deal with space issues on these partitions will also vary. Let us see them one by one.</p>
<p>The <strong>/USR</strong> partition</p>
<p>1. Restart the<strong><em> httpd</em></strong> service. This might free a little space some times.</p>
<p>2. Check for <strong><em>apache logs</em></strong> like error_log, access_log , suexec_log in <em>/usr/local/apache/logs</em> . These can either be cleared off or if you need the logs then you can take a zipped copy and keep it aside.</p>
<p>3. Same can be done for the files in<em> <strong>cPanel logs</strong></em> (<em>/usr/local/cpanel/logs</em>)  as well .</p>
<p>4. <strong><em>Domlogs</em></strong> &#8211; Get into  the <em>/usr/local/apache/domlogs/</em> directory. Run the following command :-</p>
<p># ls -al -SR | head -10        &#8212;&gt; It will list 10 files in the decreasing order according to their size</p>
<p>If the domlog file is too large for a domain then it is possible that <em>awstats</em> is not running . Check whether <em>cpanellogd</em> is running on the server  using <em> pstree</em> . If not, restart it .<br />
Else, it is possible that awstats for only that particular domain is not updating. Get into the directory <em>/usr/local/cpanel/base</em> and check if any file as &#8216;awstats.domainname.com.conf&#8217; exists.   If yes , delete that file.</p>
<p>Now,  run <em>/scripts/runweblogs</em> for that user.  It will update the awstats and automatically clear the domlogs file thereafter.<strong> Do not</strong> delete the domlogs file itself.</p>
<p>5. Remove old and unwanted backups of  &#8216;apache&#8217;  that might have been taken long ago. Also, check for any other duplicate folders that can be removed safely.</p>
<p>6. Remove<strong> core files, </strong>if any . Normally, some core files (like core.1234) might be present in<em> /usr/local/cpanel/whostmgr/docroot</em> . Check for these and remove them.</p>
<p>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;</p>
<p>The <strong>/HOME</strong> partition</p>
<p>1.  Check for unwanted cpmove/tar files for the user accounts in <em>/home</em> and delete them.</p>
<p>2.  Check for any cpmove folders as well in <em>/home</em></p>
<p>3.  Check the folder &#8216;cprestore&#8217;  in <em>/home</em> for any tar files. Be careful. These should  be deleted only if they are very old,say about 4-5 months.</p>
<p>4. Using <em>find</em> command you can check for unwanted tar files(especially cpmove/backup) in the entire home directory. Check their size. If you think that deleting them will  make considerable difference to the disk space then delete them.</p>
<p>5. Check for core files and delete them.</p>
<p>6.  Search for large accounts and see if they are hosting any prohibited content or violating your company policies. If yes, take appropriate measures as per your policies.</p>
<p>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;</p>
<p>The <strong>/VAR</strong> partition</p>
<p>1. Restart the <strong>mysql</strong> service.</p>
<p>2. Log files in <em>/var/log </em>like exim_mainlog, mailmon.log, messages, mysqld.log, mysql_slow_queries.log  can be deleted after taking backups of the required ones..</p>
<p>Note that there is no point in deleting these log files if the size is very small. Check whether deleting these would make any difference.</p>
<p>If you are deleting them then do <strong>re-create</strong> the files, or you can use the command &#8216;echo &#8221; &#8221; &gt; logfile&#8217; to empty the existing files.</p>
<p>3.  Clear Mysql logs like server-name.err or any other  present  in <em>/var/lib/mysql</em></p>
<p>4. Delete mysql-bin.000* file  in <em>/var/lib/mysql</em>, if present.</p>
<p>5. There might be useless large .sql files   in <em>/var/lib/mysql</em> . Delete them.</p>
<p>6.  Remove unwanted emails from spool. You can use the following code to do that :</p>
<blockquote><p>exim -bpc<br />
exim -bpru | grep frozen | awk {&#8216;print $3&#8242;}|xargs exim -Mrm<br />
exim -bpru | grep &#8220;&lt;&gt;&#8221; | awk {&#8216;print $3&#8242;}|xargs exim -Mrm<br />
exim -bpru | grep &#8220;nobody&#8221; | awk {&#8216;print $3&#8242;}|xargs exim -Mrm<br />
exim -bpru|awk {&#8216;print $3&#8242;}|xargs exim -Mrm<br />
exiqgrep -o 86400 -i | xargs exim -Mrm<br />
exim -bpc</p></blockquote>
<p>7. There might be yum cache files inside the <em>/var/cache</em> folder which can take space. To remove them do:<br />
#  yum clear all<br />
#  yum list all</p>
<p>8. Again, search for any core files ( core dump ) like core.12* etc.</p>
<p>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;</p>
<p>The <strong>/BACKUP</strong> partition</p>
<p>1. Remove any tar/cpmove files if they are too old and large.</p>
<p>2. Remove any old  configuration backups ( like apache.bkp) or any log file backup , say 3-4 months old.</p>
<p>3. Check for core files and remove them.</p>
<p>These are some of the general steps that can be followed to deal with space issues on the servers.</p>
<div class="alignright"><div class="g-plusone" data-href="http://www.instacarma.com/blog/technical/tutorial-on-clearing-out-disk-space/" size="standard" count="true"></div></div>]]></content:encoded>
			<wfw:commentRss>http://www.instacarma.com/blog/technical/tutorial-on-clearing-out-disk-space/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>550 postmaster verification failed</title>
		<link>http://www.instacarma.com/blog/technical/550-postmaster-verification-failed/</link>
		<comments>http://www.instacarma.com/blog/technical/550-postmaster-verification-failed/#comments</comments>
		<pubDate>Fri, 22 May 2009 17:56:42 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Quick fixes]]></category>
		<category><![CDATA[Technical]]></category>
		<category><![CDATA[email]]></category>
		<category><![CDATA[exim]]></category>

		<guid isPermaLink="false">http://instacarma.com/blog/?p=300</guid>
		<description><![CDATA[Filed under: email, exim Issue : Sometimes when trying to send emails , the following error shows up : &#8220;550 postmaster verification failed&#8221; This is one way of verifying that the sending server is in fact the real sender and not relaying and also the email is being sent by a genuine source. Fix : [...]]]></description>
			<content:encoded><![CDATA[<p>Filed under: <a href='http://www.instacarma.com/blog/tag/email/'>email</a>, <a href='http://www.instacarma.com/blog/tag/exim/'>exim</a></p>
<p><strong>Issue :</strong></p>
<p>Sometimes when trying to send emails , the following error shows up :</p>
<p>&#8220;550 postmaster verification failed&#8221;</p>
<p>This is one way of verifying that the sending server is in fact the real sender and not relaying and also the email is being sent by a genuine source.</p>
<p><strong>Fix : </strong></p>
<p>Create a mailbox named postmaster@senderdomain.tld on the domain which is sending emails.<br />
This should fix it.</p>
<p>Some mail server admins are now implementing this. If someone has any other suggestion on this then do post it here.</p>
<div class="alignright"><div class="g-plusone" data-href="http://www.instacarma.com/blog/technical/550-postmaster-verification-failed/" size="standard" count="true"></div></div>]]></content:encoded>
			<wfw:commentRss>http://www.instacarma.com/blog/technical/550-postmaster-verification-failed/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Exim mail relay from an IP without authentication</title>
		<link>http://www.instacarma.com/blog/technical/exim-mail-relay-from-an-ip-without-authentication/</link>
		<comments>http://www.instacarma.com/blog/technical/exim-mail-relay-from-an-ip-without-authentication/#comments</comments>
		<pubDate>Tue, 12 May 2009 18:18:59 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Quick fixes]]></category>
		<category><![CDATA[Technical]]></category>
		<category><![CDATA[exim]]></category>

		<guid isPermaLink="false">http://instacarma.com/blog/?p=238</guid>
		<description><![CDATA[Filed under: exim If you have IP addresses which should always be able to relay mail without having to authenticate first ,all you have to do is: create the file /etc/alwaysrelay and add the IP addresses . For example: vi  /etc/alwaysrelay Add the IPs, 192.168.0.1 10.10.10.98 Then, restart exim (/etc/init.d/exim restart or &#8216;service exim restart&#8217;) [...]]]></description>
			<content:encoded><![CDATA[<p>Filed under: <a href='http://www.instacarma.com/blog/tag/exim/'>exim</a></p>
<p>If you have IP addresses which should always be able to relay mail without having to authenticate first ,all you have to do is:</p>
<p><em> create the file <strong>/etc/alwaysrelay</strong> and add the IP addresses .</em></p>
<p>For example:</p>
<blockquote><p>vi  /etc/alwaysrelay</p></blockquote>
<p>Add the IPs,</p>
<p>192.168.0.1<br />
10.10.10.98</p>
<p>Then, restart exim (/etc/init.d/exim restart or &#8216;service exim restart&#8217;)</p>
<p>After this either restart <em>antirelayd</em> or wait for a little while and it will automatically include these IPs in /etc/relayhosts</p>
<div class="alignright"><div class="g-plusone" data-href="http://www.instacarma.com/blog/technical/exim-mail-relay-from-an-ip-without-authentication/" size="standard" count="true"></div></div>]]></content:encoded>
			<wfw:commentRss>http://www.instacarma.com/blog/technical/exim-mail-relay-from-an-ip-without-authentication/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Exim ACL Ratelimit database not available</title>
		<link>http://www.instacarma.com/blog/technical/exim-acl-ratelimit-database-not-available/</link>
		<comments>http://www.instacarma.com/blog/technical/exim-acl-ratelimit-database-not-available/#comments</comments>
		<pubDate>Thu, 30 Apr 2009 18:21:29 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Quick fixes]]></category>
		<category><![CDATA[Technical]]></category>
		<category><![CDATA[exim]]></category>

		<guid isPermaLink="false">http://instacarma.com/blog/?p=103</guid>
		<description><![CDATA[Filed under: exim Issue : Sometimes you may find that you are unable to send mails and will find the following lines in your exim mainlog: 2009-04-05 19:08:41 H=[xx.xx.xx.xx] temporarily rejected connection in ?connect? ACL: ratelimit database not available Cause : The exim cache database might be corrupted. Fix : You need to delete the [...]]]></description>
			<content:encoded><![CDATA[<p>Filed under: <a href='http://www.instacarma.com/blog/tag/exim/'>exim</a></p>
<p><strong>Issue :</strong></p>
<p>Sometimes you may find that you are unable to send mails and will find the following lines in your exim mainlog:<br />
2009-04-05 19:08:41 H=[xx.xx.xx.xx] temporarily rejected connection in ?connect? ACL: ratelimit database not available</p>
<p><strong>Cause :</strong></p>
<p>The exim cache database might be corrupted.</p>
<p><strong>Fix : </strong></p>
<p>You need to delete the following files :<br />
/var/spool/exim/db/ratelimit?<br />
/var/spool/exim/db/ratelimit.lockfile?<br />
/var/spool/exim/db/retry?<br />
/var/spool/exim/db/retry.lockfile?<br />
/var/spool/exim/db/wait-dk_remote_smtp?<br />
/var/spool/exim/db/wait-dk_remote_smtp.lockfile?<br />
/var/spool/exim/db/wait-remote_smtp?<br />
/var/spool/exim/db/wait-remote_smtp.lockfile?<br />
You can do as follows :<br />
rm -fv /var/spool/exim/db/*</p>
<p>and then restart exim :<br />
service exim restart</p>
<div class="alignright"><div class="g-plusone" data-href="http://www.instacarma.com/blog/technical/exim-acl-ratelimit-database-not-available/" size="standard" count="true"></div></div>]]></content:encoded>
			<wfw:commentRss>http://www.instacarma.com/blog/technical/exim-acl-ratelimit-database-not-available/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Free BSD : Shared object &#8220;libperl.so&#8221; not found</title>
		<link>http://www.instacarma.com/blog/technical/free-bsd-shared-object-libperlso-not-found/</link>
		<comments>http://www.instacarma.com/blog/technical/free-bsd-shared-object-libperlso-not-found/#comments</comments>
		<pubDate>Tue, 28 Apr 2009 18:17:29 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Quick fixes]]></category>
		<category><![CDATA[Technical]]></category>
		<category><![CDATA[exim]]></category>
		<category><![CDATA[FreeBSD]]></category>

		<guid isPermaLink="false">http://instacarma.com/blog/technical/101/</guid>
		<description><![CDATA[Filed under: exim, FreeBSD Issue : On a FreeBSD server with cpanel as the control panel, if mail is not working &#38; you get the following error on restarting exim server28# /scripts/restartsrv_exim /libexec/ld-elf.so.1: Shared object &#8220;libperl.so&#8221; not found, required by &#8220;exim&#8221; /libexec/ld-elf.so.1: Shared object &#8220;libperl.so&#8221; not found, required by &#8220;exim&#8221; server28# Cause : This error [...]]]></description>
			<content:encoded><![CDATA[<p>Filed under: <a href='http://www.instacarma.com/blog/tag/exim/'>exim</a>, <a href='http://www.instacarma.com/blog/tag/freebsd/'>FreeBSD</a></p>
<p><strong>Issue :</strong></p>
<p>On a FreeBSD server with cpanel as the control panel, if mail is not working &amp; you get the following error on restarting exim</p>
<p>server28# /scripts/restartsrv_exim<br />
/libexec/ld-elf.so.1: Shared object &#8220;libperl.so&#8221; not found, required by &#8220;exim&#8221;<br />
/libexec/ld-elf.so.1: Shared object &#8220;libperl.so&#8221; not found, required by &#8220;exim&#8221;<br />
server28#</p>
<p><strong>Cause : </strong></p>
<p>This error may be caused by a recent cPanel upgrade (upcp).</p>
<p><strong>Fix :</strong></p>
<p>Reinstalling exim did not fix the issue. In one particular case, this was resolved by reinstalling exim from FreeBSD ports.</p>
<p>This problem can be fixed by running the following command :</p>
<p>/usr/local/bin/perl-after-upgrade -f</p>
<p>If this does not fix the issue then try</p>
<p>ln -s /usr/local/cpanel/perl/libperl.so /usr/local/lib</p>
<div class="alignright"><div class="g-plusone" data-href="http://www.instacarma.com/blog/technical/free-bsd-shared-object-libperlso-not-found/" size="standard" count="true"></div></div>]]></content:encoded>
			<wfw:commentRss>http://www.instacarma.com/blog/technical/free-bsd-shared-object-libperlso-not-found/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Closing Open Relay in Exim</title>
		<link>http://www.instacarma.com/blog/technical/closing-open-relay-in-exim/</link>
		<comments>http://www.instacarma.com/blog/technical/closing-open-relay-in-exim/#comments</comments>
		<pubDate>Wed, 15 Apr 2009 14:05:17 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Quick fixes]]></category>
		<category><![CDATA[Technical]]></category>
		<category><![CDATA[exim]]></category>

		<guid isPermaLink="false">http://instacarma.com/blog/?p=224</guid>
		<description><![CDATA[Filed under: exim To close the open relay run: /scripts/fixrelayd /etc/rc.d/init.d/antirelayd restart service exim restart If that doesn&#8217;t work then edit /etc/exim.conf, you should see in line 61 (or close if somebody changed the default configuration) the definition of which hosts are allowed relaying : hostlist relay_from_hosts = 127.0.0.1:192.168.10.0/24 These values will allow localhost and [...]]]></description>
			<content:encoded><![CDATA[<p>Filed under: <a href='http://www.instacarma.com/blog/tag/exim/'>exim</a></p>
<p>To close the open relay run:</p>
<blockquote><p>/scripts/fixrelayd<br />
/etc/rc.d/init.d/antirelayd restart<br />
service exim restart</p></blockquote>
<p>If that doesn&#8217;t work then</p>
<p>edit /etc/exim.conf, you should see in line 61 (or close if somebody<br />
changed the default configuration) the definition of which hosts are<br />
allowed relaying :</p>
<p>hostlist relay_from_hosts = 127.0.0.1:192.168.10.0/24</p>
<p>These values will allow localhost and few ips.<br />
Nothing else. Adjust the values according to the requirement.</p>
<p>OR</p>
<p>hostlist relay_from_hosts = 127.0.0.1</p>
<p>This will allow only localhost to have open relay.</p>
<p>That&#8217;s all you need to do to change to avoid open relay.</p>
<p>For checking whether it is open relayed do use any one of the following links :-</p>
<p>http://www.rbl.jp/svcheck.php</p>
<p>http://www.checkor.com/</p>
<div class="alignright"><div class="g-plusone" data-href="http://www.instacarma.com/blog/technical/closing-open-relay-in-exim/" size="standard" count="true"></div></div>]]></content:encoded>
			<wfw:commentRss>http://www.instacarma.com/blog/technical/closing-open-relay-in-exim/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Clamav : error while loading shared libraries</title>
		<link>http://www.instacarma.com/blog/technical/clamav-error-while-loading-shared-libraries/</link>
		<comments>http://www.instacarma.com/blog/technical/clamav-error-while-loading-shared-libraries/#comments</comments>
		<pubDate>Sat, 04 Apr 2009 18:47:42 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Quick fixes]]></category>
		<category><![CDATA[Technical]]></category>
		<category><![CDATA[clamav]]></category>
		<category><![CDATA[exim]]></category>

		<guid isPermaLink="false">http://instacarma.com/blog/?p=217</guid>
		<description><![CDATA[Filed under: clamav, exim Issue: After installing clamav on a server, it was showing up the error ”/usr/sbin/clamd: error while loading shared libraries: libiconv.so.2: cannot open shared object file: No such file or directory” while running clamscan. Fix: Find the path of  libiconv.so whereis libiconv.so libiconv: /usr/local/lib/libiconv.so /usr/local/lib/libiconv.la Then to check for the shared library [...]]]></description>
			<content:encoded><![CDATA[<p>Filed under: <a href='http://www.instacarma.com/blog/tag/clamav/'>clamav</a>, <a href='http://www.instacarma.com/blog/tag/exim/'>exim</a></p>
<p><strong>Issue:</strong></p>
<p>After installing clamav on a server, it was showing up the error ”/usr/sbin/clamd: error while loading shared libraries: libiconv.so.2: cannot open shared object file: No such file or directory” while running clamscan.</p>
<p><strong>Fix:</strong></p>
<p>Find the path of  libiconv.so</p>
<p>whereis libiconv.so<br />
libiconv: /usr/local/lib/libiconv.so /usr/local/lib/libiconv.la</p>
<p>Then to check for the shared library dependencies of exim &amp; clamd,</p>
<p>ldd /usr/sbin/exim &amp; ldd /usr/sbin/clamd where I noticed that the library path ”/usr/local/lib” was not included.</p>
<p>For rectifying this,include the path /usr/local/lib in ld.so.conf, then run ldconfig which should create/refresh links to the shared libraries mentioned in ld.so.conf</p>
<p>And also add the following  entry</p>
<p>LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib in the exim startup file (this is not needed though , if the previous step works)</p>
<p>This should fix it!</p>
<div id="OriginalPost" class="message">
<div class="formatted_text_body"></div>
</div>
<div class="alignright"><div class="g-plusone" data-href="http://www.instacarma.com/blog/technical/clamav-error-while-loading-shared-libraries/" size="standard" count="true"></div></div>]]></content:encoded>
			<wfw:commentRss>http://www.instacarma.com/blog/technical/clamav-error-while-loading-shared-libraries/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

