Chinaunix首页 | 论坛 | 博客
  • 博客访问: 54942
  • 博文数量: 11
  • 博客积分: 1515
  • 博客等级: 上尉
  • 技术积分: 140
  • 用 户 组: 普通用户
  • 注册时间: 2010-08-12 13:16
文章分类

全部博文(11)

文章存档

2010年(11)

分类: BSD

2010-08-19 14:29:34

 

最近公司要安装专门发邮件的服务器,只发不收,那真是简单到了爆

 

首先安装,这里最快的办法就是pkg_add -r

 

[root@free /]# pkg_add postfix 

pkg_add: can't stat package file 'postfix'

 

[root@free /]# pkg_add -r postfix

Fetching ftp://ftp.freebsd.org/pub/FreeBSD/ports/amd64/packages-8.0-release/Latest/postfix.tbz...

 Done.

Added group "postfix".

Added group "maildrop".

Added user "postfix".

You need user "postfix" added to group "mail".

Would you like me to add it [y]? Done.

Would you like to activate Postfix in /etc/mail/mailer.conf [n]? n

pkg_add: warning: package 'postfix-2.6.5,1' requires 'pcre-7.9', but 'pcre-8.02' is installed

 

To enable postfix startup script please add postfix_enable="YES" in

your rc.conf

 

If you not need sendmail anymore, please add in your rc.conf:

 

sendmail_enable="NO"

sendmail_submit_enable="NO"

sendmail_outbound_enable="NO"

sendmail_msp_queue_enable="NO"

 

And you can disable some sendmail specific daily maintenance routines in your

/etc/periodic.conf file:

 

daily_clean_hoststat_enable="NO"

daily_status_mail_rejects_enable="NO"

daily_status_include_submit_mailq="NO"

daily_submit_queuerun="NO"

 

If you are using SASL, you need to make sure that postfix has access to read

the sasldb file.  This is accomplished by adding postfix to group mail and

making the /usr/local/etc/sasldb* file(s) readable by group mail (this should

be the default for new installs).

 

If you are upgrading from postfix version prior to 2.0, please see the README

files for recommended changes to your configuration.

 

 

 

启动,因为没有在/etc/rc.conf 定义postfix自动启动与否,所以这里手动启动加one

 

[root@free /etc]# /usr/local/etc/rc.d/postfix  onestart

postfix/postfix-script: starting the Postfix mail system

 

 

但是当你发送邮件的时候,100%会报一个错。检查/var/log/maillog可以看到

 

问题:

Aug 18 16:30:17 free postfix/smtpd[80648]: fatal: open database /etc/aliases.db: No such file or directory

Aug 18 16:30:18 free postfix/master[80373]: warning: process /usr/local/libexec/postfix/smtpd pid 80648 exit status 1

Aug 18 16:30:18 free postfix/master[80373]: warning: /usr/local/libexec/postfix/smtpd: bad command startup – throttling

 

困扰了我好久的问题,终于找到了解决办法:

 

解决:

1 关闭/usr/local/etc/rc.d/postfix stop

 

2执行newaliases 

/etc/mail/aliases: 27 aliases, longest 10 bytes, 275 bytes total

记住这个路径/etc/mail/aliases

 

3修改/usr/local/etc/postfix/main.cf

查找到alias_map,去掉前面的# ,修改为以上的那个路径

alias_maps = hash:/etc/mail/aliases

 

重新启动postfix

 

 

测试安装是否正确

mail 

 

能收到邮件代表postfix可以发信了!

 

 

阅读(1027) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~