首页 | 邮件资讯 | 技术教程 | 解决方案 | 产品评测 | 邮件人才 | 邮件博客 | 邮件系统论坛 | 软件下载 | 邮件周刊 | 热点专题 | 工具
网络技术 | 操作系统 | 邮件系统 | 客户端 | 电子邮箱 | 反垃圾邮件 | 邮件安全 | 邮件营销 | 移动电邮 | 邮件软件下载 | 电子书下载

邮件服务器

技术前沿 | Qmail | IMail | MDaemon | Exchange | Domino | 其它 | Foxmail | James | Kerio | JavaMail | WinMail | Sendmail | Postfix | Winwebmail | Merak | CMailServer | 邮件与开发 | 金笛 |
首页 > 邮件服务器 > Qmail > 在FreeBSD上使用minimalist组建邮件列表 > 正文

在FreeBSD上使用minimalist组建邮件列表

出处:cnfug.org 作者:Matthew(黑夜编码人) 时间:2006-10-25 17:18:00
1、Postfix的安装

这里我们使用手动编译的方式安装postfix,当然,你也可以使用ports来进行安装,首先是建立postfix用户,postfix和postdrop用户组,同时将postfix用户加到postdrop组中:


# pw groupadd postfix
# pw groupadd postdrop
# pw useradd postfix -g postifx -G postdrop

下载编译postfix

# fetch ftp://postfix.cn99.com/postfix/official/postfix-2.2.9.tar.gz
# tar -zxvf postfix-2.2.9.tar.gz
# cd postfix-2.2.9
# make tidy && make && make install

在make install的时候会提示一些问题,直接按回车,全部用默认的即可。

2、配置postfix

Postfix安装好后,需要配置的不多,只需修改(或添加)/etc/postfix/main.cf中的以下几处即可(中文部分为说明):


#这里假设我们的机器名是 lists.cnfug.org
myhostname = lists.cnfug.org
#这里假设我们的域是 cnfug.org
mydomain = cnfug.org
#设置发出去的邮件默认域名为 myhostname,即lists.cnfug.org
myorigin = $myhostname
#设置aliases的类型和路径
alias_maps = hash:/etc/postfix/aliases

生成aliases Hash文件,启动postfix

# postalias /etc/postfix/aliases
# postfix start

3、Minimalist的安装

Minimalist的安装非常简单,只需将下载回来的文件解包,复制里面的minimalist.pl到安装目的地即可,这里我们假设安装到/usr/local/bin中,分别执行以下命令:


# tar -zxvf minimalist.tar.gz
# cp minimalist-2.5.3/minimalist.pl /usr/local/bin/minimalist.pl
# chmod 0755 /usr/local/bin/minimalist.pl
# cp minimalist-2.5.3/minimalist.conf-sample /usr/local/etc/minimalist.conf

这里minimalist.conf是minimalist.pl的配置文件,它的默认路径为/usr/local/etc/minimalist.conf。
接下来就是让minimalist与postfix一同工作,编辑/etc/postfix/aliases文件,新增一行:

minimalist: "|/usr/local/bin/minimalist.pl"

重新生成postfix的aliases Hash文件,刷新postfix配置:

# postalias /etc/postfix/aliases
# postfix reload

4、配置Minimalist和新增一个邮件列表

首先要做的就是为minimalist建立一个工作目录,这里我们的工作目录为/home/maillist,并将目录的所有者设置为minimalist.pl执行时的用户,在postfix中,该用户就是nobody:


# mkdir /home/maillist
# chown nobody /home/maillist

在建立了minimalist的工作目录后,我们需要对minimalist的配置文件/usr/local/etc/minimalist.conf进行一些修改,以下是本文中使用的配置文件,修改了的部分都用中文注明了,请根据自己的需要修改:

############## Main configuration file for Minimalist ################

#--------------------------------------------------------------------#
# These directives can be used only in global config #
#--------------------------------------------------------------------#

