Thứ Hai, 22 tháng 9, 2014

Nghẽn mail trên kloxo

Nghẽn mail trên kloxo

Đăng nhập vào quản lý host kloxo, chọn menu Web - Mail - Database => Mail Queue =>  để xem những mail gửi đi spam -> click vào chi tiết để xem email spam -> disable host spam, sau đó ssh vào chạy những lệnh bên dưới để xóa mail bị nghẽn. nếu vào Mail Queue bị treo thỉ cũng phải xóa những lệnh bên dưới.

ssh vào server gõ lệnh sau:

 /var/qmail/bin/qmail-qstat  nhấn enter sẽ hiện thị như sau:


Output looks like

messages in queue: 567154
messages in queue but not yet preprocessed: 3

Xóa:

qmailctl stop
find /var/qmail/queue/mess -type f -exec rm {} \;
find /var/qmail/queue/info -type f -exec rm {} \;
find /var/qmail/queue/local -type f -exec rm {} \;
find /var/qmail/queue/intd -type f -exec rm {} \;
find /var/qmail/queue/todo -type f -exec rm {} \;
find /var/qmail/queue/remote -type f -exec rm {} \;
qmailctl start

Disable local mail (Kloxo )

Để tránh IP server bị ảnh hưởng như nghẽn mail, IP bị các tổ chức chống spam mail quốc tế liệt IP vào blacklist, chúng tôi cần tạm ngưng dịch vụ mail client spam mail


1 - Vào 7778 -> mục client -> phần qmail -> Remote mail -> set Remote

2 - SSH server Xóa domain trong file virtualdomains (nếu còn)

/var/qmail/control/virtualdomains

Ngoài ra nếu bạn dùng mail server nơi khác vd mail gmail và gửi đi không được vì hệ thống lầm lẫn với mail local. Bạn cũng có thể dùng cách trên để khắc phục.

Chúc bạn thành công.
Read More

Thứ Sáu, 5 tháng 9, 2014

Set File Attributes In Linux Using Chattr Command

 Set File Attributes In Linux Using Chattr Command

Chattr is a command used to set / unset file attributes in Linux.
Using chattr it is possible to make a file immutable. That is, even a root user will be prohibited from deleting the file.
To prevent anyone - even a root user - from deleting a file, you set the immutable bit of the file using the chattr command as follows -

# chattr +i filename

The immutable bit option +i can only be set by the root user. So either you should have root priviledges or you need to use sudo to execute the command.
Once the +i bit is set, even root user won't be able to delete or tamper with the file.

To unset the immutable flag -

# chattr -i filename

chattr can be used to set/unset many more file attributes.

For example, if you want to allow everybody to just append data to a file and not change already entered data, you can set the append bit as follows:

# chattr +a filename


Now the filename can only be opened in append mode for writing data. You can unset the append attribute as follows:

# chattr -a filename


To know more about chattr command, check its man page. 
Read More