免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
12
最近访问板块 发新帖
楼主: hadskyd
打印 上一主题 下一主题

[网络配置] sendmail 配置 可以发送 到外网邮箱 [复制链接]

论坛徽章:
0
11 [报告]
发表于 2012-05-27 09:43 |只看该作者
简单说说配置了那些东西也ok,先谢过!回复 7# ulovko


   

论坛徽章:
0
12 [报告]
发表于 2012-05-27 09:46 |只看该作者
这是thunderbird返回的消息!



    **********************************************
    **      THIS IS A WARNING MESSAGE ONLY      **
    **  YOU DO NOT NEED TO RESEND YOUR MESSAGE  **
    **********************************************

The original message was received at Sat, 26 May 2012 00:50:40 -0700
from [192.168.0.3]

   ----- Transcript of session follows -----
<12435xxxx@qq.com>... Deferred: Connection timed out with mx1.qq.com.
Warning: message still undelivered after 4 hours
Will keep trying until message is 5 days old



Reporting-MTA: dns; mail.example.com
Arrival-Date: Sat, 26 May 2012 00:50:40 -0700

Final-Recipient: RFC822; 1243xxxx@qq.com
Action: delayed
Status: 4.4.1
Remote-MTA: DNS; mx1.qq.com
Last-Attempt-Date: Sat, 26 May 2012 18:39:12 -0700
Will-Retry-Until: Thu, 31 May 2012 00:50:40 -0700

论坛徽章:
0
13 [报告]
发表于 2012-05-27 09:55 |只看该作者
返回的消息!!

  
  **********************************************
    **      THIS IS A WARNING MESSAGE ONLY      **
    **  YOU DO NOT NEED TO RESEND YOUR MESSAGE  **
    **********************************************

The original message was received at Sat, 26 May 2012 00:50:40 -0700
from [192.168.0.3]

   ----- Transcript of session follows -----
<124354xxx@qq.com>... Deferred: Connection timed out with mx1.qq.com.
Warning: message still undelivered after 4 hours
Will keep trying until message is 5 days old



Reporting-MTA: dns; mail.exmaple.com
Arrival-Date: Sat, 26 May 2012 00:50:40 -0700

Final-Recipient: RFC822; 12435xxx@qq.com
Action: delayed
Status: 4.4.1
Remote-MTA: DNS; mx1.qq.com
Last-Attempt-Date: Sat, 26 May 2012 18:39:12 -0700
Will-Retry-Until: Thu, 31 May 2012 00:50:40 -0700

论坛徽章:
13
15-16赛季CBA联赛之同曦
日期:2016-01-28 19:52:032015亚冠之北京国安
日期:2015-10-07 14:28:19NBA常规赛纪念章
日期:2015-05-04 22:32:03处女座
日期:2015-01-15 19:45:44卯兔
日期:2014-10-28 16:17:14白羊座
日期:2014-05-24 15:10:46寅虎
日期:2014-05-10 09:50:35白羊座
日期:2014-03-12 20:52:17午马
日期:2014-03-01 08:37:27射手座
日期:2014-02-19 19:26:54子鼠
日期:2013-11-30 09:03:56狮子座
日期:2013-09-08 08:37:52
14 [报告]
发表于 2012-05-27 10:15 |只看该作者
本帖最后由 ulovko 于 2012-05-27 10:21 编辑

  1. > cd /etc/mail; makemap hash access.db < access
  2. > m4 /etc/mail/sendmail.mc > /etc/mail/sendmail.cf
  3. > /etc/init.d/sendmail restart
  4. > mail -vs 'AK Subject' ulovk@qq.com
  5. 一台虚拟机192.168.0.4 作为邮件服务器,安装sendmail。
  6. 网络连接方式为NAT,可以上网。
  7. 设置了DNS,和一个自己定义的domain。
  8. 域内发送邮件可以正常接收。
  9. 向外网发送的时候,在thunderbird上显示已经发送。
  10. 但是对方并没有受到邮件!
  11. 请问可能是什么原因?求各位大虾分析下!
  12. EOT
  13. ulovk@qq.com... Connecting to [127.0.0.1] via relay...
  14. 220 ko.kotzu.org ESMTP Sendmail 8.14.5/8.14.5; Sun, 27 May 2012 10:18:44 +0800 (CST)
  15. >>> EHLO ko.kotzu.org
  16. 250-ko.kotzu.org Hello localhost [127.0.0.1], pleased to meet you
  17. 250-ENHANCEDSTATUSCODES
  18. 250-PIPELINING
  19. 250-8BITMIME
  20. 250-SIZE
  21. 250-DSN
  22. 250-ETRN
  23. 250-DELIVERBY
  24. 250 HELP
  25. >>> MAIL From:<ko@ko.kotzu.org> SIZE=400
  26. 250 2.1.0 <ko@ko.kotzu.org>... Sender ok
  27. >>> RCPT To:<ulovk@qq.com>
  28. >>> DATA
  29. 250 2.1.5 <ulovk@qq.com>... Recipient ok
  30. 354 Enter mail, end with "." on a line by itself
  31. >>> .
  32. 250 2.0.0 q4R2Iiis083700 Message accepted for delivery
  33. ulovk@qq.com... Sent (q4R2Iiis083700 Message accepted for delivery)
  34. Closing connection to [127.0.0.1]
  35. >>> QUIT
  36. 221 2.0.0 ko.kotzu.org closing connection
  37. >
