<?xml version="1.0" encoding="UTF-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<title>Sysadmin Blog</title>
	<link href="https://www.cyberbyte.ch/blog/atom.php" rel="self" />
	<link href="https://www.cyberbyte.ch/blog/" />
	<id>https://www.cyberbyte.ch/blog/index.php</id>
	<updated>2026-04-29T01:39:30Z</updated>
	<author>
		<name>info@cyberbyte.ch</name>
		<email>info@cyberbyte.ch</email>
	</author>
	<entry>
		<title>Postfix Mail Queue Cleaner</title>
		<link href="https://www.cyberbyte.ch/blog/index.php?entry=entry140414-121759" />
		<link rel="alternate" type="text/html" href="https://www.cyberbyte.ch/blog/index.php?entry=entry140414-121759" />
		<link rel="edit" href="https://www.cyberbyte.ch/blog/index.php?entry=entry140414-121759" />
		<id>https://www.cyberbyte.ch/blog/index.php?entry=entry140414-121759</id>
		<summary type="html"><![CDATA[This small shell script removes all messages originating from a certain sender address out of the postfix mail queue.<br /><br /><pre><br />#! /bin/bash<br />if [ &quot;$1&quot; == &quot;&quot; ]; then<br />  echo &quot;please give e-mail address&quot;<br />  exit 1<br />else<br />  emailaddr=$1<br />fi<br />for id in `mailq | egrep &quot;[0-9A-F]{10} &quot; | grep &quot;$emailaddr&quot; | cut -d &quot; &quot; -f 1`<br />do<br />  echo $id<br />  postsuper -d $id<br />done<br /><br /></pre>]]></summary>
		<updated>2014-04-14T10:17:59Z</updated>
	</entry>
	<entry>
		<title>Detect and block abuse of (cracked) e-mail account</title>
		<link href="https://www.cyberbyte.ch/blog/index.php?entry=entry140228-104539" />
		<link rel="alternate" type="text/html" href="https://www.cyberbyte.ch/blog/index.php?entry=entry140228-104539" />
		<link rel="edit" href="https://www.cyberbyte.ch/blog/index.php?entry=entry140228-104539" />
		<id>https://www.cyberbyte.ch/blog/index.php?entry=entry140228-104539</id>
		<summary type="html"><![CDATA[To avoid bad things(TM) caused by a cracked e-mail account on our postfix mailserver, I used the script <a href="http://sourceforge.net/projects/checkauthlog/files/check_auth_log-2.0.0.tgz/download?use_mirror=switch" >Check Auth Log</a> to detect abnormal high numbers of logins or logins from many different IP addresses within a certain time onto a certain account. Then the script will lock out the account. This, together with per-session limits within postfix configuration (smtpd_client_message_rate_limit, smtpd_client_recipient_rate_limit), should help to avoid or at least mitigate the damage caused by cracked accounts, i.e. SMTP server being blacklisted.<br />]]></summary>
		<updated>2014-02-28T09:45:39Z</updated>
	</entry>
	<entry>
		<title>Postfix Mail Queue Manager</title>
		<link href="https://www.cyberbyte.ch/blog/index.php?entry=entry120929-000000" />
		<link rel="alternate" type="text/html" href="https://www.cyberbyte.ch/blog/index.php?entry=entry120929-000000" />
		<link rel="edit" href="https://www.cyberbyte.ch/blog/index.php?entry=entry120929-000000" />
		<id>https://www.cyberbyte.ch/blog/index.php?entry=entry120929-000000</id>
		<summary type="html"><![CDATA[<h2>Description</h2><br />This PHP script shows the content of the mail queues of multiple servers and give you the possibility to hold, release, delete and reqeue single messages. <br /><br />If you install a tiny wrapper script on mail servers, you may even remove or requeue multiple messages from a certain sender.<br /><br />In addition, you can also requeue all messages (<code>sendmail -q</code>).<br /><br /><h2>Download</h2><br />Download the <a href="http://www.cyberbyte.ch/Linux/mail/mailqmgr.tar.gz" >gzip&#039;ped tar archive</a><br /><br /><h2>Prerequisites:</h2><br />On a web- or intranet accessible host (access protection highly recommended!):<br />- Web Server with PHP script language support (<code>shell_exec</code> function has to be enabled)<br />- Key-based SSH access to mail servers for webserver user<br /><br />On mail servers:<br />- Postfix<br />- sudo<br /><br /><h2>Installation</h2><br />    Unpack the archive beneath a webserver document root<br /><br />    Adapt the variables $mailservers and $user to your needs, if you like to use the selection by sender e-mail address feature, configure also variable $wrapper_cmd<br /><br />    Add the following lines to <code>/etc/sudoers</code> on the mail server(s), assuming user <code>admin</code> for login to the mail server(s) (change it to your needs):<br /><br /><pre>admin    ALL=(ALL) NOPASSWD: /usr/sbin/postsuper<br />admin    ALL=(ALL) NOPASSWD: /usr/sbin/postqueue<br />admin    ALL=(ALL) NOPASSWD: /usr/local/bin/mailqueue.sh</pre>(last line only needed for selection by sender address)<br /><br />    If you want to use the selection by e-mail address feature, put mailqueue.sh to some path on the mail server(s) and make it executable, e.g.:<br /><pre>cp mailqueue.sh /usr/local/bin/mailqueue.sh<br />chmod 755 /usr/local/bin/mailqueue.sh</pre><br />    Try it out using <code>http://yourwebserver/mailqmgr/index.php</code>]]></summary>
		<updated>2012-09-28T22:00:00Z</updated>
	</entry>
</feed>