# The directory for Minimalist's files - default to /var/spool/minimalist
#
# 设置minimalist的工作目录,默认为/var/spool/minimalist
directory = /home/maillist

# Administrator password. It applies to all lists, regardless to
# authentication settings in these lists. For per-list authentication see
# directive 'auth' below.
#
# Password must be in very first line and first column of message's body,
# as follows (without quotes): '*password: this_secret_password'
#
# By default this password isn't empty, but undefined, so if you want use
# it, you must define it here.
#
#password = this_secret_password

# Time while authentication request is valid, in hours
# Default to 24 hours
#
#request valid = 12

# Access control list, used for limiting access to Minimalist. Delimiter
# for items is ':'. Item, which begins with '@', means path to filename
# with items list, one item per row.
#
# Default is empty
#
#blacklist = !small.domain.com:domain.com:spamdomain.org:@/path/to/blacklist.txt
#
# In this example mails from small.domain.com will be allowed to work with
# Minimalist, mails from domain.com will be disallowed, and further, on the
# 'first match' basis.

# Robots (like MLM=mailing list managers) usually should be blocked
# otherwise two minimalists could be ping-ponging help/subscribe messages
# to each other infinitely. Delimiter is '|'.
#
#blocked robots = 'X-List-Server|List-Id|List-Subscribe|X-Yahoo-Newman-Property';

# Log requests to Minimalist. Can be either "none" or path to logfile.
#
# Default to none
#
#logfile = /var/log/Minimalist.log

# Log info about messages, passed through Minimalist. Can be 'yes' or 'no'
#
# Default to 'no'. logfile (see above) to 'none' implies 'no'
#
#log messages = yes

# Run in background. If 'yes', Minimalist uses fork for detach from MTA and
# continues execution in background.
#
# Default to 'no'
#
# 开启在后台运行minimailist,默认关闭
background = yes

#-------------------------------------------------------------------#
# These directives can be used either in global and local configs #
#-------------------------------------------------------------------#

# The Minimalist administrator's e-mail address.
#
# Default to postmaster@primary_domain, where primary_domain is the result
# of the `hostname --fqdn` command
#
# 列表管理员邮件
admin = listadmin@lists.cnfug.org

# Address for return miscellaneous delivery errors
#
# Available values are:
# . drop - drop such error messages
# . admin - send error messages to admin (see above)
# . sender - send error messages to sender of original message
# . verp - generate VERP (see below)
# . RFC-822 E-mail - send error messages to arbitrary mailbox
#
# Default to 'drop'. Note, that 'sender' value is quite annoying for
# message's sender and highly undesirable. When setuping new list it is
# desirable to set this parameter to 'admin' for revealing adimistrator's
# errors.
#
# Note about 'verp' (Variable Envelope Return Path).
#
# Prepare message so, that it will be possible to parse bounce messages.
# For detailed description see original document at
# http://cr.yp.to/proto/verp.txt
# or it's copy at
# http://www.mml.org.ua/verp.txt
#
# You must create one additional alias in your 'aliases' file, for
# processing bounce messages. It must be something similar to:
#
#listname-owner-*: "|/path/to/bouncer.pl"
#
# where 'listname' is the name of mailing list. Wildcard mask specifies,
# that any message, where recipient's address starts on 'listname-owner-',
# will be passed to bouncer.pl. Check your MTA documentation on how to
# creare wilcard aliases.
#
# Distribution of Minimalist does not provide bounce processing program.
# You should use any third-party program.
#
# CAUTION: if value set to 'verp', Minimalist will generate ONE MESSAGE per
# RECIPIENT. On big lists this can produce very big load of server.
#
#errors to = admin

# The list's language
# en=English / ru=Russian / de=informal German / DE=formal German /
# NL=Dutch
#
# See contrib/languages directory for further information
#
# language = en

# The charset, which will be used in information messages and footer.
#
# Default is 'us-ascii'
#
# See docs/README for information on how Minimalist adds footer,
# dependently on charset.
#
#charset = koi8-r

