– exchange: Tôi được biết EX có chưc năng backup trên server maịl Nếu user không check chức năng “leave a copy of message on this server” Vậy chức năng backup mail có còn ý nghĩa không khi mail sau khi load về lập tức được xóa trên server? Tôi ko rỏ lắm Bạn nào biết giải thích dùm nha? – Mdeamon: Hình như ko có chức năng backup trên server. Có thể copy thư mục lưu mail lại nhưng không tiện lắm. Nếu user không check chức năng “leave a copy of message on this server” thì trên server mail chẳng còn gì để backụp. Vậy muốn lưu mail lại phải vào từng máy user rồi . Cách nào hay hơn không? + Đọc mail lưu động: – Exchange: 1 user có thể đến bất kỳ máy nào trong mạng, login account của mình để đọc mail . Các user này được quãn lí bởi Active Directory. – Mdeamon: Không load được những mail da load rồi . Nếu check chức năng “leave a copy of this message on this server” thì tấc cả các mail trên server được load về . mail nào được đọc rồi và chưa từ PC khác không biết Nói túm lại: Exchange server quản lý mail tập trung trên server. Mdeamon làm trung gian để chuyển mail . Sau đó, việc quản lý là của user. Đúng hay sai ? các bạn có ykiêsn gì ko? Re: Nếu bạn là admin thì bạn toàn quyền quyết định việc cho phép hay không cho phép giữ lại một bản sao của email trên server hoặc là forward tới địa chỉ email của admin. User nếu có quyền thì quyền này không thể nào overide các quyền của admin được. Nếu bạn đã chọn quyền giữ lại một bản sao ở server thì nhất định nó sẽ giữ lại. Chức năng backup mail mà bạn nói ở đây không đúng nghĩa, dễ nhầm lẫn với việc backup mail server. Đối với exchange server, nếu bạn lỡ xóa account của một user nào đó bạn vẫn có thể lấy lại được tất cả các mail mà không hề sao. Theo mình thì việc dùng chương trình nào cũng đều giống nhau cả, các chương trình mail ấy phải integrate được với Active Directory thì mail server mới làm việc. Vì đối với Mdaemon hay Exchange gì nó đều phải sử dụng các thông tin của user để giải quyết vấn đề địa chỉ mà các thông tin này thuộc quyền quản lý của Active Directory… Cho nên nếu có khác có lẽ là thêm hoặc bớt đi vài option trong mỗi chương trình mà thôi. Thông thường nếu không yêu cầu thì phần lớn các admin không bao giờ giữ lại một copy trên server, chỉ một vài nhân viên quan trọng như manager hay giám đốc thì có thể sẽ nên giữ lại các copy email của xếp, còn phần lớn nó sẽ tự forward tới các user local computer, như vậy nó tránh trường hợp mail server sẽ bị overload bởi các email… Chưa kế là các thư rác gởi tới các user trong công ty… Nếu mỗi user đều giữ lại một bản sao thì chỉ cần vài tuần lễ là mail server của bạn sẽ gặp rắc rối… Vấn đề bạn login từ computer khác thì exchange hay Mdaemon đều làm việc giống nhau, bạn đều có thể xem mail nếu bạn cho phép nó giữ một bản sao trên server. Exim là một SMTP Server tốt, tuy nhiên đôi lúc bạn cũng phải thao tác để quản lý hàng đợi (Queue) trong trường hợp các user gởi quá nhiều email, hoặc bị Spam làm tắc nghẽn.
Nếu bị nghẽn thì có thể tham khảo cách xử lý theo hướng dẫn. Server bạn đột nhiên chậm ,kiểm tra service monitor thì thấy process exim rất nhiều. Bạn click vào Mail queue administrator như hình 1 : và nhận được thông báo lỗi như sau : Với các hiện tượng như trên bạn có thể kết luận là email server của mình đang gửi spam mail và chiếm tài nguyên server làm server chậm .Cách giải quyết như thế nào ? Bạn ssh vào server với root thông qua ct ssh bất kì vd : putty . chạy lệnh sau đến khi hoàn tất : 1
2
3
4 Nếu có thông báo lỗi trong quá trình chạy vd như hình : vậy là quá trình xóa không xóa được hết email spam ,bạn cần chạy lệnh sau ,nó sẽ mở 1 giao diện graphic dạng total commander bạn vào các thư mục var -> spool -> exim hay chạy lệnh cd /var/spool/exim .Bạn sẽ thấy thư mục input (thư mục chứa mail tạm gởi đi). Chọn thư mục Input và Nhấn F8 và xóa hết các file bên trong thư mục input Hoàn tất , restart exim và đừng quên vào lại Mail queue administrator trong 2222 để kiểm tra xem email nào đang spam và xử lý nhé. Spam mail là một trong những vấn đề cần lưu tâm khi bạn monitor server. Spam mail gây ra tình trạng nghẽn cpu , network và làm full ổ server của bạn. Trong bài viết này mình sẽ hướng dẫn các bạn cấu hình server sử dụng cPanel để theo dõi , hạn chế một phần spam mail.
2. Theo dõi nguồn gốc của các mail gửi từ máy chủ của bạn bằng việc add X-source hearders : 3. Để việc xem log trong exim được dễ dàng các bạn thêm 2 thông số sau trong file config exim :
II. Giới thiệu: – Nhu cầu liên lạc bằng thư điện tử ngày nay đang ngày càng phổ biến,nó góp phần không nhỏ trong việc hoạt động kinh doanh hiệu quả của các cty và doanh nghiệp. – Chính vì vậy nên hầu hết các cty hoặc doanh nghiệp hiện nay đều có hệ thống Mail riêng.Phổ biến hiện nay người ta dùng các phần mềm quản lý mail như : Exchange server, Mdeamon, Lotus Domino… – Bài viết sau đây hướng dẫn bạn cấu hình gởi và nhận mail từ Internet sử dụng phần mềm Kerio Mail Server. III. Chuẩn bị: Mô hình bài lab: – 1 PC sử dụng hệ điều hành Windows Server 2008 – 1 PC sử dụng hệ điều hành Windows Vista. Các bước chuẩn bị: – Máy Server đã nâng cấp Domain Controller. – Tạo User: u1,u2 /P@ssword – Download Source cài đặt Mail Kerio. – Máy Client Join Domain. Bài Lab gồm 2 phần :
IV. Thực hiện : 1. Cài đặt và cấu hình cho việc gởi nhận mail nội bộ. Logon Domain Admin trên máy Windows Server 2008. Mở Source cài đặt,chạy file kerio-kms-6.5.2-642.. Hộp thoại Choose Setup Language, chọn OK. Hộp thoại Welcome to the InstallShield Wizard… Chọn Next. Hộp thoại What’s New chọn Next. Hộp thoại License Agreement , Chọn I accept the term…, Chọn Next. Hộp thoại Setup Type , Chọn Complete , chọn Next. Hộp thoại Destination Folder , Chọn Next. Hộp thoại Ready to Install th Program , Chọn Install. Quá trình cài đặt diễn ra. Hộp thoại Welcome Chọn Next. Hộp thoại Mail Domain nhập vào nhatnghe.biz , Chọn Next. Hộp thoại administrative Account : Nhập vào Password Admin (6 kí tự). Hộp thoại Message Store Directory ,Chọn Finish. Hộp thoại Finish Chọn Close Sau khi cài xong chọn Finish. 2. Cấu hình gởi mail nội bộ:
Chọn Start > Programs > Kerio > Administration Console. Nhập vào Password Admin , Chọn Connect. Mở cấu hình theo đường dẫn Configuration,Chọn vào Domain, kiểm tra lại Primary Domain là nhatnghe.biz Mở Domain Settings, Chọn vào Users, Chọn Add… Hộp thoại Add User: Login name : u1 Password : P@ssword Confirm password : P@ssword Chọn Finish. Kiểm tra đã tạo thành công MailBox cho User U1. Tương tự tạo MailBox cho User U2 , sau đó chọn Apply để lưu cấu hình.
Client Logon User u1. Chọn Start > Program > Windows Mail: Hộp thoại Your Name , Khung Display name : u1 , chọn Next. Hộp thoại Internet E-mail Address Hộp thoại Set up e-mail server type : Incoming mail : IP Server Outgoing e-mail : IP Server Chọn Next. Hộp thoại Internet Mail Logon, nhập vào thông số Password : P@ssword Chọn Next. Hộp thoại Congratulation , Chọn Finish. Sau khi cấu hình xong,chọn Menu Tools > Accounts. Qua Tab Servers , đánh dấu chọn vào ô: My server requires authentication chọn OK. Chọn vào Create Mail để gởi mail. Subject : Test mail Nội dung : Goi mail noi bo. Chọn Send để gởi mail. Chọn Send/Recive để nhận mail. Kiểm tra nhận mail do chính u1 gởi. User U2 Logon kiểm tra mail: Chọn Start > Program > Windows Mail . Cấu hình tương tự như u1. Kiểm tra đã nhận mail từ u1.
Đăng kí tài khoản mail trên Server mail yahoo Việi Nam (hỗ trợ POP) Logon tài khoản này chọn vào Link Các lựa chọn Chọn vào Link Truy cập POP và Chuyển Tiếp. Mở chức năng Truy cập qua Web và POP (Thông số thiết lap POP) Chọn Lưu lại.
Logon Domain admin trên máy Server Chọn vào Configuration , chọn POP3 Download , chọn Add.. Điền vào các thông số: POP3 server : pop.mail.yahoo.com.vn POP3 username : nha.tohoang Password : ********* Khung Preferred header : Received Đánh dấu chọn vào Drop duplicate messages Chọn OK. Qua TAB Sorting Rules , chọn Add… Điề vào các thông số Chọn OK. Kiểm tra đã tạo thành công Sorting Rule , chọn Apply.
Logon vào tài khoản mail internet gởi mail cho u1,u2. Client Logon User U1, mở Windows Mail nhận mail.
Theo đường dẫn Configuration , chọn SMTP Server ,đánh dấu chọn vào: – Users from IP address group : Local clients – User authenticated through SMTP for outgoing mail. Qua TAB SMTP Delivery chọn Use relay SMTP server Relay server hostname : mail.webdoanhnghiep.org Relay server port : 25 Đánh dấu chọn vào Relay server requires authentication Password : ******** Authentication : SMTP AUTH Command Cấu hình xong chọn Apply để lưu cấu hình. Logon User U2 mở Windows Mail gởi mail ra Internet kiểm tra: Logon hộp mail internet kiểm tra: Chúc các bạn thành công !!! Answer: How do I delete thousands of e-mail messages with cPanel or Horde’s webmail interface? If you run a website, you may find out one day that you have a mail account containing thousands of messages — or possibly even hundreds of thousands. The most common reason this happens is because the default e-mail account is set up as a “catch-all” address. This will direct all e-mail sent to invalid usernames at your domain to the default Inbox. Because spammers send out spammessages to invalid e-mail addresses all the time, the number of e-mails received by the default mailbox can grow by thousands of messages each day. The best solution to this problem is to prevent it. If you have a Web server that is running cPanel, you can turn off the “catch-all” address by selecting the “Default Address” panel within the Mail section of the cPanel interface. Then choose the option that says “Discard with error to sender (at SMTP time).” This will bounce all invalid e-mails back to the sender and will keep the messages from piling up in your default mailbox. Over time, this can help save a lot of hard disk space on your server. Of course, if you’re like me, you caught this problem after thousands of messages had already filled your default e-mail account’s Inbox. In my case it was over 500,000 messages. I realized that deleting these messages one page at a time via the Horde webmail interface would take awhile (as in several days). So I figured there must be some easier way to delete the messages. Fortunately, after doing some research, I found that there is indeed a simple way to remove all the messages in the Inbox. Just follow these basic steps:
Depending on how many messages are stored in your Inbox, this operation may take a few seconds to several minutes to complete. The only catch is that if the mailbox contains too many messages, the operation will time out and will not empty the mailbox. This is what happened to me with my 500,000+ messages. If this is also your situation, you may have to delete the message folders manually. To do this, you will first need to navigate to the mail folder, which is located in the following directory: /home/username/mail/ (where “username” is the username for the mail account) The two folders you’ll need to delete are the cur and new folders, which contain the messages. You may be able to do this with an SSH or SFTP program, though I also had problems with this method timing out. If you know some basic Unix commands, you can use a terminal (command-line) program to manually delete the folders. First navigate to the mail folder, then recursively delete the cur and new directories. The commands to do this are: $ cd /home/username/mail $ rm -rf cur $ rm -rf new Again, even this method may take awhile if the directories are loaded with thousands of mail messages. But it should eventually remove the folders. This command-line method should only be used a last resort, as the maildirsize file will no longer contain the correct information for the mail account. Fortunately, as soon as a new message is received into the empty Inbox, the cur and new folders are automatically recreated and the maildirsize is updated with the correct data. If you have been wondering how to delete a large number of messages stored on your mail sever, I hope this information is helpful and saves you a lot of time. bonus: The directories responsible for a default cPanel email account is “new” and “cur“. You can find it in /home/username/mail/cur and /home/username/mail/new. If you want to remove all the emails for the default email account follow the steps given below: # cd /home/username/mail/cur # rm -rf * # /home/username/mail/new # rm -rf * Even though you have removed all the emails from cur and new folder, the email disk quota in cPanel won’t be changed. This is because the email disk quota is cached in the file “maildirsize“. Either remove the file “maildirsize” or just rename it. That’s it!! Done!!! Note: It is mentioned in the comments that recent versions of cPanel include an Email Archiving feature that stores copies of email on the server for you. If this is what you’re trying to do, this feature is probably the better option. However, if you’re trying to forward copies of outgoing email to other addresses, the instructions in this post are appropriate. A common request we get is how a user can automatically BCC outgoing email to another address. This is most often requested by law firms that need to be able to retain copies of communication. Forwarding incoming email is easy – there’s already a section in cPanel for it. However, if you want to forward outgoing email there’s a small twist. First, go to WHM \> Exim Configuration Editor, then click “Advanced Editor” at the bottom. Don’t make any changes, just click “save”. This should create a file on the server called /etc/exim.conf.local. From command line as root, you’ll need to edit /etc/exim.conf.local and add some options to the @CONFIG@ and @TRANSPORTSTART@ sections. The end result would look like this (plus any edits you may have already made):
5
6
7
8
9 chmod 400 /etc/postfix/sasl_passwd postmap /etc/postfix/sasl_passwd cat /etc/ssl/certs/Thawte_Premium_Server_CA.pem | sudo tee -a /etc/postfix/cacert.pem /etc/init.d/postfix reload 0 chmod 400 /etc/postfix/sasl_passwd postmap /etc/postfix/sasl_passwd cat /etc/ssl/certs/Thawte_Premium_Server_CA.pem | sudo tee -a /etc/postfix/cacert.pem /etc/init.d/postfix reload 1 chmod 400 /etc/postfix/sasl_passwd postmap /etc/postfix/sasl_passwd cat /etc/ssl/certs/Thawte_Premium_Server_CA.pem | sudo tee -a /etc/postfix/cacert.pem /etc/init.d/postfix reload 2 chmod 400 /etc/postfix/sasl_passwd postmap /etc/postfix/sasl_passwd cat /etc/ssl/certs/Thawte_Premium_Server_CA.pem | sudo tee -a /etc/postfix/cacert.pem /etc/init.d/postfix reload 3 chmod 400 /etc/postfix/sasl_passwd postmap /etc/postfix/sasl_passwd cat /etc/ssl/certs/Thawte_Premium_Server_CA.pem | sudo tee -a /etc/postfix/cacert.pem /etc/init.d/postfix reload 4 chmod 400 /etc/postfix/sasl_passwd postmap /etc/postfix/sasl_passwd cat /etc/ssl/certs/Thawte_Premium_Server_CA.pem | sudo tee -a /etc/postfix/cacert.pem /etc/init.d/postfix reload 5 chmod 400 /etc/postfix/sasl_passwd postmap /etc/postfix/sasl_passwd cat /etc/ssl/certs/Thawte_Premium_Server_CA.pem | sudo tee -a /etc/postfix/cacert.pem /etc/init.d/postfix reload 6 chmod 400 /etc/postfix/sasl_passwd postmap /etc/postfix/sasl_passwd cat /etc/ssl/certs/Thawte_Premium_Server_CA.pem | sudo tee -a /etc/postfix/cacert.pem /etc/init.d/postfix reload 7 chmod 400 /etc/postfix/sasl_passwd postmap /etc/postfix/sasl_passwd cat /etc/ssl/certs/Thawte_Premium_Server_CA.pem | sudo tee -a /etc/postfix/cacert.pem /etc/init.d/postfix reload 8 chmod 400 /etc/postfix/sasl_passwd postmap /etc/postfix/sasl_passwd cat /etc/ssl/certs/Thawte_Premium_Server_CA.pem | sudo tee -a /etc/postfix/cacert.pem /etc/init.d/postfix reload 9 Now, make a copy of the existing system filter file to a custom location, so cPanel updates don’t mess with it: cp /etc/cpanel_exim_system_filter /etc/cpanel_exim_system_filter_custom Edit /etc/exim.conf.localopts and change the “systemfilter” option to match our new file: /etc/init.d/postfix reload echo "Test email" | mail -s "Shinken" [email protected]` 0 Now, open /etc/cpanel_exim_system_filter_custom and add the following block of code to the end of the file: /etc/init.d/postfix reload echo "Test email" | mail -s "Shinken" [email protected]` 1 Replace the blue text with the sender domain (or email address) and the email address that outgoing mail should be copied to. Apply these new settings to the exim.conf and restart: /scripts/buildeximconf service exim restart Now when you send email from the email address or domain specified in the filter file, it will be copied to the other email address. Rất nhiều người thuê VPS hoặc máy chủ vật lý không có (hoặc rất ít) kiển thức quản lý máy chủ. Họ chỉ quản trị dựa vào các Control Panel như Cpanel hay DirectAdmin, hoặc sự hỗ trợ của kỹ thuật của các nhà cung cấp dịch vụ. Bài viết này cung cấp một số cách tìm kiếm một user trong vps spam mail chạy DirectAdmin hoặc Exim. Nhận biết:
Nguyên nhân:
Cách xác định: # exim -bpc // số lượng mail queue. Nếu lượng mail queue > 100 mail thì chắc chắn vps của bạn đang spam ra ngoài. # exim -bp / danh sách mail trong mail queue. Tại đây bạn sẽ thấy user nào đang spam ra ngoài. Bạn cũng có thể kiểm tra log bằng lệnh: # cd/var/log/exim # tail -n 100 mainlog |more hoặc tail -n 10000 mainlog |grep [email protected] |more // lệnh này sẽ liệt kê log theo user được truy vấn Để xem nội dung mail dùng lệnh sau: # exim -Mvh [id] // id dạng 1VwdCb-0001ze-5c Xoá một mail đang nằm trong Queue: # exim -Mrm {message-id} Xoá toàn bộ email đang có trong Queue: # exim -bp | awk ‘{ print $3 }’ | xargs exim -Mrm Gửi toàn bộ email đang có trong Queue: # /usr/sbin/exim -bp |awk ‘{print $3}’ | xargs -n 1 -P 40 /usr/sbin/exim -v -M Tìm nguồn spam Giả sử rằng sau một loạt câu lệnh trên bạn đã tìm được user nào đang spam. Việc làm đầu tiên là bạn nên suspend tài khoản đó để tạm dừng việc spam. Sau đó bạn vào source code của user đó: # cd /home/username/domains/example.com/public_html Cách tốt nhất là bạn download source code về máy dùng các trình antivirus để quét. Đừng quên backup lại một bản vì có thể khi quét sẽ mất file làm hỏng source. Thường thì các file mã độc này sẽ được mã hóa. Tuy nhiên bạn có thể tìm nhanh bằng câu lệnh sau: # find . -name ‘*.php’ | while read FILE; do if grep ‘eval(base64_decode’ “$FILE”; then echo “$FILE” >> filemadoc; fi ; done hoặc # find . -name ‘*.php’ | while read FILE; do if grep ‘eval(base64_decode’ “$FILE”; then echo “$FILE”; fi ; done As title, I encounter the problem when I send email to my mailing list with attachment file. There are 2 cases, 1. attachment < 60KB \>> every one can receive the email. 2. attachment > 60KB \>> no one receive the email. Does any one have the same experience? Any solution? If you’re not a systems administrator then you should be asking your hosting company this question. if you are a systems administrator with shell access: What’s the output of the following command while logged in through the shell: grep message_size_limit /etc/exim.conf ?? Also, this time as root: grep maxlength /etc/vitual/example.com/majordomo/lists/listname.conf where listname is the name of your list and example.com is the name of the domain. In both these cases the number must be large enough for the attachment after it’s encoded. Yều cầu : Người dùng Windows Server 2008 trên này có cài một cái máy ảo trên Workstasion dùng làm Mail server(ZimBra). Người dùng yêu cầu Nat Port vào con Mail và VPN. Các bạn download tại đây Tại Shinken host:Cài đặt các gói cần thiết: /etc/init.d/postfix reload echo "Test email" | mail -s "Shinken" [email protected]` 2 Sau đó postfix sẽ yêu cầu khai báo một số thông số, ta chọn Internet Site và điền một domain như mail.shinken.vdc Sửa file cấu hình postfix: /etc/init.d/postfix reload echo "Test email" | mail -s "Shinken" [email protected]` 3 Thêm/sửa các dòng như sau:
Sau đó thêm vào dòng sau:
Với USERNAME là username của tài khoản gmail dùng để gửi mail, PASSWORD là mật khẩu của tài khoản đó. chmod 400 /etc/postfix/sasl_passwd postmap /etc/postfix/sasl_passwd cat /etc/ssl/certs/Thawte_Premium_Server_CA.pem | sudo tee -a /etc/postfix/cacert.pem /etc/init.d/postfix reload Để kiểm tra xem các bước cài đặt đã đúng chưa ta có thể sử dụng lệnh sau để gửi thử một email, đăng nhập vào trình duyện kiểm tra mục thư đã gửi để xem thư đã được gửi đi chưa. /etc/init.d/postfix reload echo "Test email" | mail -s "Shinken" [email protected]` Để kiểm tra và sửa lỗi ta có thể sử dụng lệnh /etc/init.d/postfix reload echo "Test email" | mail -s "Shinken" [email protected]` 4 để xem trạng thái của các mail trong hàng đợi, hoặc là xem log của postfix để sửa lỗi. /etc/init.d/postfix reload echo "Test email" | mail -s "Shinken" [email protected]` 5 Một lỗi có thể gặp phải đó là tài khoản gmail được khai báo bên trên có thể sử dụng cơ chế đăng nhập hai nhân tố hoặc mức cao nên có thể postfix không gửi mail được mặc dù cấu hình đúng. Để khắc phục điều này ta có thể tắt các chức năng này đi hoặc tạo một tài khoản mới mà không sử dụng các chức năng này. |