Postfix Mail Queue Cleaner 
Monday, 14 April 2014, 12:17 - Tools & more, Knowledge, Postfix Stuff
Posted by Administrator
This small shell script removes all messages originating from a certain sender address out of the postfix mail queue.

#! /bin/bash
if [ "$1" == "" ]; then
echo "please give e-mail address"
exit 1
for id in `mailq | egrep "[0-9A-F]{10} " | grep "$emailaddr" | cut -d " " -f 1`
echo $id
postsuper -d $id

add comment ( 467 views )   |  permalink   |  $star_image$star_image$star_image$star_image$star_image ( 3 / 562 )
DNS Tools 
Tuesday, 22 October 2013, 23:00 - Tools & more
Posted by Administrator
Web Interface for DNS Queries.


Download the tarball


The "dig" tool must be installed on your system, and be allowed to be executed from php. If it doesn't work, e.g. if using safe_mode and/or open_basedir restrictions, add the path where dig is located to the two php options:
open_basedir /usr/bin/dig
safe_mode_exec_dir /usr/bin/
Within a VirtualHost, set with php_admin_value <option>.

In addition, TCP port 43 and UDP port 53 need to be open outbound.


Extract the content of the archive within your web root of the webserver, e.g.
cd <webroot>
tar xvzf dnstools.tar.gz


Navigate your web-browser to http://<your_host_name>/dnstools/ and enter either the appropriate form.

add comment ( 2995 views )   |  permalink   |  $star_image$star_image$star_image$star_image$star_image ( 3 / 1743 )
QEMU/KVM Virtual Host Manager 
Saturday, 29 September 2012, 21:11 - Tools & more, QEMU/KVM Stuff
Posted by Administrator


This tiny script shows you a overview of the virtual machines on QEMU/KVM carrier servers using libvirt as management interface.

It can either show all virtual machines or only the running VMs.


This PHP Script requires PHP extension libvirt-php


Download the gzip'ped tar archive


Unpack the archive to a webserver document root with direct access to your libvirt hypervisors over TCP Port 16509 or SSH

Adapt at least the variables $dnsdomain and $arr_hosts to your infrastructure and change $comtype to "qemu+ssh" when SSH instead of direct port access is wanted

Try it out using http://yourwebserver/virtmgr/index.php

add comment ( 332 views )   |  permalink   |  $star_image$star_image$star_image$star_image$star_image ( 3.1 / 567 )
Postfix Mail Queue Manager 
Saturday, 29 September 2012, 00:00 - Tools & more, Postfix Stuff, Mail stuff
Posted by Administrator


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.

If you install a tiny wrapper script on mail servers, you may even remove or requeue multiple messages from a certain sender.

In addition, you can also requeue all messages (sendmail -q).


Download the gzip'ped tar archive


On a web- or intranet accessible host (access protection highly recommended!):
- Web Server with PHP script language support (shell_exec function has to be enabled)
- Key-based SSH access to mail servers for webserver user

On mail servers:
- Postfix
- sudo


Unpack the archive beneath a webserver document root

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

Add the following lines to /etc/sudoers on the mail server(s), assuming user admin for login to the mail server(s) (change it to your needs):

admin    ALL=(ALL) NOPASSWD: /usr/sbin/postsuper
admin ALL=(ALL) NOPASSWD: /usr/sbin/postqueue
admin ALL=(ALL) NOPASSWD: /usr/local/bin/
(last line only needed for selection by sender address)

If you want to use the selection by e-mail address feature, put to some path on the mail server(s) and make it executable, e.g.:
cp /usr/local/bin/
chmod 755 /usr/local/bin/

Try it out using http://yourwebserver/mailqmgr/index.php
add comment ( 12551 views )   |  permalink   |  related link   |  $star_image$star_image$star_image$star_image$star_image ( 3 / 3571 )
Remove Apache VirtualHost section 
Tuesday, 17 July 2012, 00:00 - Tools & more, Apache Stuff
Posted by Administrator
This small perl script removes a VirtualHost configuration section

Call with: <webname> <apache conf file>

<webname> is to be replaced with the FQDN of the name based virtual host (ServerName)

<apache conf file> is the full path to the apache configuration file that contains the VirtualHost
add comment ( 10362 views )   |  permalink   |  $star_image$star_image$star_image$star_image$star_image ( 3 / 1070 )

| 1 | 2 | Next> Last>>