# Path to sendmail, default to '/usr/sbin/sendmail'
#
#sendmail = /usr/sbin/sendmail

# Delivery method. Can be 'internal' - Minimalist will send message by
# itself and 'alias' - Minimalist will send message to specified address,
# which can points to bulkmailer, etc.
#
# Note, that using 'alias' automatically sets value of 'errors to' to
# 'sender'.
#
# Default to 'internal'. Syntax is:
#
#delivery = internal
#delivery = alias e-mail

# The domain name - default to `hostname --fqdn`. If begins with '|' then
# Minimalist calls external program to determine hostname.
#
#domain = |uname -n
#
# 邮件列表的域名
domain = lists.cnfug.org

# Security level:
# . none - allow any person write to any mailing list
# . careful - only subscribers can write to list
# . paranoid - user must authenticate subscribe/unsubscribe requests
#
# Default to 'careful'
#
# 设置列表的安全级别,paranoid表示用户在订阅和退订里必须进行身验证
# 建议使用此安全级别,默认的级别为careful
security = paranoid

# Archiving strategy:
# . no - don't archive articles
# . daily - create new directory for articles every day
# . monthly - create new directory for articles every month
# . yearly - create new directory for articles every year
# or
# archive = pipe /path/to/archiver [options]
#
# for instance
# archive = pipe /usr/local/bin/hypermail -m www-talk -d /archives/www-talk
#
# Default to 'no'
#
# 开启列表邮件按月存档,默认为不存档
archive = monthly

# Maximum size of message (in bytes), which will be archived
#
# Default - zero (no limits)
#
#archive size = 1000000

# List's status. Available values are:
# . open - list without any restrictions
# . ro - read-only access to list
# . closed - only trusted users can subscribe anyone to this list.
# . mandatory - subscribed users can't unsubscribe
#
# Values may be used together, for example: closed,ro,mandatory
#
# Default to 'open'
#
#status = closed,ro,mandatory

# Copy to sender - indicates send or no message to message's sender
# Default to yes
#
#copy to sender = no

# This variable defines Reply-To: contents of outgoing message. Available
# choices: 'no', 'yes' or e-mail. If used 'no' (default), Minimalist doesn't
# touch this header at all. If used 'yes', Minimalist sets Reply-To: header
# to list's address instead of original contents.
#
# The third choice is available ONLY in per-list config - if used any other
# value, Reply-To: will be set to this value. BE CAREFUL and use correct
# RFC-822 compliant E-mail here.
#
# Please check the following URL on why you (most often) should not use
# this feature: http://www.unicom.com/pw/reply-to-harmful.html (Thanks to
# Jonas Bofjall for pointing to this topic)
#
# Default to 'no'
#
# 开启回复到邮件列表的功能,默认关闭
reply-to list = yes

# Set From: to specified value (RFC-822 compliant E-mail address) in
# outgoing message.
#
# Default - don't touch From:
#
#from = doka@kiev.sovam.com

# Modify subject before sending message to subscribers.
#
# Available values:
# no : don't touch subject
# yes : add "[list_name] " before original subject
# more : remove leading "Re: " if it's there and then add "[list_name] "
#
# Default to yes
#
#modify subject = no

# Maximal count of subscribers per list, zero means no limits.
# Default to zero
#
#maxusers = 100

# Count of recipients per message. If not zero, Minimalist will generate
# few messages with maxrcpts recipients instead of one message to all
# recipients.
#
# Allowed value from 1 to 50, default to 10
#
# Be careful when using high values, because this may lead to lost some
# recipients in mailing if total length of addresses will exceed allowed
# length of command line, passed to MTA.
#
#maxrcpts = 15

# Delay (in seconds) between deliveries, if there are few ones per message.
#
# Default to none
#
#delay = 15

# Maximal size of message
# Default to none
#
#maxsize = 100000

