Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to install Postfix under Linux and use maildrop to deliver mail

2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/01 Report--

This article mainly introduces how to install Postfix under Linux to use maildrop to deliver mail, which has a certain reference value, interested friends can refer to, I hope you can learn a lot after reading this article, let the editor take you to know about it.

Postfix delivers mail using maildrop

Maildrop is a local mail delivery agent (MDA) that supports filtering (/ etc/maildroprc), delivery, and disk quota (Quota) functions.

Maildrop is a mail delivery agent with filtering function written in C++ to replace the local MDA. It is one of the components of the courier mail system. It accepts information from standard input and delivers it to the user's mailbox; maildrop can deliver messages to either mailboxes or maildirs mailboxes. At the same time, maildrop can read inbound mail filtering instructions from the file and decide whether to send the message to the user's mailbox or forward it to another address. Unlike procmail, maildrop uses a structured filtering language, so mail system administrators can develop their own filtering rules and apply them.

Here we will use maildrop to replace the MDA that comes with postfix, and use this as a basis to extend the invocation of the following anti-virus and anti-spam functions. If Maildrop is installed as a RPM package, vuser users and vgroup user groups are automatically created for mail storage; using source code installation, users and user groups need to be created manually, and the ID is greater than 1000, that is, the user vmail (1001) and group vmail (1001) created above.

Dependent courier-authlib headers and library files

Link courier-authlib header files and library files to the / usr directory (when compiling maildrop, you will look for these related files in this directory)

[root@localhost ~] # ln-sv / usr/local/courier-authlib/bin/courierauthconfig / usr/bin [root@localhost ~] # ln-sv / usr/local/courier-authlib/include/* / usr/include/ [root@localhost ~] # echo "/ usr/local/courier-authlib/lib/courier-authlib" > > / etc/ld.so.conf.d/courier-authlib.conf [root@localhost ~] # ldconfig-v to solve dependent pcreheader files and library files

Maildrop needs the support of pcre, so you need to provide pcre header files, library files and other development components in advance. If you choose to provide pcre as a yum source, make sure to install the pcre-devel package.

[root@localhost ~] # yum install pcre-devel install courier-unicode

Character set library file, which is equivalent to the courier-authlib-devel package installed in RPM. Not installing this will result in an error in compiling maildrop Times.

[root@localhost ~] # tar xvf courier-unicode-1.1.tar.bz2 [root@localhost ~] # cd courier-unicode-1.1 [root@localhost courier-unicode-1.1] #. / configure [root@localhost courier-unicode-1.1] # make & & make install install maildrop [root @ localhost ~] # tar xvf maildrop-2.7.2.tar.bz2 [root@localhost ~] # cd maildrop-2.7.2 [root@localhost maildrop-2.7.2] #. / configure\-- enable-sendmail=/usr/sbin/sendmail\-- enable-syslog=1\-- enable-maildirquota\-- enable-maildrop-uid=1001\-- enable-maildrop-gid=1001\-- with-trashquota\-- with-dirsync [root@localhost maildrop-2.7.2] # make [root@localhost maildrop-2.7.2] # make install

Check the installation results and make sure there is "Courier Authentication Library extension enabled." A sentence appears.

[root@localhost] # maildrop-vmaildrop 2.6.0 Copyright 1998-2005 Double Precision, Inc.GDBM/DB extensions enabled.Courier Authentication Library extension enabled.Maildir quota extension are now always enabled.This program is distributed under the terms of the GNU General PublicLicense. See COPYING for additional information. Create a profile / etc/maildroprc

First, specify the logging location for maildrop:

[root@localhost ~] # vim / etc/maildroprclogfile "/ var/log/maildrop.log" [root@localhost ~] # touch / var/log/maildrop.log [root@localhost ~] # chown vmail.vmail / var/log/maildrop.log configure Postfix's master.cf file [root@localhost ~] # vim / etc/postfix/master.cf#maildrop unix-n-- pipe# flags=DRhu user=vmail argv=/usr/local/bin/maildrop-d ${recipient}

Note: when transport is defined by enabling the above two lines, that is, the parameter line of the second line in the above two lines must start with a space or an error will occur.

Restart service [root@localhost ~] # service postfix restart [root@localhost ~] # service courier-authlib restart [root@localhost ~] # service httpd restart test

The sending test can be carried out. If the record class in the log is delivered with the following item maildrop, the installation is successful.

Apr 15 15:33:54 localhost postfix/pipe [11964]: 04B92147CE9: to=, relay=maildrop, delay=0.16, delays=0.07/0.03/0/0.07, dsn=2.0.0, status=sent (delivered via maildrop service)

PS: if you want to use maildrop for email filtering, you only need to use maildrop domain-based filtering criteria in / etc/maildroprc.

Thank you for reading this article carefully. I hope the article "how to install Postfix under Linux and use maildrop to deliver mail" shared by the editor will be helpful to you. At the same time, I also hope you will support us and pay attention to the industry information channel. More related knowledge is waiting for you to learn!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report