Configuration of maildrop under Postfix

Source: Internet
Author: User
The configuration of maildrop under Postfix-Linux Enterprise Application-Linux server application information. The following is a detailed description. The Postfix has been installed and Spamassassin can be used. The problem is how to move the spam emails to the spam folder. I am going to use MAILDROP, my POP software and SMTP authentication both use Courier.

Installing maildrop in ubuntu is very simple. Here we will talk about how to enable Postfix \ Courier \ maildrop to work with each other.

Step 1: configure the main. cf file of Postfix:
Add the following configuration to the main. cf file:
Maildrop_destination_recipient_limit = 1
Mailbox_command = maildrop
Virtual_transport = maildrop (I use virtual mailbox)

Step 2: configure the Postfix master. cf file:
Add or replace the original virtual
Maildrop unix-n--pipe Flags = Fqhu user = vmail args =/usr/bin/maildrop-w 90-d $ {user }@$ {nexthop} $ {recipient} $ {user }$ {nexthop }$ {sender}

The above configuration should be in one line, where user = vmail (: groupname) is a user with the permission to read and write Maildir, args =/usr/bin/maildrop is the position of the maildrop program, -w 90 is used for quota, that is, it reaches 90% of quota, and the incoming email will be defer (postponed). For the following parameters, we recommend that you refer to the postfix documentation.

Step 3: Configure authmysqlrc of Courier
Because it has been basically configured, I only changed the SQL section here
MYSQL_SELECT_CLAUSE SELECT username, password, '', '000000', '000000', CONCAT ('/media/maildisk/mail/', username ), CONCAT ('/media/maildisk/mail/', maildir), CONCAT (quota * 1000000/1048576),'s '), name from mailbox where username =' $ (local_part) @ $ (domain) 'and status = 'acitve'

In the preceding SQL statement, two 3000 values indicate the UID and GID of the virtual user. CONCAT ('/media/maildisk/mail/', username) indicates the HOME Directory of the virtual user, CONCAT ('/media/maildisk/mail/', maildir) indicates Maildir. In fact, it is the same as the former, CONCAT (quota * 1000000/1048576),'s ') because I use postfixadmin to create a mailbox. in postfixadmin, 1 M = 1024*1024 = 1048576, and 1 M = 1000*1000 = 1000000 in maildrop.

Step 4: configure the/etc/maildroprc file of Maildrop
I didn't add the maildrop rule at first, but only allowed him to work. Because of the previous file settings, the maildroprc file here looks like this:

SHELL = "/bin/sh"
DEFAULT = "/$ HOME/" (if the mbox format is used, do not add the following/, the same below)
MAILDIR = "/$ HOME /"

Now all the configurations are ready, and you should be able to work.

Could you test: authtest-s login xxxx@xxxx.com

If you see the things you want (such as HOME, MAILDIR, QUOTA, etc.), it means they are correct. Send a letter to test whether there is an error or warning in maillog maildrop.

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.