Views on the basic usage of maildrop

Source: Internet
Author: User
Tags qmail
Article Title: Views on the basic usage of maildrop. Linux is a technology channel of the IT lab in China. Includes basic categories such as desktop applications, Linux system management, kernel research, embedded systems, and open source.
Recently, I have seen some people in the forum specifically ask about maildrop usage, and I am also very concerned about Email filtering. I will write out some of my thoughts on using maildrop. in fact, I also found it from the use of sqwebmail or wmail (this is also the reason why I used to reply to it all for you to install wmail or sqwebmail ), so it only involves a little basic usage of maildrop, and I hope it will be helpful to you.
  
Install maildrop first. This is very simple. Download it first.
  
Http://class.868cn.com/download/maildrop-1.5.2.20030423.tar.gz
  
Decompress the package and enter the directory.
  
./Configure
  
Make
  
Make install
  
Generally, you can install qmail and vpopmail successfully. After the installation is successful, a maildrop file will be generated in the/usr/local/bin directory, which is used for filtering.
  
I still assume that wangxu.com is a virtual domain, and the wangxu@wangxu.com is one of the users. Below are some filtering rules for the messages received by the wangxu@wangxu.com.
  
Enter the user's email directory
  
Cd/home/vpopmail/domains/wangxu.com/wangxu
  
Create a. qmail file.
  
Vi. qmail
  
Content:
  
Code:
  
|/Usr/local/bin/maildrop./. mailfilter
  
Note: attributes of the. qmail File
  
Chmod 600. qmail
  
Chown vpopmail: vchkpw. qmail
  
Create a. mailfilter file.
  
Vi. mailfilter
  
Content:
  
Code:
  
# Op: contains
  
# Header: FROM
  
# Value: test@test.com
  
# Folder: * The recipient rejects your email
  
# From:
  
# PlainString
  
# Name: filter the sender's letters containing the test@test.com
  
If (/^ FROM:. * test \ @ test \. com /))
  
{
  
Echo "recipient rejects your email"
  
EXITCODE = 77
  
Exit
  
}
  
# Op: contains
  
# Header: FROM
  
# Value: test@test.com
  
# Folder:. Trash
  
# From:
  
# PlainString
  
# Name: Save the sender's letter containing the test@test.com in the bin
  
If (/^ FROM:. * test \ @ test \. com /))
  
{
  
To "./Maildir/. Trash /."
  
}
  
To "./Maildir /."
  
Where ## is followed by a comment, you can ignore it.
  
If (/^ FROM:. * test \ @ test \. com /))
  
{
  
Echo "recipient rejects your email"
  
EXITCODE = 77
  
Exit
  
}
  
This section indicates that the sender's address contains a test@test.com to refuse to accept, and reply to the sender a rejection letter, the content of the Reason "recipient rejected your mail ". EXITCODE = 77 can also be used without being added (you can also use it to filter emails in the entire domain. You can think about it yourself)
  
If (/^ FROM:. * test \ @ test \. com /))
  
{
  
To "./Maildir/. Trash /."
  
}
  
This section indicates that the sender's address containing the test@test.com is automatically transferred to the garbage bin.
  
Note the last sentence to "./Maildir /."
  
It indicates that the mail is normally sent to the mailbox of the wangxu@wangxu.com when it does not comply with the filter rules mentioned above.
  
This sentence must exist, otherwise it will not receive the letter.
  
Note that the attributes of. mailfilter are the same as those of. qmail.
  
Chmod 600. mailfilter
  
Chown vpopmail: vchkpw. mailfilter
  
Send a test letter.
  
Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.