# Include list information headers (RFC 2369) in outgoing mail. These
# directives are: List-Help, List-Subscribe, List-Unsubscribe, List-Post,
# List-Owner and, optionally, List-Archive.
#
# Available values are: 'no', 'yes' or URL, which points to archive, in
# form: (Comment)
#
# Example:
# list information = (Archive of everything)
#
# Note: comment is optional and may be avoided. Using URL as value in this
# directive implies 'yes' to all rest List-* headers and available only in
# per-list config.
#
# Default value is 'yes'
#
#list information = no

# Strip various "Receipt Request" headers. Currently there are:
#
# . Return-Receipt-To
# . Disposition-Notification-To
# . X-Confirm-Reading-To
#
# Default not to strip
#
#strip rrq = yes

# Add extra headers. It is possible to use this option two and more times -
# Minimalist will glue all these headers, when producing final message.
# Also it is possible to use macroses (if applicable) \a (admin), \d
# (domain), \l (list), \o (owner), \n (newline), \t (tab) and \s (space) in
# these headers.
#
# WARNING! Minimalist doesn't check validity of these headers nor their
# duplicating! Be carefull while using this option.
#
#extra header = X-BeenThere: \l@\d
#
# By using \n, \t and \s it is possible to construct multiline headers, for
# example:
#
#extra header = X-Multline: first line\n\t second line\n\t third line
#
# the same result may be achieved by combining few directives:
#
#extra header = X-Multilne: first line
#extra header = \t second line
#extra header = \t third line

# Remove 'Resent-*' headers in incoming mail. These headers are not
# important for message understanding and processing, but some MUA's
# generate incorrect these ones.
#
# Default not to remove.
#
#remove resent = yes

# Modify Message-ID in outgoing message.
#
# If somefirstbody subscribed on two lists on same server and
# somesecondbody crossposts message to these lists and
# somefirstbody's MTA doesn't allow two and more messages with
# same Message-ID, then this first body will receive message only
# once. In this case modification of original message's Message-ID
# will solve this problem.
#
# Modification is done by adding token 'MMLID_xxxxx-' before the
# original Message-ID, where xxxxx is some number between 0 and 99999
#
# Default do not touch Message-ID.
#
#modify message-id = yes

# Send message on subscribe/unsubscribe event to list owner
#
# Default to no
#
#cc on subscribe = yes

#------------------------------------------------------------------#
# These directives can be used in local configs only #
#------------------------------------------------------------------#

# Authentication scheme for list.
#
# NOTE: By default there is 'password' scheme with undefined password, so
# if you want to make administrative requests to list, you must define this
# scheme explicitly.
#
# Examples:
#
# auth = mailfrom doka@kiev.sovam.com:@/usr/local/etc/list.admins
# List users, allowed to make administrative requests. Their e-mails
# delimited by ':', item, beginnig with '@' means filename with list
# of persons, one person's e-mail per one row.
#
# auth = password this_secret_password
# Password, which opens administrative access to list. Must be in
# very first line and first column of message's body, as follows
# (without quotes): '*password: this_secret_password'
#
#auth = mailfrom doka@kiev.sovam.com:@/usr/local/etc/mml.trusted
#auth = password this_secret_password

# List's GECOS.
#
# Add gecos to headers 'To' and, optionally, 'Reply-To', when sending
# message to subscribers. For example, using:
#
# list gecos = Minimalist General Discussion
#
# will produce
#
# To: Minimalist General Discussion
# Reply-To: Minimalist General Discussion
#
# in outgoing message.
#
# Default: empty
#
#list gecos = Test GECOS

# Fill header 'To' of outgoing message with recipient's address.
#
# Note: if set to 'yes', Minimalist will remove all rest 'To' and 'Cc'
# headers from message.
#
# CAUTION: if set to 'yes', Minimalist will generate ONE MESSAGE per
# RECIPIENT. On big lists this can produce very big load of server.
#
# Default to 'no'
#
#to recipient = yes


