Chinaunix首页 | 论坛 | 博客
  • 博客访问: 300107
  • 博文数量: 106
  • 博客积分: 1948
  • 博客等级: 上尉
  • 技术积分: 947
  • 用 户 组: 普通用户
  • 注册时间: 2010-11-27 00:11
文章分类

全部博文(106)

文章存档

2014年(1)

2013年(14)

2012年(61)

2011年(30)

分类: LINUX

2012-04-07 20:31:42

公司10.04tls,默认sendmail指向exim4,其实我也不知是啥,网上查了查,可以配合nagios3做发送邮件使用。
家里11.10,apt-get安装exim4,途中出现什么不能立即配置,解决办法是把和exim4有冲突的东西全部卸载,貌似我最后卸载了一个叫ssmtp的东西就好了

------简单的分割线------
家里的配置方法
由于家里没有邮件服务器,利用gmail的smtp做邮件服务器发送邮件
sudo dpkg-reconfigure exim4-config
邮件系统常见类型:用 smarthost 发信;无本地信件
邮件系统名称:tbq(我的机器名默认的)
要监听入站 SMTP 连接的 IP 地址:127.0.0.1(只监听本机的)
其它可接收邮件的目的地址:
本地用户的可见域名:tbq(我的机器名默认的)
寄信使用的 smarthost 的 IP 地址或主机名:smtp.gmail.com
保持最小 DNS 查询量吗 (按需拔号,Dial-on-Demand)?否
将设置文件分拆成小文件吗?否

将会自动重启服务,生成一个配置文件
/etc/exim4/update-exim4.conf.conf

点击(此处)折叠或打开

  1. tbq@tbq:~$ sudo cat /etc/exim4/update-exim4.conf.conf
  2. # /etc/exim4/update-exim4.conf.conf
  3. #
  4. # Edit this file and /etc/mailname by hand and execute update-exim4.conf
  5. # yourself or use 'dpkg-reconfigure exim4-config'
  6. #
  7. # Please note that this is _not_ a dpkg-conffile and that automatic changes
  8. # to this file might happen. The code handling this will honor your local
  9. # changes, so this is usually fine, but will break local schemes that mess
  10. # around with multiple versions of the file.
  11. #
  12. # update-exim4.conf uses this file to determine variable values to generate
  13. # exim configuration macros for the configuration file.
  14. #
  15. # Most settings found in here do have corresponding questions in the
  16. # Debconf configuration, but not all of them.
  17. #
  18. # This is a Debian specific file
  19. dc_eximconfig_configtype='satellite'
  20. dc_other_hostnames=''
  21. dc_local_interfaces='127.0.0.1'
  22. dc_readhost='tbq'
  23. dc_relay_domains=''
  24. dc_minimaldns='false'
  25. dc_relay_nets=''
  26. dc_smarthost='smtp.gmail.com'
  27. CFILEMODE='644'
  28. dc_use_split_config='false'
  29. dc_hide_mailname='true'
  30. dc_mailname_in_oh='true'
  31. dc_localdelivery='mail_spool'
还有一个文件需要配置,smtp的用户名密码文件
/etc/exim4/passwd.client

点击(此处)折叠或打开

  1. # password file used when the local exim is authenticating to a remote
  2. # host as a client.
  3. #
  4. # see exim4_passwd_client(5) for more documentation
  5. #
  6. # Example:
  7. ### target.mail.server.example:login:password
  8. gmail-smtp-msa.l.google.com:user@gmail.com:password
上面红色字体部分是ping smtp.gmail.com得到的地址,如果直接写smtp.gmail.com我这边不好用不知为啥
网上资料说还需要改一个文件/etc/email-addresses
但是我测试/etc/email-addresses文件内容是否修改好像没啥关系,因为我只向外发邮件


测试发邮件
echo "text" | mail -s "title" xxxxxxx@qq.com
qq邮箱成功收到邮件


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

qibotang2012-04-09 21:23:57

很奇怪,今天再用gmail发邮件出问题了,都在gmail的发件箱里。。。。。