QQ登录

只需一步,快速开始

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 1131|回复: 11

请教一些网络概念和Sendmail问题,谢谢

[复制链接]
发表于 2004-5-18 14:00:22 | 显示全部楼层 |阅读模式
我是Linux 新手,在Windows下对网络挺熟,但到Linux下发现啥也不会,发帖请教。

机器和网络背景:
Redhat 9.0 kernel 2.4.20-8 完全安装
单网卡:
IP:202.*.*.* ----(A)
MASK:255.255.255.0
GATE:202.*.*.1
DNS:202.*.*.* ----(B)
局域网方式上网
我的一切网络服务都由B机提供:邮件,DNS,等等

我的目标是利用Mutt+Sendmail+fetchmail构建收发B和其他比如Sina,163.com等等上我的帐号的邮件的系统。

问题:
1。安装系统完成后主机名为:localhost.localdomain,我将它改为hydra,并在/etc/hosts加了202.*.*.* hydra ,结果系统启动时到Sendmail进程就特别慢,要3~4分钟,将主机名改回一切正常,为什么?

2。我的邮件服务是由B来提供,windows下,我用Foxmail,smtp和pop地址都是B,然后用用户名和密码发送接收邮件,smtp需要身份验证, Sendmail 中如何设置?

3。可否介绍一下fetchmail?