复制代码


论坛徽章:
0
15 [报告]
发表于 2012-05-27 10:18 |只看该作者
先谢过我看看 不明白的再请教你!!!回复 14# ulovko


   

论坛徽章:
13
15-16赛季CBA联赛之同曦
日期:2016-01-28 19:52:032015亚冠之北京国安
日期:2015-10-07 14:28:19NBA常规赛纪念章
日期:2015-05-04 22:32:03处女座
日期:2015-01-15 19:45:44卯兔
日期:2014-10-28 16:17:14白羊座
日期:2014-05-24 15:10:46寅虎
日期:2014-05-10 09:50:35白羊座
日期:2014-03-12 20:52:17午马
日期:2014-03-01 08:37:27射手座
日期:2014-02-19 19:26:54子鼠
日期:2013-11-30 09:03:56狮子座
日期:2013-09-08 08:37:52
16 [报告]
发表于 2012-05-27 10:20 |只看该作者
回复 15# hadskyd


    请教不敢当啊,我这是默认配置根本就没有修改的。。

论坛徽章:
13
15-16赛季CBA联赛之同曦
日期:2016-01-28 19:52:032015亚冠之北京国安
日期:2015-10-07 14:28:19NBA常规赛纪念章
日期:2015-05-04 22:32:03处女座
日期:2015-01-15 19:45:44卯兔
日期:2014-10-28 16:17:14白羊座
日期:2014-05-24 15:10:46寅虎
日期:2014-05-10 09:50:35白羊座
日期:2014-03-12 20:52:17午马
日期:2014-03-01 08:37:27射手座
日期:2014-02-19 19:26:54子鼠
日期:2013-11-30 09:03:56狮子座
日期:2013-09-08 08:37:52
17 [报告]
发表于 2012-05-27 10:23 |只看该作者
  1. > cat sendmail.txt
  2. # MUA        (Mail User Agent)
  3. # MSP        (Mail Submission Program)
  4. # MSP sample:
  5. mail -vs 'AK Subject' mary@mail.centos.com
  6. dig -t MX example.com |grep -i 'mx'
  7. # LMTP        (Local Mail Transport Protocol)
  8. # SMTP        (Simple Mail Transport Protocol)

  9. # MTA        (Mail Transport Agent)
  10. # MDA        (Mail Delivery Agent)
  11. # MRA        (Mail Retrieval Agent)

  12. # POP3        (Post Office Protocol version 3)
  13. # IMAP        (Internet Mail Access Protocol version 4)
  14. sendmail sendmail-cf m4 sendmail-doc procmail(MDA) spamassassin
  15. rpm -qc sendmail        ('c' - configuration)
  16. rpm -qd sendmail{,-doc} |less        ('d' - document)

  17. /etc/mail/sendmail.cf
  18. /etc/mail/sendmail.mc        (m4)
  19. /usr/share/sendmail-cf/cf/*.mc
  20. /etc/mail/local-host-names
  21. /etc/mail/access        (makemap - create database maps for sendmail)
  22. /etc/mail/access.db
  23. /etc/aliases                (newaliases)
  24. /etc/aliases.db
  25. /var/spool/mqueue        (mailq)

  26. # 1>:
  27. vim /etc/mail/sendmail.mc
  28. DAEMON_OPTIONS(`Port=smtp,Addr=0.0.0.0, Name=MTA')dnl

  29. # 2>:
  30. vim /etc/mail/local-host-names
  31. mail.centos.com
  32. mail2.centos.com
  33. www.centos.com
  34. ftp.centos.com

  35. # 3>: MTA Relay  
  36. vim /etc/mail/access
  37. Connect:localhost.localdomain        RELAY
  38. Connect:localhost                RELAY
  39. Connect:127.0.0.1                RELAY
  40. From:192.168.1                OK
  41. To:192.168.0                REJECT
  42. To:user@cracker.org        ERROR:550 I hate U

  43. # 4>:
  44. cd /etc/mail; makemap hash access.db < access
  45. m4 /etc/mail/sendmail.mc > /etc/mail/sendmail.cf
  46. # or:
  47. make -C /etc/mail

  48. # 5>:
  49. /etc/init.d/sendmail restart
  50. sendmail -d0 < /dev/null        ('d' - dubugger=0)
  51. sendmail -q / mailq ; mailq -Ac
  52. tail -f /var/log/maillog

  53. # vim /etc/mail/sendmail.mc
  54. # FEATURE(genericstable)dnl
  55. # FEATURE(`always_add_domain')dnl
  56. # GENERICS_DOMAIN_FILE(`/etc/mail/local-host-names')dnl
  57. # vim /etc/mail/virtusertable
  58. admin@example.com       shopper
  59. ak@example.org          service
  60. @.com                   jacky@gmail.com
  61. @example.org            %1@cracker.org

  62. # MTA Changer
  63. alternatives --config mta
  64. alternatives --display mta
  65. alternatives --set mta /usr/sbin/sendmail.postfix
  66. alternatives --set mta /usr/sbin/sendmail.sendmail
  67. system-switch-mail
复制代码
以前的笔记

论坛徽章:
0
18 [报告]
发表于 2012-05-27 10:28 |只看该作者
3Q 我参照试试!回复 17# ulovko


   

论坛徽章:
0
19 [报告]
发表于 2012-05-27 10:44 |只看该作者
弱弱的问下你机器的环境我还是不行回复 18# hadskyd


   
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP