Hướng dẫn giới hạn data quota trong mdaemon webmail login năm 2024

– 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.

  • Hiển thị danh sách các email đang nằm trong Mail Queue: exim -bp
  • 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 '/^ *[0-9]+[mhd]/{print "exim -Mrm " $3}' | bash
  • 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
  • Chỉ xem danh sách các email nào đang ở trạng thái Frozen: exim -bpr | grep frozen | wc -l
  • Xóa toàn bộ email ở trạng thái Frozen: exim -bpr | grep frozen | awk {'print $3'} | xargs exim -Mrm

    hoặc

    [smtp.gmail.com]:587 [email protected]:PASSWORD

    0
  • Chỉ xóa những email trạng thái Frozen đã hơn 1 ngày:

    [smtp.gmail.com]:587 [email protected]:PASSWORD

    1

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 :

Hướng dẫn giới hạn data quota trong mdaemon webmail login năm 2024

và nhận được thông báo lỗi như sau :

Hướng dẫn giới hạn data quota trong mdaemon webmail login năm 2024

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

[smtp.gmail.com]:587    [email protected]:PASSWORD

2

[smtp.gmail.com]:587    [email protected]:PASSWORD

3

[smtp.gmail.com]:587    [email protected]:PASSWORD

4

Nếu có thông báo lỗi trong quá trình chạy vd như hình :

Hướng dẫn giới hạn data quota trong mdaemon webmail login năm 2024

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).

Hướng dẫn giới hạn data quota trong mdaemon webmail login năm 2024

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

Hướng dẫn giới hạn data quota trong mdaemon webmail login năm 2024

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.

  1. Ngăn user ” nobody ” có thế sử dụng script gửi mail từ server của bạn bằng cách bật suExec và phpSuExec .
  2. Bật suExec :

Hướng dẫn giới hạn data quota trong mdaemon webmail login năm 2024

Hướng dẫn giới hạn data quota trong mdaemon webmail login năm 2024

  • Bật phpSuExec :

Hướng dẫn giới hạn data quota trong mdaemon webmail login năm 2024

Hướng dẫn giới hạn data quota trong mdaemon webmail login năm 2024

Hướng dẫn giới hạn data quota trong mdaemon webmail login năm 2024

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 :

Hướng dẫn giới hạn data quota trong mdaemon webmail login năm 2024

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 :

Hướng dẫn giới hạn data quota trong mdaemon webmail login năm 2024

  1. Mô hình:

Hướng dẫn giới hạn data quota trong mdaemon webmail login năm 2024

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 :

  1. Cài đặt và cấu hình cho việc gởi nhận mail nội bộ.
  2. Cấu hình hệ thống mail cho việc gởi nhận từ Internet.

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ướng dẫn giới hạn data quota trong mdaemon webmail login năm 2024

Hộp thoại Choose Setup Language, chọn OK.

Hướng dẫn giới hạn data quota trong mdaemon webmail login năm 2024

Hướng dẫn giới hạn data quota trong mdaemon webmail login năm 2024

Hộp thoại Welcome to the InstallShield Wizard… Chọn Next.

Hướng dẫn giới hạn data quota trong mdaemon webmail login năm 2024

Hộp thoại What’s New chọn Next.

Hướng dẫn giới hạn data quota trong mdaemon webmail login năm 2024

Hộp thoại License Agreement , Chọn I accept the term…, Chọn Next.

Hướng dẫn giới hạn data quota trong mdaemon webmail login năm 2024

Hộp thoại Setup Type , Chọn Complete , chọn Next.

Hướng dẫn giới hạn data quota trong mdaemon webmail login năm 2024

Hộp thoại Destination Folder , Chọn Next.

Hướng dẫn giới hạn data quota trong mdaemon webmail login năm 2024

Hộp thoại Ready to Install th Program , Chọn Install.

Hướng dẫn giới hạn data quota trong mdaemon webmail login năm 2024

Quá trình cài đặt diễn ra.

Hướng dẫn giới hạn data quota trong mdaemon webmail login năm 2024

Hộp thoại Welcome Chọn Next.

Hướng dẫn giới hạn data quota trong mdaemon webmail login năm 2024

Hộp thoại Mail Domain nhập vào nhatnghe.biz , Chọn Next.