谢谢!
发表于 2004-5-18 14:13:06 | 显示全部楼层
1。你可以修改sendmail.cf文件,的cw(好像是这个,吧localhost 和localhost.localdomain改成你要的。
2。这里用到sendmail了么?用那个叫e什么的不就可以了

3。没用过!不好说,不过你可以google一 下。答案一定很多
回复

使用道具 举报

发表于 2004-5-18 14:39:55 | 显示全部楼层
修改sendmail.mc文件,
把其中的dnl  DAEMON_OPTIONS(`Port=smtp,Addr=166.111.195.91, Name=MTA')dnl
中的166.111.194.91改成你自己的ip地址就可以了,其他的不要改.反正要改成以上的格式(好像还要加dnl什么的,我忘掉了)
然后用运行 m4 sendmail.mc > sendmail.cf
(因为直接改sendmail.cf比较麻烦,所以要改sendmail.mc ,,简化)
不要修改sendmail.cf!!
重新启动sendmail服务就可以了

sendmail是邮件服务器(就如sohu的邮箱一样了,是个放信的地方),你所说的只是读取邮件的软件了

用mail来收发信件,具体看帮助了
回复

使用道具 举报

发表于 2004-5-18 14:55:18 | 显示全部楼层
我原来就是直接改的sendmail.cf文件,也不是很麻烦,主要是因为改动的地方不多!
回复

使用道具 举报

发表于 2004-5-18 16:45:39 | 显示全部楼层
呵呵
那也可以的了

:)
回复

使用道具 举报

 楼主| 发表于 2004-5-18 22:35:21 | 显示全部楼层
谢谢,现在启动时,Sendmail进程快了很多:)
回复

使用道具 举报

发表于 2004-5-18 22:41:05 | 显示全部楼层
其实,你可以大胆的自己动手来弄,我改这个的时候还不是自己摸索的,最多在改动前backup一个,在操刀,狠劲的砍吧!反正我有马甲   
回复

使用道具 举报

 楼主| 发表于 2004-5-19 03:01:19 | 显示全部楼层
继续配置过程中遇到以下问题:

3. fetchmail 从B中收到邮件,就会自动转到Sendmail吗?如果是,但我的Sendmail有身份验证,怎么设置fetchamil? 我想将B中的邮件(帐号hydra)收到本机中的hydra中,本机名为:hydra.mail,所以本地邮件为[email protected] ? /etc/hosts 中包含 202.*.*.* hydra.mail,
结果一直出错:
....... ........
fetchmail: IMAP< A0005 OK Completed
fetchmail: IMAP> A0006 FETCH 1 RFC822.HEADER
fetchmail: IMAP< * 1 FETCH (RFC822.HEADER {849}
reading message hydra@202.*.*.*:1 of 101 (849 header octets)
fetchmail: SMTP connect to localhost failed
fetchmail: IMAP> A0007 LOGOUT
fetchmail: IMAP< )
fetchmail: IMAP< A0006 OK Completed
fetchmail: IMAP< * BYE LOGOUT received
fetchmail: IMAP< A0007 OK Completed
fetchmail: SMTP transaction error while fetching from 202.*.*.*
fetchmail: 6.2.5 querying 202.*.*.* (protocol IMAP) at 2004Äê05ÔÂ19ÈÕ ÐÇÆÚÈý 02?20·Ö44Ãë: poll completed
fetchmail: Query status=10 (SMTP)
fetchmail: normal termination, status 10
Done.
请指教,谢谢


我的Sendmail.mc 和.fetchmailrc 如下:
Sendmail.mc
divert(-1)dnl
dnl #
dnl # This is the sendmail macro config file for m4. If you make changes to
dnl # /etc/mail/sendmail.mc, you will need to regenerate the
dnl # /etc/mail/sendmail.cf file by confirming that the sendmail-cf package is
dnl # installed and then performing a
dnl #
dnl #     make -C /etc/mail
dnl #
include(`/usr/share/sendmail-cf/m4/cf.m4')dnl
VERSIONID(`setup for Red Hat Linux')dnl
OSTYPE(`linux')dnl
dnl #
dnl # Uncomment and edit the following line if your outgoing mail needs to
dnl # be sent out through an external mail server:
dnl #

dnl define(`SMART_HOST',`smtp.your.provider')
dnl #
define(`confDEF_USER_ID',``8:12'')dnl
define(`confTRUSTED_USER', `smmsp')dnl
dnl define(`confAUTO_REBUILD')dnl
define(`confTO_CONNECT', `1m')dnl
define(`confTRY_NULL_MX_LIST',true)dnl
define(`confDONT_PROBE_INTERFACES',true)dnl
define(`PROCMAIL_MAILER_PATH',`/usr/bin/procmail')dnl
define(`ALIAS_FILE', `/etc/aliases')dnl
dnl define(`STATUS_FILE', `/etc/mail/statistics')dnl
define(`UUCP_MAILER_MAX', `2000000')dnl
define(`confUSERDB_SPEC', `/etc/mail/userdb.db')dnl
define(`confPRIVACY_FLAGS', `authwarnings,novrfy,noexpn,restrictqrun')dnl
define(`confAUTH_OPTIONS', `A')dnl
dnl #
dnl # The following allows relaying if the user authenticates, and disallows
dnl # plaintext authentication (PLAIN/LOGIN) on non-TLS links
dnl #
dnl define(`confAUTH_OPTIONS', `A p')dnl
dnl #
dnl # PLAIN is the preferred plaintext authentication method and used by
dnl # Mozilla Mail and Evolution, though Outlook Express and other MUAs do
dnl # use LOGIN. Other mechanisms should be used if the connection is not
dnl # guaranteed secure.
dnl #
TRUST_AUTH_MECH(`EXTERNAL DIGEST-MD5 CRAM-MD5 LOGIN PLAIN')dnl
define(`confAUTH_MECHANISMS', `EXTERNAL GSSAPI DIGEST-MD5 CRAM-MD5 LOGIN PLAIN')dnl
dnl #
dnl # Rudimentary information on creating certificates for sendmail TLS:
dnl #     make -C /usr/share/ssl/certs usage
dnl #
dnl define(`confCACERT_PATH',`/usr/share/ssl/certs')
dnl define(`confCACERT',`/usr/share/ssl/certs/ca-bundle.crt')
dnl define(`confSERVER_CERT',`/usr/share/ssl/certs/sendmail.pem')
dnl define(`confSERVER_KEY',`/usr/share/ssl/certs/sendmail.pem')
dnl #
dnl # This allows sendmail to use a keyfile that is shared with OpenLDAP's
dnl # slapd, which requires the file to be readble by group ldap
dnl #
dnl define(`confDONT_BLAME_SENDMAIL',`groupreadablekeyfile')dnl
dnl #
dnl define(`confTO_QUEUEWARN', `4h')dnl
dnl define(`confTO_QUEUERETURN', `5d')dnl
dnl define(`confQUEUE_LA', `12')dnl
dnl define(`confREFUSE_LA', `18')dnl
define(`confTO_IDENT', `0')dnl
dnl FEATURE(delay_checks)dnl
FEATURE(`no_default_msa',`dnl')dnl
FEATURE(`smrsh',`/usr/sbin/smrsh')dnl
FEATURE(`mailertable',`hash -o /etc/mail/mailertable.db')dnl
FEATURE(`virtusertable',`hash -o /etc/mail/virtusertable.db')dnl
FEATURE(redirect)dnl
FEATURE(always_add_domain)dnl
FEATURE(use_cw_file)dnl
FEATURE(use_ct_file)dnl
dnl #
dnl # The -t option will retry delivery if e.g. the user runs over his quota.
dnl #
FEATURE(local_procmail,`',`procmail -t -Y -a $h -d $u')dnl
FEATURE(`access_db',`hash -T<TMPF> -o /etc/mail/access.db')dnl
FEATURE(`blacklist_recipients')dnl
EXPOSED_USER(`root')dnl
dnl #
dnl # The following causes sendmail to only listen on the IPv4 loopback address
dnl # 127.0.0.1 and not on any other network devices. Remove the loopback
dnl # address restriction to accept email from the internet or intranet.
dnl #
DAEMON_OPTIONS(`Port=smtp,Addr=202.*.*.*, Name=MTA')dnl    ####此处202.*.*.*为我的IP地址
dnl #
dnl # The following causes sendmail to additionally listen to port 587 for
dnl # mail from MUAs that authenticate. Roaming users who can't reach their
dnl # preferred sendmail daemon due to port 25 being blocked or redirected find
dnl # this useful.
dnl #
dnl DAEMON_OPTIONS(`Port=submission, Name=MSA, M=Ea')dnl
dnl #
dnl # The following causes sendmail to additionally listen to port 465, but
dnl # starting immediately in TLS mode upon connecting. Port 25 or 587 followed
dnl # by STARTTLS is preferred, but roaming clients using Outlook Express can't
dnl # do STARTTLS on ports other than 25. Mozilla Mail can ONLY use STARTTLS
dnl # and doesn't support the deprecated smtps; Evolution <1.1.1 uses smtps
dnl # when SSL is enabled-- STARTTLS support is available in version 1.1.1.
dnl #
dnl # For this to work your OpenSSL certificates must be configured.
dnl #
dnl DAEMON_OPTIONS(`Port=smtps, Name=TLSMTA, M=s')dnl
dnl #
dnl # The following causes sendmail to additionally listen on the IPv6 loopback
dnl # device. Remove the loopback address restriction listen to the network.
dnl #
dnl # NOTE: binding both IPv4 and IPv6 daemon to the same port requires
dnl #       a kernel patch
dnl #
dnl DAEMON_OPTIONS(`port=smtp,Addr=::1, Name=MTA-v6, Family=inet6')dnl
dnl #
dnl # We strongly recommend not accepting unresolvable domains if you want to
dnl # protect yourself from spam. However, the laptop and users on computers
dnl # that do not have 24x7 DNS do need this.
dnl #
FEATURE(`accept_unresolvable_domains')dnl
dnl #
dnl FEATURE(`relay_based_on_MX')dnl
dnl #
dnl # Also accept email sent to "localhost.localdomain" as local email.
dnl #
LOCAL_DOMAIN(`localhost.localdomain')dnl
dnl #
dnl # The following example makes mail from this host and any additional
dnl # specified domains appear to be sent from mydomain.com
dnl #
dnl MASQUERADE_AS(`mydomain.com')dnl
dnl #
dnl # masquerade not just the headers, but the envelope as well
dnl #
dnl FEATURE(masquerade_envelope)dnl
dnl #
dnl # masquerade not just @mydomainalias.com, but @*.mydomainalias.com as well
dnl #
dnl FEATURE(masquerade_entire_domain)dnl
dnl #
dnl MASQUERADE_DOMAIN(localhost)dnl
dnl MASQUERADE_DOMAIN(localhost.localdomain)dnl
dnl MASQUERADE_DOMAIN(mydomainalias.com)dnl
dnl MASQUERADE_DOMAIN(mydomain.lan)dnl
MAILER(smtp)dnl
MAILER(procmail)dnl

测试telnet hydra.mail 25 通过
但测telnet localhost 25 不通过???

.fetchmailrc如下
set syslog
set postmaster "hydra"
poll 202.*.*.* with proto IMAP    ###此处202.*.*.* 为B的IP地址
envelope Devlivered-To
user 'hydra' there with password '******'  is [email protected] keep
回复

使用道具 举报

发表于 2004-5-19 12:57:03 | 显示全部楼层
sendmail.mc好像没错

你可以试试能不能用sendmail发信
mail  root@localhost
再以root登录,看能不能受到信件

也可以试试往外边的邮箱发信
mail   [email protected]
再登录sohu看有没有受到邮件

只是fetchmail我没有用过了,
回复

使用道具 举报

 楼主| 发表于 2004-5-19 15:22:56 | 显示全部楼层
mail root@localhost
mail [email protected] 都是可以的
但mail 到外面就不行了 比如sina sohu 等等

而且现在我的概念越来越混淆和模糊了:(

Sendmail到底干些什么?


其实我的目标很简单:
1. 在本机A(202.*.*.A)上收取B(202.*.*.B)中的“hydra@B”的邮件到本机“hydra”的  本地邮箱中,然后用Mutt管理,(阅读,分类,回复,撰写)
2. 发送Mutt中写好的邮件,要求到B上发送,B要求SMTP的身份验证。

其实就是实现Foxmail的功能,也有现成的Evolution可以用,想试试其他的方法

目前1已经实现了,但2总是不行:(  Mutt总说已经发了,但就是收不到!
回复

使用道具 举报

发表于 2004-5-19 15:48:35 | 显示全部楼层
sendmail是用来做邮件服务器的,

你是说B是邮件服务器,你想找个软件,利用B上的邮件帐户发送

试试kmail等, mozilla也带了个邮件客户端。
回复

使用道具 举报

发表于 2004-5-19 16:55:17 | 显示全部楼层
早就说了不关sendmail什么事!
回复

使用道具 举报

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

本版积分规则

GMT+8, 2024-11-8 13:51 , Processed in 0.071673 second(s), 15 queries .

© 2021 Powered by Discuz! X3.5.

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