在修改完配置文件后,可以使用使用(不包含引号)"/usr/local/bin/minimalist.pl -" 来对配置文件进行检查。
当上面的工作完成后,现在就可以新建我们的第一个邮件列表了,假设我们要建立一个名为cnfug的邮件列表(同样假设域名为lists.cnfug.org)。minimalist的邮件列表是通过minimalist工作目录中的lists.lst文件来进行控制的,在本例中,它便是/home/maillist/lists.lst,编辑它(第一次编辑时需要创建它),并增加如下行:

cnfug This is my first list

其中cnfug是我们的邮件列表的名字,以后其它用户将通过cnfug@lists.cnfug.org的形式递交信件,紧跟其后的是一个Tab(跳格),minimalist将根据tab来区分列表名和列表描述,tab后面的就是列表的简单描述。

在列表控制文件中加入列表信息后,现在就该为列表建立文件夹,在minialist的工作目录中,以列表名创建文件夹,并保证minimalist可以对其进行读写操作:


# 邮件大小控制
maxsize = 30000

info文件


Welcome!

This is information file for list \l.

Available information for this list:

. Server's administrator: \a
. Domain: \d
. List's owner: \o

footer文件


-----------------------------------------------------------
If you wish to unsubscribe from this mailing, send mail to
minimalist@\d with a subject of:
unsubscribe \l

当完成上面的第一步之后,接下来就是为我们的邮件列表增加aliases别名,编辑/etc/postfix/aliases,增加如下行:

cnfug: "|/usr/local/bin/minimalist.pl cnfug"
cnfug-owner: listadmin@lists.cnfug.org

第一行是告诉邮件系统,发往cnfug@lists.cnfug.org的邮件将交由minimalist.pl来处理,这里minimalist.pl多了一个参数,即邮件列表名,第二行是将所有发往cnfug-owner@lists.cnfug.org的邮件,递交给列表所有者listadmin@lists.cnfug.org
重建aliases Hash文件,刷新postfix配置:

# postalias /etc/postfix/aliases
# postfix reload

现在你就可以测试你的邮件列表了,发一封邮件到minimal@lists.cnfug.org,邮件主题为help,你将看到相关的帮助;发一封邮件主题为subscribe cnfug的邮件到minimal@lists.cnfug.org,便可以订阅我们的邮件列表cnfug,因为我们设置了验证,所以你将会收到一封要求验证的信件,返回验证信息后,便成功的订阅了。

