Mailq Check

<pre class=”brush:shell”>#!/bin/sh

fila_post=`postqueue -p |grep -e “^[A-Z,0-9]” | grep -v “Mail” |wc -l`

if [ $fila_post -gt $warn ]; then
if [ $fila_post -le $crit ]; then
echo “WARNING: postqueue -p -> $fila_post”
exit 1
if [ $fila_post -gt $crit ]; then
echo “CRITICAL: postqueue -p > $fila_post”
exit 2
if [ $fila_post -le $warn ]; then

echo “OK: postqueue -p -> $fila_post”
exit 0
<div style=”clear: both;”></div>

<div class=”pages_navigation”>


Tips and Tricks from Pesho

mount -t msdosfs -o large,-M=755 /dev/da0s1 temp/
tr -d \r < dosfile > newfile ===premahva bad charovete ot dos file
tr -d ‘”‘ <filename >newfilename — premahva ”
while IFS= read -r file; do rm — “$file”; done < filelist
sed ‘/define hostgroup/{N;N;N;d;}’ $i>$ && mv $ $i — namira i iztriva 3 reda sled tova 🙂
root@Microknoppix:~# ssh pstankov@hosting dd if=/dev/sdb2 |dd of=/dev/sda2
mailq |grep -i 0-|cut -f 1 -d “*”|postsuper -d –
dns hitrini za load balance
check and repair all tables
mysqlcheck –all-databases -u root -p
mdconfig -a -t vnode -f /usr/space/work/proxmox-ve_1.9-6542-7.iso -u 1
[root@darksun ~]# mount -t cd9660 /dev/md1 /mnt/temp/
import -window root screenshot1.png – printscreena
find . -name ‘spam-*’ | xargs rm

pw lock vivek
pw unlock vivek
karmic ubuntu


ipfw + fail2ban – FreeBSD

Fail2ban + ipfw = Джилязо

Вери много важно – f2b на freebsd има бъг с името на затворите, ако има “-” в името примерно ssh-ipfw, не работи :), затова sshipfw, да ти е мирна главицата!

Install fail2ban on freebsd

cd /usr/ports/security/py-fail2ban
make install clean
echo ‘fail2ban_enable=”YES”‘ >> /etc/rc.conf

Create table in ipfw for F2B

ipfw table 10 add
ipfw add 1 deny ip from table(10) to me

Must create action for ipfw in f2b action.d/ipfw.con to know how to deal with the spammers

actionban = ipfw table 10 add
actionunban = ipfw table 10 delete

jail.conf setting

ignoreip =
bantime = 35600

enabled = true
filter = ipfw-ssh
action = ipfw-ssh[localhost=]
logpath = /var/log/auth.log
maxretry = 3

enabled = true
filter = postfix
action = mail[localhost=]
sendmail-whois[name=”Postfix jail”,]
logpath = /var/log/maillog
maxretry = 4

enabled = true
filter = dovecot
action = mail[localhost=]
sendmail-whois[name=”Dovecot mail jail”,]
logpath = /var/log/maillog
maxretry = 4