Tuesday, December 25, 2007

Exim divide incoming and outgoing mail

If you want route all incoming mail to pipe for example php file and route all outgoing mail to remote smtp.
edit your exim.conf file
In routers configurations block insert it:
------------------
begin routers
# Remote addresses are those with a domain that does not match any item# in the "local_domains" setting above.
# This router routes to remote hosts over SMTP using a DNS lookup. Any domain# that resolves to an IP address on the loopback interface (127.0.0.0/8) is# treated as if it had no DNS entry.
manualroute: driver = manualroute# condition = ${if or{{eq{$sender_host_address}{127.0.0.1}} {eq{$sender_host_address}{NULL}}}{yes}{no}}# condition = ${if eq{$sender_host_address}{127.0.0.1}{1}{0}}condition = ${if match_ip{$sender_host_address}{:127.0.0.1}}route_list = !+local_domains mxout.qos.net.il transport = remote_smtp no_more

lookuphost: driver = dnslookup domains = ! +local_domains ignore_target_hosts = 127.0.0.0/8 condition = "${perl{check_limits}}"# transport = remote_smtp transport = mypipe_smtp no_more

--------------------------
In transports Configurations block insert:

--------------------------
begin transports
mypipe_smtp: driver = pipe command = "/usr/local/bin/php /tmp/1.php" use_bsmtp = true user = mail group = mail

Sunday, December 23, 2007

timed out while receiving the initial server greeting

If you use postfix running on Linux and If you try to telnet the above host on port 25, the connection is made but the remote mail server doesn't send its 220 message upon connection.

for resolving it:
echo 0 > /proc/sys/net/ipv4/tcp_window_scaling

Sunday, December 16, 2007

Setting Linux Time

Setting Linux Time

Programs for working with time and date are:
clock - This is a soft link to hwclock.
date(1) - Print or set the system date and time.
hwclock(8) - Sets the hardware clock based on values entered on the command line.
setclock(8) - Sets the BIOS hardware clock based on the time and setup of the system clock.
timeconfig(8) - A program used to configure the system configuration file "/etc/sysconfig/clock" which includes the type of clock and timezone.

commands:

rdate -s tick.greyware.com
/sbin/hwclock --systohc

How can I use TCPDUMP to determine the top talker on my network?

tcpdump -tnn -c 20000 -i eth0 | awk -F "." '{print $1"."$2"."$3"."$4}' | sort | uniq -c | sort -nr | awk ' $1 > 100 '

Remove DSPAM signature from massage body

dspam_admin ch pref default signatureLocation headers

How to install cron (crond, crontab)

yum install vixie-cron crontabs
/sbin/chkconfig crond on
/sbin/service crond start

http://www.redhat.com/docs/manuals/enterprise/RHEL-4-Manual/sysadmin-guide/ch-autotasks.html#S1-AUTOTASKS-CRON

set default editor for crontab
export EDITOR=/usr/bin/nano