Archive

Archive for the ‘Quick Tips’ Category

postfix delete mail queue by tag, sender, receiver

mailq | grep KEYWORD | awk '{print $1}' | postsuper -d -
Categories: How to ... ?, Quick Tips Tags:

How to install nagios3 on Ubuntu server

apt-get install nagios3 nagios-nrpe-plugin nagios-plugins
dpkg-statoverride --update --add nagios www-data 2710 /var/lib/nagios3/rw
dpkg-statoverride --update --add nagios nagios 751 /var/lib/nagios3

++ Hosts without ping

Categories: How to ... ?, Linux, Quick Tips Tags:

ProFTPd service shuts down automatically

Edit:

/etc/init.d/proftpd

Find this line:

start-stop-daemon --stop --signal $SIGNAL --quiet --pidfile "$PIDFILE"

Change to this:

start-stop-daemon --stop --signal $SIGNAL --retry 1 --quiet --pidfile "$PIDFILE"

copy/paste @ askubuntu

Categories: How to ... ?, Linux, Quick Tips Tags:

IPtables port forwarding

Бързи бележки за 1-2 команди и прансочване на портове 🙂

iptables -t nat -A PREROUTING -p tcp --dport 80 -j REDIRECT --to-port 8080
iptables -t nat --line-numbers -n -L
iptables -t nat -D PREROUTING 2
Categories: How to ... ?, Linux, Quick Tips Tags:

Как да прочетем мейл, който вече е в опашката на postfix

postcat -q MESSAGE_ID

Как да добавим delay в postfix

В /etc/postfix/main.cf добавяме:

 smtp_destination_rate_delay = 1s

След като изпрати 1 мейл, postfix ще направим пауза от 1 секунда и тогава ще изпрати другите.

Categories: Debian, How to ... ?, Linux, Quick Tips Tags:

List all subfolders in path

find . -type d -exec echo mkdir -p {} \;
Categories: How to ... ?, Quick Tips Tags:

MySQL How to select domain name from email address ?

SELECT 
   COUNT(*) as cnt, SUBSTR(SUBSTR(Email, INSTR(Email, '@'), INSTR(Email, '.')), 2) as domain 
FROM 
   Users 
GROUP BY domain 
ORDER BY cnt DESC
Categories: How to ... ?, MySQL, Quick Tips Tags:

lost connection with while performing the HELO handshake

Ако видите този проблем в mailq опашката, най-вероятната грешка е, че нямате set-нат smtp_helo_name.

В /etc/postfix/main.cf добавяме:

smtp_helo_name = full.hostname.tld

Flush/Restart postfix queue

postqueue -f
Categories: How to ... ?, Quick Tips Tags: