<?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>clearing mail queue &#8211; Tekbyte</title>
	<atom:link href="https://www.tekbyte.net/tag/clearing-mail-queue/feed/" rel="self" type="application/rss+xml" />
	<link>https://www.tekbyte.net</link>
	<description>Learn a lot, one byte at a time.</description>
	<lastBuildDate>Fri, 15 Jul 2022 20:41:43 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.9.4</generator>

<image>
	<url>https://www.tekbyte.net/wp-content/uploads/2020/08/cropped-favicon-1-1-150x150.png</url>
	<title>clearing mail queue &#8211; Tekbyte</title>
	<link>https://www.tekbyte.net</link>
	<width>32</width>
	<height>32</height>
</image> 
	<item>
		<title>System Administration Tips: Exim &#038; Mail Queues</title>
		<link>https://www.tekbyte.net/system-administration-tips-exim-mail-queues/</link>
					<comments>https://www.tekbyte.net/system-administration-tips-exim-mail-queues/#respond</comments>
		
		<dc:creator><![CDATA[Berk D.]]></dc:creator>
		<pubDate>Fri, 15 Jul 2022 20:41:43 +0000</pubDate>
				<category><![CDATA[all]]></category>
		<category><![CDATA[cpanel and wordpress]]></category>
		<category><![CDATA[tutorials]]></category>
		<category><![CDATA[clearing mail queue]]></category>
		<category><![CDATA[cpanel]]></category>
		<category><![CDATA[cpanel exim queues]]></category>
		<category><![CDATA[email queue]]></category>
		<category><![CDATA[exim]]></category>
		<category><![CDATA[mail queue]]></category>
		<category><![CDATA[whm]]></category>
		<guid isPermaLink="false">https://www.tekbyte.net/?p=576</guid>

					<description><![CDATA[In this short article, I will be sharing some useful commands I have come to use over the years with...]]></description>
										<content:encoded><![CDATA[
<p>In this short article, I will be sharing some useful commands I have come to use over the years with cPanel/WHM servers. These commands are especially useful if you are planning to monitor email queues and ensure that no one is compromised and/or isn&#8217;t spamming. </p>



<h1 class="wp-block-heading">Viewing the number of emails</h1>



<p>To view the number of emails in the queue, run this command:</p>



<pre class="wp-block-code"><code>exim -bpc</code></pre>



<p>To view all the emails (this is useful for the next few sections), run these commands:</p>



<pre class="wp-block-code"><code>exim -bp
exim -bp | exiqsumm</code></pre>



<h1 class="wp-block-heading">Checking emails (e.g. login failures, for spamming content, etc.)</h1>



<p>The best way to find out if an account is secure and to also identify if the password has been changed is to refer to these commands:</p>



<pre class="wp-block-code"><code>grep test@mydomain.tld /var/log/maillog | grep fail</code></pre>



<p>This will filter through the “/var/log/maillog” to see if there are any failures. This is also useful for checking to see if the customer is using the correct credentials.</p>



<h1 class="wp-block-heading">Removing emails from the queues</h1>



<p>If you have identified the source of the spamming account/domain, you can then use the following commands to clear out the emails.</p>



<pre class="wp-block-code"><code>exiqgrep -i -f EMAIL_ACCOUNT | xargs exim -Mrm
exiqgrep -i -r EMAIL_ACCOUNT | xargs exim -Mrm</code></pre>



<p>The <code>-f</code> flag indicates the “from” address and the <code>-r</code> flag indicates the “recipient” address.</p>



<h1 class="wp-block-heading">Pushing/releasing frozen/queued up emails</h1>



<p>First clear out the spam (i.e. identify the spam, if any, and suspend/inform + remove emails from the queue).</p>



<p>Once done, the best way to get this going is to SSH into the server and create a screen so you can run the EXIM email release command in the background. Here is what it will look like:</p>



<pre class="wp-block-code"><code>ssh my.server.tld -4
screen -S exim
exim -qf -v</code></pre>



<p>Then you can exit the screen (CTRL+A,D) and let it do its magic.</p>



<hr class="wp-block-separator has-alpha-channel-opacity"/>



<p>These commands have helped me in my cPanel/WHM system administration tasks and I hope it helps you too. <img src="https://s.w.org/images/core/emoji/17.0.2/72x72/1f642.png" alt="🙂" class="wp-smiley" style="height: 1em; max-height: 1em;" /> </p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.tekbyte.net/system-administration-tips-exim-mail-queues/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
	</channel>
</rss>