Hướng dẫn giới hạn data quota trong mdaemon webmail login năm 2024

Hộp thoại administrative Account : Nhập vào Password Admin (6 kí tự).

Hướng dẫn giới hạn data quota trong mdaemon webmail login năm 2024

Hộp thoại Message Store Directory ,Chọn Finish.

Hướng dẫn giới hạn data quota trong mdaemon webmail login năm 2024

Hộp thoại Finish Chọn Close

Hướng dẫn giới hạn data quota trong mdaemon webmail login năm 2024

Sau khi cài xong chọn Finish.

Hướng dẫn giới hạn data quota trong mdaemon webmail login năm 2024

2. Cấu hình gởi mail nội bộ:

  1. Tạo MailBox cho User:

Chọn Start > Programs > Kerio > Administration Console.

Nhập vào Password Admin , Chọn Connect.

Hướng dẫn giới hạn data quota trong mdaemon webmail login năm 2024

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

Hướng dẫn giới hạn data quota trong mdaemon webmail login năm 2024

Mở Domain Settings, Chọn vào Users, Chọn Add…

Hướng dẫn giới hạn data quota trong mdaemon webmail login năm 2024

Hộp thoại Add User:

Login name : u1

Password : P@ssword

Confirm password : P@ssword

Chọn Finish.

Hướng dẫn giới hạn data quota trong mdaemon webmail login năm 2024

Kiểm tra đã tạo thành công MailBox cho User U1.

Hướng dẫn giới hạn data quota trong mdaemon webmail login năm 2024

Tương tự tạo MailBox cho User U2 , sau đó chọn Apply để lưu cấu hình.

Hướng dẫn giới hạn data quota trong mdaemon webmail login năm 2024

  1. Kiểm tra việc gởi nhận mail nội bộ:

Client Logon User u1.

Chọn Start > Program > Windows Mail:

Hộp thoại Your Name , Khung Display name : u1 , chọn Next.

Hướng dẫn giới hạn data quota trong mdaemon webmail login năm 2024

Hộp thoại Internet E-mail Address

Hướng dẫn giới hạn data quota trong mdaemon webmail login năm 2024

Hộp thoại Set up e-mail server type :

Incoming mail : IP Server

Outgoing e-mail : IP Server

Chọn Next.

Hướng dẫn giới hạn data quota trong mdaemon webmail login năm 2024

Hộp thoại Internet Mail Logon, nhập vào thông số

Password : P@ssword

Chọn Next.

Hướng dẫn giới hạn data quota trong mdaemon webmail login năm 2024

Hộp thoại Congratulation , Chọn Finish.

Hướng dẫn giới hạn data quota trong mdaemon webmail login năm 2024

Sau khi cấu hình xong,chọn Menu Tools > Accounts.

Hướng dẫn giới hạn data quota trong mdaemon webmail login năm 2024

Qua Tab Servers , đánh dấu chọn vào ô: My server requires authentication chọn OK.

Hướng dẫn giới hạn data quota trong mdaemon webmail login năm 2024

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.

Hướng dẫn giới hạn data quota trong mdaemon webmail login năm 2024

Chọn Send/Recive để nhận mail. Kiểm tra nhận mail do chính u1 gởi.

Hướng dẫn giới hạn data quota trong mdaemon webmail login năm 2024

User U2 Logon kiểm tra mail:

Chọn Start > Program > Windows Mail . Cấu hình tương tự như u1.

Hướng dẫn giới hạn data quota trong mdaemon webmail login năm 2024

Hướng dẫn giới hạn data quota trong mdaemon webmail login năm 2024

Hướng dẫn giới hạn data quota trong mdaemon webmail login năm 2024

Hướng dẫn giới hạn data quota trong mdaemon webmail login năm 2024

Hướng dẫn giới hạn data quota trong mdaemon webmail login năm 2024

Kiểm tra đã nhận mail từ u1.

Hướng dẫn giới hạn data quota trong mdaemon webmail login năm 2024

  1. Cấu hình hệ thống mail cho việc gởi nhận từ Internet:
  1. Truy cập trang web quản lý Domain chỉnh lại dich vụ mail.

Hướng dẫn giới hạn data quota trong mdaemon webmail login năm 2024

Hướng dẫn giới hạn data quota trong mdaemon webmail login năm 2024

  1. Cấu hình MailBox trung gian để lấy mail về:

