Nov
24
2011
0

Configure sendmail to start logging Subject in maillog

919 views

First of all take backup of your "sendmail.mc" and "sendmail.cf" files. Default location for those files is /etc/mail.
Now open "sendmail.mc" in your favourite editor and add following lines in it and save it. I usually prefere to add it at boottom of file so you can easily identify your modifications.

LOCAL_CONFIG
Klog syslog
HSubject: $>+CheckSubject

LOCAL_RULESETS
SCheckSubject
R$* Press TAB Key $: $(log Subject: $1 $) $1

This last line is very crusial. after R$* press tab key as suggested. Then after $: press space key.
After log there is a space key, after Subject: there is a space key after $1 there is a space key. After closing bracket there is a space key before $1.

Now you need to regenerate sendmail.cf file. use m4 macro to do so.

#m4 sendmail.mc > sendmail.cf

Now restart sendmail and you verify your maillog file. You will see Subject line for each mail which is being sent from or relayed from your email server

นำมาจาก http://www.linux4beginners.info/node/Log-Subject-sendmail-maillog

Written by Pipo in: FreeBSD & Linux |
Jan
20
2011
0

rsync without password

899 views

[ mirror ]
สร้าง public key (ไม่ต้องใส่ passphrase)
# ssh-keygen -t dsa

[ source ]
# su เป็น username ที่ config ให้ rsync connect จาก mirror มาได้
Copy id_dsa.pub ไปยัง [ source ]
# mkdir ~/.ssh
# chmod 700 ~/.ssh
# mv id_dsa.pub ~/.ssh
# cd ~/.ssh
# cat id_dsa.pub >> authorized_keys

[ mirror ]
ลบ known_hosts
# rm ~/.ssh/known_hosts

[ mirror ]
ทดสอบ
/usr/local/bin/rsync -avzm --delete --force -e "ssh -i /your_current_user/.ssh/id_dsa" user@source.server.com:/path/to/source/ /path/to/backup/

Written by Pipo in: FreeBSD & Linux |
Jun
21
2010
0

สร้าง htpasswd ด้วย php,perl,ruby

812 views

The crypt() method uses 56-bit DES encryption, which is used in /etc/passwd and htpasswd.
(more...)

Written by Pipo in: FreeBSD & Linux |
Mar
22
2010
0

make install FORCE_PKG_REGISTER=yes

1,986 views

make install FORCE_PKG_REGISTER=yes

Written by Pipo in: FreeBSD & Linux |
Sep
04
2009
0

ติดตั้ง vsftpd + ssl

1,684 views

vsftpd ก็คือ FTP (Daemon) Server อีกตัวหนึ่งนั่นเองมี feature ดีๆ หลายอย่างไปอ่านกันเองครับ ที่นี่
การติดตั้งบน FreeBSD นั้นง่ายมากๆ
(more...)

Written by Pipo in: FreeBSD & Linux | Tags: , , ,
Aug
20
2009
0

Mount UFS (FreeBSD) Partition

5,692 views

sudo mount -r -t ufs -o ufstype=ufs2 /dev/sda1/ /mnt

Written by Pipo in: FreeBSD & Linux | Tags: , ,
Page 1 of 3123

Powered by WordPress | Aeros Theme | TheBuckmaker.com WordPress Themes