QQ登录

只需一步,快速开始

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 1740|回复: 4

如何修改postfix mail命令发送邮件的默认域?

[复制链接]
发表于 2005-6-21 11:46:01 | 显示全部楼层 |阅读模式
我需要在shell下用mail命令发邮件,邮件发出的默认域名后缀是localhost.localdomain,邮件能够正常发送,但是因为目标主机无法解析localhost.localdomain,造成目的用户收不到,postfix怎么设置才能把发件人由[email protected]改为[email protected],我已经修改过main.cf中的myhostname = mail.abc.com,但是没有效果,发件人仍然是[email protected],加masquerade_domains = abc.cn参数发邮件,/var/log/maillog根本就没有反应


[code:1]Jun 21 11:27:03 hkweb sendmail[29498]: j5L3R3Pa029498: from=root, size=818, class=0, nrcpts=1, msgid=<[email protected]>, relay=root@localhost
Jun 21 11:27:03 hkweb postfix/smtpd[29488]: connect from hkweb[127.0.0.1]
Jun 21 11:27:03 hkweb postfix/smtpd[29488]: ED86C2EF102: client=hkweb[127.0.0.1]
Jun 21 11:27:04 hkweb postfix/cleanup[29490]: ED86C2EF102: message-id=<[email protected]>
Jun 21 11:27:04 hkweb postfix/nqmgr[3380]: ED86C2EF102: from=<[email protected]>, size=1330, nrcpt=1 (queue active)
Jun 21 11:27:04 hkweb sendmail[29498]: j5L3R3Pa029498: [email protected], ctladdr=root (0/0), delay=00:00:01, xdelay=00:00:01, mailer=relay, pri=30818, relay=[127.0.0.1] [127.0.0.1], dsn=2.0.0, stat=Sent (Ok: queued as ED86C2EF102)
Jun 21 11:27:04 hkweb postfix/smtpd[29488]: disconnect from hkweb[127.0.0.1]
Jun 21 11:27:28 hkweb postfix/smtp[29492]: ED86C2EF102: to=<[email protected]>, relay=sohumx.sohu.com[61.135.132.100], delay=25, status=bounced (host sohumx.sohu.com[61.135.132.100] said: 554 <[email protected]>: Sender address rejected: Access denied, refer to http://antispam.mail.sohu.com/feedback/feedback.jsp?err_type=2&msg=%72%6F%6F%74%40%6C%6F%63%61%6C%68%6F%73%74%2E%6C%6F%63%61%6C%64%6F%6D%61%69%6E (in reply to MAIL FROM command))
Jun 21 11:27:28 hkweb postfix/cleanup[29490]: 94B002EF103: message-id=<20050621032728.94B002EF103@hkweb>
Jun 21 11:27:28 hkweb postfix/nqmgr[3380]: 94B002EF103: from=<>, size=3400, nrcpt=1 (queue active)
Jun 21 11:27:28 hkweb postfix/smtp[29492]: 94B002EF103: to=<[email protected]>, relay=none, delay=0, status=bounced (Name service error for name=localhost.localdomain type=A: Host not found)
[/code:1]
发表于 2005-6-23 23:51:07 | 显示全部楼层
方法1:改 main.cf 中的 myorigin

方法2:改 /etc/hosts
回复

使用道具 举报

 楼主| 发表于 2005-6-24 11:51:27 | 显示全部楼层
[quote:b6efe33bde="dannycat"]方法1:改 main.cf 中的 myorigin[/quote]
不行,试过了,发件人还是[email protected],只是今天发给sohu的邮件又发出去了

[code:1]配置一
mydomain = newsky.cn
myorigin = hk.newksy.cn
配置二
mydomain = newsky.cn
myorigin = $mydomain[/code:1]
这两种配置都试过

[code:1]
Jun 24 11:40:52 hkweb sendmail[31495]: j5O3eqmH031495: from=root, size=70, class=0, nrcpts=1, msgid=<[email protected]>, relay=root@localhost
Jun 24 11:40:52 hkweb postfix/smtpd[31497]: connect from hkweb[127.0.0.1]
Jun 24 11:40:52 hkweb postfix/smtpd[31497]: DA5F22EF102: client=hkweb[127.0.0.1]
Jun 24 11:40:52 hkweb postfix/cleanup[31499]: DA5F22EF102: message-id=<[email protected]>
Jun 24 11:40:53 hkweb sendmail[31495]: j5O3eqmH031495: [email protected], ctladdr=root (0/0), delay=00:00:01, xdelay=00:00:01, mailer=relay, pri=30070, relay=[127.0.0.1] [127.0.0.1], dsn=2.0.0, stat=Sent (Ok: queued as DA5F22EF102)
Jun 24 11:40:53 hkweb postfix/nqmgr[3380]: DA5F22EF102: from=<[email protected]>, size=565, nrcpt=1 (queue active)
Jun 24 11:40:53 hkweb postfix/smtpd[31497]: disconnect from hkweb[127.0.0.1]
Jun 24 11:41:03 hkweb postfix/smtp[31501]: DA5F22EF102: to=<[email protected]>, relay=sohumx.sohu.com[61.135.132.100], delay=11, status=sent (250 Ok: queued as 6bfbdcc91bb54057d5a779eb9c71f145)[/code:1]



[quote:b6efe33bde="dannycat"]方法2:改 /etc/hosts[/quote]

因为有oracle数据库,所以不能改/etc/hosts
回复

使用道具 举报

发表于 2005-6-24 15:54:26 | 显示全部楼层
main.cf:
myhostname = hostname.domain.com
mydomain = domain.com
myorigin = $mydomain
mydestination = $mydomain, $myhostname
mynetwork = IP_numbers
回复

使用道具 举报

 楼主| 发表于 2005-6-27 16:07:31 | 显示全部楼层
[quote:9c1a8aa9ce="bwb"]main.cf:
myhostname = hostname.domain.com
mydomain = domain.com
myorigin = $mydomain
mydestination = $mydomain, $myhostname
mynetwork = IP_numbers[/quote]

不行,还是老样子,我没有启动postfix服务,只是调用mail命令,附件是我的配置文件内容,请将后缀名修改为cf再打开

[code:1]Jun 27 15:59:21 hkweb sendmail[22119]: j5R7xGlp022119: from=root, size=69, class=0, nrcpts=1, msgid=<[email protected]>, relay=root@localhost
Jun 27 15:59:21 hkweb postfix/smtpd[22558]: connect from hkweb[127.0.0.1]
Jun 27 15:59:21 hkweb postfix/smtpd[22558]: A0E172EF102: client=hkweb[127.0.0.1]
Jun 27 15:59:21 hkweb postfix/cleanup[22560]: A0E172EF102: message-id=<[email protected]>
Jun 27 15:59:21 hkweb sendmail[22119]: j5R7xGlp022119: [email protected], ctladdr=root (0/0), delay=00:00:05, xdelay=00:00:00, mailer=relay, pri=30069, relay=[127.0.0.1] [127.0.0.1], dsn=2.0.0, stat=Sent (Ok: queued as A0E172EF102)
Jun 27 15:59:21 hkweb postfix/smtpd[22558]: disconnect from hkweb[127.0.0.1]
Jun 27 15:59:21 hkweb postfix/nqmgr[3380]: A0E172EF102: from=<[email protected]>, size=564, nrcpt=1 (queue active)
Jun 27 15:59:28 hkweb postfix/smtp[22562]: A0E172EF102: to=<[email protected]>, relay=sohumx.sohu.com[61.135.132.100], delay=7, status=bounced (host sohumx.sohu.com[61.135.132.100] said: 554 <[email protected]>: Sender address rejected: Access denied, refer to http://antispam.mail.sohu.com/feedback/feedback.jsp?err_type=2&msg=%72%6F%6F%74%40%6C%6F%63%61%6C%68%6F%73%74%2E%6C%6F%63%61%6C%64%6F%6D%61%69%6E (in reply to MAIL FROM command))
Jun 27 15:59:28 hkweb postfix/cleanup[22560]: 93D472EF103: message-id=<[email protected]>
Jun 27 15:59:28 hkweb postfix/nqmgr[3380]: 93D472EF103: from=<>, size=2695, nrcpt=1 (queue active)
Jun 27 15:59:33 hkweb postfix/smtp[22562]: 93D472EF103: to=<[email protected]>, relay=none, delay=5, status=bounced (Name service error for name=localhost.localdomain type=A: Host not found)
[/code:1]

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有账号?注册

×
回复

使用道具 举报

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

本版积分规则

GMT+8, 2024-11-5 18:29 , Processed in 0.093625 second(s), 17 queries .

© 2021 Powered by Discuz! X3.5.

快速回复 返回顶部 返回列表