相关文章 热门文章
  • 刘子骏:利用QQ邮件列表 做精准的邮件营销
  • Ipswitch IMail Server邮件列表imailsrv.exe栈溢出漏洞
  • 腾讯QQ邮件列表开始内测
  • MDaemon邮件列表订阅目录遍历漏洞
  • Exchange 2007邮件列表根据部门来创建动态通讯组
  • Google式的智能:GMail邮箱自动帮您退订邮件列表
  • MDaemon使用技巧大全--邮件列表的建立和使用
  • 用通讯组实现邮件列表:Exchange2003学习系列之九
  • MarkMail将邮件列表存档推向新境界
  • MDaemon使用技巧大全--邮件列表功能
  • kerio邮件列表如何订阅和推定
  • 邮件列表数量越大,电子邮件回应率越低
  • Linux邮件服务器软件比较
  • 域名和邮件服务器FAQ
  • Qmail自动安装包Qmail_setup-v1.5.3发布
  • freebsd+qmail+mysql+vpopmail之完全ports安装
  • qmail+vpopmail+MySQL+igenus+RedHat 7下建立邮件系统
  • QMAIL终极安装指南
  • 配置你的第一台e-mail服务器
  • qmail+webmail on Linux9 安装全过程
  • 分布式的Qmail邮件系统
  • qmail+vpopmail+mysql+qmailadmin+ezmlm+igenus构建企..
  • qmail+webmail on Linux9 安装全过程
  • Qmail Server Howto
  • 自由广告区
     
    最新软件下载
  • SharePoint Server 2010 部署文档
  • Exchange 2010 RTM升级至SP1 教程
  • Exchange 2010 OWA下RBAC实现的组功能...
  • Lync Server 2010 Standard Edition 标..
  • Lync Server 2010 Enterprise Edition...
  • Forefront Endpoint Protection 2010 ...
  • Lync Server 2010 Edge 服务器部署文档
  • 《Exchange 2003专家指南》
  • Mastering Hyper-V Deployment
  • Windows Server 2008 R2 Hyper-V
  • Microsoft Lync Server 2010 Unleashed
  • Windows Server 2008 R2 Unleashed
  • 今日邮件技术文章
  • 腾讯,在创新中演绎互联网“进化论”
  • 华科人 张小龙 (中国第二代程序员 QQ...
  • 微软推出新功能 提高Hotmail密码安全性
  • 快压技巧分享:秒传邮件超大附件
  • 不容忽视的邮件营销数据分析过程中的算..
  • 国内手机邮箱的现状与未来发展——访尚..
  • 易观数据:2011Q2中国手机邮箱市场收入..
  • 穿越时空的爱恋 QQ邮箱音视频及贺卡邮件
  • Hotmail新功能:“我的朋友可能被黑了”
  • 入侵邻居网络发骚扰邮件 美国男子被重..
  • 网易邮箱莫子睿:《非你莫属》招聘多过..
  • 中国电信推广189邮箱绿色账单
  • 最新专题
  • 鸟哥的Linux私房菜之Mail服务器
  • Exchange Server 2010技术专题
  • Windows 7 技术专题
  • Sendmail 邮件系统配置
  • 组建Exchange 2003邮件系统
  • Windows Server 2008 专题
  • ORF 反垃圾邮件系统
  • Exchange Server 2007 专题
  • ISA Server 2006 教程专题
  • Windows Vista 技术专题
  • “黑莓”(BlackBerry)专题
  • Apache James 专题
  • 分类导航
    邮件新闻资讯:
    IT业界 | 邮件服务器 | 邮件趣闻 | 移动电邮
    电子邮箱 | 反垃圾邮件|邮件客户端|网络安全
    行业数据 | 邮件人物 | 网站公告 | 行业法规
    网络技术:
    邮件原理 | 网络协议 | 网络管理 | 传输介质
    线路接入 | 路由接口 | 邮件存储 | 华为3Com
    CISCO技术 | 网络与服务器硬件
    操作系统:
    Windows 9X | Linux&Uinx | Windows NT
    Windows Vista | FreeBSD | 其它操作系统
    邮件服务器:
    程序与开发 | Exchange | Qmail | Postfix
    Sendmail | MDaemon | Domino | Foxmail
    KerioMail | JavaMail | Winwebmail |James
    Merak&VisNetic | CMailServer | WinMail
    金笛邮件系统 | 其它 |
    反垃圾邮件:
    综述| 客户端反垃圾邮件|服务器端反垃圾邮件
    邮件客户端软件:
    Outlook | Foxmail | DreamMail| KooMail
    The bat | 雷鸟 | Eudora |Becky! |Pegasus
    IncrediMail |其它
    电子邮箱: 个人邮箱 | 企业邮箱 |Gmail
    移动电子邮件:服务器 | 客户端 | 技术前沿
    邮件网络安全:
    软件漏洞 | 安全知识 | 病毒公告 |防火墙
    攻防技术 | 病毒查杀| ISA | 数字签名
    邮件营销:
    Email营销 | 网络营销 | 营销技巧 |营销案例
    邮件人才:招聘 | 职场 | 培训 | 指南 | 职场
    解决方案:
    邮件系统|反垃圾邮件 |安全 |移动电邮 |招标
    产品评测:
    邮件系统 |反垃圾邮件 |邮箱 |安全 |客户端
    广告联系 | 合作联系 | 关于我们 | 联系我们 | 繁體中文
    版权所有:邮件技术资讯网©2003-2010 www.5dmail.net, All Rights Reserved
    www.5Dmail.net Web Team   粤ICP备05009143号