Đă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

Hướng dẫn giới hạn data quota trong mdaemon webmail login năm 2024

Chọn vào Link Truy cập POP và Chuyển Tiếp.

Hướng dẫn giới hạn data quota trong mdaemon webmail login năm 2024

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.

Hướng dẫn giới hạn data quota trong mdaemon webmail login năm 2024

  1. Cấu hình MailOffline:

Logon Domain admin trên máy Server

Chọn vào Configuration , chọn POP3 Download , chọn Add..

Hướng dẫn giới hạn data quota trong mdaemon webmail login năm 2024

Đ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.

Hướng dẫn giới hạn data quota trong mdaemon webmail login năm 2024

Qua TAB Sorting Rules , chọn Add…

Hướng dẫn giới hạn data quota trong mdaemon webmail login năm 2024

Điề vào các thông số

Chọn OK.

Hướng dẫn giới hạn data quota trong mdaemon webmail login năm 2024

Kiểm tra đã tạo thành công Sorting Rule , chọn Apply.

Hướng dẫn giới hạn data quota trong mdaemon webmail login năm 2024

  1. Kiểm tra:

Logon vào tài khoản mail internet gởi mail cho u1,u2.

Hướng dẫn giới hạn data quota trong mdaemon webmail login năm 2024

Hướng dẫn giới hạn data quota trong mdaemon webmail login năm 2024

Client Logon User U1, mở Windows Mail nhận mail.

Hướng dẫn giới hạn data quota trong mdaemon webmail login năm 2024

Hướng dẫn giới hạn data quota trong mdaemon webmail login năm 2024

  1. Cấu hình Relay 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.

Hướng dẫn giới hạn data quota trong mdaemon webmail login năm 2024

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.

Hướng dẫn giới hạn data quota trong mdaemon webmail login năm 2024

Logon User U2 mở Windows Mail gởi mail ra Internet kiểm tra:

Hướng dẫn giới hạn data quota trong mdaemon webmail login năm 2024

Hướng dẫn giới hạn data quota trong mdaemon webmail login năm 2024

Logon hộp mail internet kiểm tra:

Hướng dẫn giới hạn data quota trong mdaemon webmail login năm 2024

Hướng dẫn giới hạn data quota trong mdaemon webmail login năm 2024

Hướng dẫn giới hạn data quota trong mdaemon webmail login năm 2024

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:

  1. Log into the Horde Mail system.
  2. Click the “Folders” icon at the top of the window.
  3. Check the box next to “Inbox” or the mailbox that contains the messages you want to delete.
  4. From the “Choose Action:” drop-down menu, select “Empty Folder(s).”
  5. You will be prompted to confirm the action, as it is not undoable.
  6. Click “Empty Selected Folders” to clean out the mailbox.

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):

[smtp.gmail.com]:587    [email protected]:PASSWORD

5

[smtp.gmail.com]:587    [email protected]:PASSWORD

6

[smtp.gmail.com]:587    [email protected]:PASSWORD

7

[smtp.gmail.com]:587    [email protected]:PASSWORD

8

[smtp.gmail.com]:587    [email protected]:PASSWORD

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:

  • VPS của bạn tự nhiên chậm, RAM và CPU tăng cao
  • Email không đến được người nhận
  • DirectAdmin thông báo lượng mail gửi ra nhiều
  • Địa chỉ IP bị Blacklist

Nguyên nhân:

  • Nếu là máy chủ website có thể source code bạn có vấn đề. Hãy chắc chắn rằng các module, plugin, theme là đáng tin cậy.
  • SMTP spam: Có thể tài khoản nào đó bị đánh cắp
  • User chủ động spam mail ra ngoài (Email Marketing)

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.

Hướng dẫn giới hạn data quota trong mdaemon webmail login năm 2024

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:

relayhost = [smtp.gmail.com]:587
smtp_sasl_auth_enable = yes
smtp_sasl_password_maps = hash:/etc/postfix/sasl_passwd
smtp_sasl_security_options = noanonymous
smtp_tls_CAfile = /etc/postfix/cacert.pem
smtp_use_tls = yes
inet_interfaces = all
inet_protocols = ipv4

Sau đó thêm vào dòng sau:

[smtp.gmail.com]:587    [email protected]:PASSWORD

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.