<?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>Control WebPanel Wiki &#187; mail</title>
	<atom:link href="https://wiki.centos-webpanel.com/tag/mail/feed" rel="self" type="application/rss+xml" />
	<link>https://wiki.centos-webpanel.com</link>
	<description>CentOS WebPanel Wiki</description>
	<lastBuildDate>Wed, 12 Feb 2025 20:38:16 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=4.1.1</generator>
	<item>
		<title>Postfix Mail Server commands</title>
		<link>https://wiki.centos-webpanel.com/postfix-mail-server-commands</link>
		<comments>https://wiki.centos-webpanel.com/postfix-mail-server-commands#comments</comments>
		<pubDate>Mon, 23 Feb 2015 16:42:51 +0000</pubDate>
		<dc:creator><![CDATA[publisher]]></dc:creator>
				<category><![CDATA[E-Mail]]></category>
		<category><![CDATA[mail]]></category>
		<category><![CDATA[postfix]]></category>

		<guid isPermaLink="false">http://wiki.centos-webpanel.com/?p=10</guid>
		<description><![CDATA[Video instructions for MailServer Stats Some useful postfix commands //postqueue -p is the same as mailq List mail queue and MAIL_ID's, list mail queue postqueue -p mailq Reload config service postfix reload Restart postfix server service postfix restart View the postfix version postconf mail_version Show default postfix values postconf -d Show non default postfix values [&#8230;]]]></description>
				<content:encoded><![CDATA[<p><strong>Video instructions for MailServer Stats</strong></p>
<p><object width="700" height="425"><param name="movie" value="https://www.youtube.com/v/n-bzuhn-2n0?version=3&amp;showinfo=0&amp;theme=light&amp;fs=1&amp;rel=0&amp;iv_load_policy=3&amp;modestbranding=1"></param><param name="allowScriptAccess" value="always"></param><param name="allowFullScreen" value="true"></param><embed src="https://www.youtube.com/v/n-bzuhn-2n0?version=3&amp;showinfo=0&amp;theme=light&amp;fs=1&amp;rel=0&amp;iv_load_policy=3&amp;modestbranding=1" type="application/x-shockwave-flash" allowScriptAccess="always" allowfullscreen="true" width="700" height="425"></embed></object></p>
<p><strong>Some useful postfix commands</strong></p>
<p>//<strong>postqueue -p</strong> is the same as <strong>mailq</strong><br />
List mail queue and MAIL_ID's, list mail queue<br />
<code>postqueue -p<br />
mailq</code>  </p>
<p>Reload config<br />
<code>service postfix reload</code></p>
<p>Restart postfix server<br />
<code>service postfix restart</code></p>
<p>View the postfix version<br />
<code>postconf  mail_version</code></p>
<p>Show default postfix values<br />
<code>postconf -d</code></p>
<p>Show non default postfix values<br />
<code>postconf -n</code></p>
<p>Flush mail queue<br />
<code>postfix  flush</code></p>
<p>Process the queue now<br />
<code>postqueue -f</code></p>
<p>Process all emails stuck in the queue<br />
<code>postsuper -r ALL &#038;& postqueue -f</code></p>
<p>Read email from mail queue<br />
<code>postcat -q MAIL_ID</code></p>
<p>To remove MAIL_ID mail from the queue<br />
<code>postsuper -d MAIL_ID</code></p>
<p>To remove all mail from the queue<br />
<code>postsuper -d ALL</code></p>
<p>To remove all from mail queue FAST<br />
<code>find /var/spool/postfix/deferred/ -type f | xargs -n1 basename | xargs -n1 postsuper -d</code></p>
<p>To remove all mails in the deferred queue<br />
<code>postsuper -d ALL deferred</code></p>
<p>Sort and count emails by "from address"<br />
<code>postqueue -p | awk '/^[0-9,A-F]/ {print $7}' | sort | uniq -c | sort -n</code></p>
<p>Removing all emails sent by: mailto:user@adminlogs.info<br />
<code>postqueue -p|grep '^[A-Z0-9]'|grep user@adminlogs.info|cut -f1 -d' '|tr -d \*|postsuper -d -</code></p>
<p>Remove all email sent from user@admin.info<br />
<code>postqueue -p|awk '/^[0-9,A-F].*user@admin.info / {print $1}'|cut -d '!' -f 1|postsuper -d -</code></p>
<p>Remove all email sent by domain adminlogs.info<br />
<code>postqueue -p | grep '^[A-Z0-9]'|grep @adminlogs.info|cut -f1 -d' ' |tr -d \*|postsuper -d -</code></p>
<p>Mail queue stats short<br />
<code>postqueue -p | tail -n 1</code></p>
<p>Number of emails in Mail queue<br />
<code>postqueue -p | grep -c "^[A-Z0-9]"</code></p>
<p>Fast count of emails in mail queue<br />
<code>find /var/spool/postfix/deferred -type f | wc -l</code></p>
<p>Watch Log Live<br />
<code>tail -f /var/log/maillog</code></p>
<p>Count and sort success pop3/imap logins</p>
<pre>grep "\-login"  /var/log/dovecot-info.log |grep "Login:"|awk {'print $7'}|sort|uniq -c|sort -n</pre>
<p>Count and sort success SMTP postfix logins (useful for tracking spammer)</p>
<pre>grep -i "sasl_username"  /var/log/maillog |awk {'print $9'}|sort|uniq -c|sort -n</pre>
<p>Count and sort success SMTP postfix logins on exact date "Jun 18"</p>
<pre>grep -i "sasl_username"  /var/log/maillog |grep "Jun 18"|awk {'print $9'}|sort|uniq -c|sort -n</pre>
<p><strong>Analyze Postfix Logs</strong></p>
<pre>pflogsumm /var/log/maillog | less</pre>
<p><em>** If you don't have pflogsumm then you can install this rpm package "postfix-perl-scripts".</em></p>
]]></content:encoded>
			<wfw:commentRss>https://wiki.centos-webpanel.com/postfix-mail-server-commands/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
