VCSA-无法为已触发的警报发送电子邮件
一、确认SMTP服务器正常
550 5.7.1 Unable to relay for ,意思是中继限制,查了下是SMTP服务器拒绝服务引起的。
在SMTP虚拟服务配置,在属性-访问中有“中继限制”这项,选择“仅以下列表除外”,列表为空。
1.1、测试SMTP服务器
telnet 来测试smtp服务器的收发邮件;
运行进入cmd窗口 输入如下:telnet 192.168.1.2 25 (192.168.1.2 是你的smtp服务器25是端口)
220 mail.finet.com Microsoft ESMTP MAIL Service, Version: 6.0.3790.1830 ready at
Fri, 16 Apr 2010 15:16:48 +0800
helo (打招呼 必须的格式)
250 mail.finet.com Hello [192.168.1.92]
mail from:herod_xiao@163.com 发送的邮箱
250 2.1.0 herod_xiao@sina.com.cn....Sender OK
rcpt to : herod_xiao@finet.com 接收的邮箱
250 2.1.5 herod_xiao@finet.com
data 输入数据的命令
354 Start mail input; end with <CRLF>.<CRLF>
Subject:mail test 输入的标题 S要大写
test test test!!!!!!!!!!!!!!!!!! 输入的内容* 回车
。 输入一个英文的点 然后回车
250 2.6.0 MAILzi9yzu23LiC1h1j00001039@mail.finet.com Queued mail for delivery
quit 退出
以上红色部分是输入内容
其他是输出信息
然后查看是否有收到邮件,如果收到说明smtp收邮件没问题;
你也可以试试发邮件看看;只需将mail from 和 rcpt to更换一下就
二、检查VCSA
2.1、检查日志
cat /var/log/vmware/vpxd/vpxd.log |grep SMTP
2.2、修改中继配置
Connect via SSH to the VCSA and go to the folder "mail"
>cd /etc/mail
You will see several files, you have to edit one called submit.cf (do a copy of the file, before modifying)
Look for this line "# "Smart" relay host (may be null)"
After the "DS", enter the FQDN of your SMTP server like this:
# "Smart" relay host (may be null)
DS smtp.pp.com (example)
2.3、重启sendmail服务
sendmail restart
三 、sendmail配置文件
sendmail.cf文件的注释完成了。
还是从Red Hat Linux宝典上摘录的,不当之处希望各位能指正。有几个没有注释,有谁知道的话,希望能够补全。 :D 谢谢。
#
# Copyright (c) 1998-2003 Sendmail, Inc. and its suppliers.
# All rights reserved.
# Copyright (c) 1983, 1995 Eric P. Allman. All rights reserved.
# Copyright (c) 1988, 1993
# The Regents of the University of California. All rights reserved.
#
# By using this file, you agree to the terms and conditions set
# forth in the LICENSE file which can be found at the top level of
# the sendmail distribution.
#
第一部分包括创建该sendmail.cf文件的组件文件清单,还包括有关该配置文件格式和版本的信息。
######################################################################
######################################################################
#####
##### SENDMAIL CONFIGURATION FILE
#####
##### built by root@server.magiccity.com on Sun Feb 27 22:20:43 CST 2005
##### in /etc/mail
##### using /usr/share/sendmail-cf/ as configuration include directory
#####
######################################################################
#####
##### DO NOT EDIT THIS FILE! Only edit the source .mc file.
#####
######################################################################
######################################################################
##### $Id: cfhead.m4,v 8.108.2.3 2003/04/03 17:51:51 ca Exp $ #####
##### $Id: cf.m4,v 8.32 1999/02/07 07:26:14 gshapiro Exp $ #####
##### setup for Red Hat Linux #####
##### $Id: linux.m4,v 8.13 2000/09/17 17:30:00 gshapiro Exp $ #####
##### $Id: local_procmail.m4,v 8.21.42.1 2002/11/17 04:25:07 ca Exp $ #####
##### $Id: no_default_msa.m4,v 8.2 2001/02/14 05:03:22 gshapiro Exp $ #####
##### $Id: smrsh.m4,v 8.14 1999/11/18 05:06:23 ca Exp $ #####
##### $Id: mailertable.m4,v 8.23 2001/03/16 00:51:26 gshapiro Exp $ #####
##### $Id: virtusertable.m4,v 8.21 2001/03/16 00:51:26 gshapiro Exp $ #####
##### $Id: redirect.m4,v 8.15 1999/08/06 01:47:36 gshapiro Exp $ #####
##### $Id: always_add_domain.m4,v 8.11 2000/09/12 22:00:53 ca Exp $ #####
##### $Id: use_cw_file.m4,v 8.11 2001/08/26 20:58:57 gshapiro Exp $ #####
##### $Id: use_ct_file.m4,v 8.11 2001/08/26 20:58:57 gshapiro Exp $ #####
##### $Id: local_procmail.m4,v 8.21.42.1 2002/11/17 04:25:07 ca Exp $ #####
##### $Id: access_db.m4,v 8.24 2002/03/06 21:50:25 ca Exp $ #####
##### $Id: blacklist_recipients.m4,v 8.13 1999/04/02 02:25:13 gshapiro Exp $ #####
##### $Id: accept_unresolvable_domains.m4,v 8.10 1999/02/07 07:26:07 gshapiro Exp $ #####
##### $Id: proto.m4,v 8.649.2.24 2003/08/04 21:14:26 ca Exp $ #####
# level 10 config file format
V10/Berkeley
说明这个配置文件相当于sendmail V10的开放原代码伯克利发布版。
# override file safeties - setting this option compromises system security,
# addressing the actual file configuration problem is preferred
# need to set this before any file actions are encountered in the cf file
#O DontBlameSendmail=safe
如不设置safe,sendmail将不接受转发文件、包含文件、收件箱、配置文件、类文件或者散列映射文件,这些文件使组或所用用户都可写的文件,或者位于一个组或所用用户都可写的目录下(在sendmail.mc文件中将confDONT_BLAME_SENDMAIL设置为safe会覆盖文件安全检查)。
# default LDAP map specification
# need to set this now before any LDAP maps are defined
#O LDAPDefaultSpec=-h localhost
利用LDAPDefaultSpec选项,可以添加包括LDAP专用设置的默认LADP映射。默认情况下,没有设置任何LDAP映射。主机:-h host 端口:-p port 域名:-d bindDN
##################
# local info # 本地信息项
##################
# my LDAP cluster
# need to set this before any LDAP lookups are done (including classes)
#D{sendmailMTACluster}$m
Cwlocalhost定义类宏w,它包括对该计算机给出的所有可能的主机名列表,这包含所用NDS别名、/etc/hosts中的所用引用甚至还有在该计算机上拥有帐户的个别用户使用的错误名字(避免使用那些邮件返回)。因为这可能使得一些主机上会有很长的列表,所以Fw/etc/mail/local-host-names一行定义文件类宏w,使这些主机名存储在一个单独的文件中(是/etc/mail/local-host-names文件).
Cwlocalhost
# file containing names of hosts for which we receive email
Fw/etc/mail/local-host-names
# my official domain name
# ... define this only if sendmail cannot automatically determine your domain
#Dj$w.Foo.COM
如果在sendmail.mc文件中已经设置了confDOMAIN_NAME,上一行应该不加注释并且用户的域名会取代Foo.COM。但是,将这一行注释掉,sendmail将试图自己来确定用户计算机的域名。建议让sendmail决定规范域名。
CP.
定义类P,(类只包括一个句号“.”)
# "Smart" relay host (may be null)
DS
指明没有定义智能中继主机。
# operators that cannot be in local usernames (i.e., network indicators)
CO @ % !
定义类O,它列出了用户名中无效的三个字符(@,%,!)。
# a class with just dot (for identifying canonical names)
C..
定义类“.”,(类只包括一个句号“.”)
# a class with just a left bracket (for identifying domain literals)
C[[
定义类“ [”
# access_db acceptance class
C{Accept}OK RELAY
C{ResOk}OKR
# Hosts for which relaying is permitted ($=R)
FR-o /etc/mail/relay-domains
指定一个文件R,该文件是一个邮件可以中继的主机列表,并存储在/etc/mail/relay-domains文件中。
# arithmetic map
Karith arith
# macro storage map
Kmacro macro
# possible values for TLS_connection in access map
C{tls}VERIFY ENCR
# dequoting map
Kdequote dequote
Kdequote声明dequote类的dequote数据库。它用来清楚重写规则中的地址的引用标记。
# class E: names that should be exposed as from this host, even if we masquerade
# class L: names that should be delivered locally, even if we have a relay
# class M: domains that should be converted to $M
# class N: domains that should not be converted to $M
#CL root
C{E}root
E类:指出根用户的邮件应当一直使用适当、完整的主机名和域名,即使其他指令要求这个主机名伪装成别的主机名。
L类:列出在本地主机接收邮件的用户名,即使其他指令要求所有邮件都必须中继到别处。
M类:指出哪些域应该伪装主机名(如在下面的M宏中设置的那样)。
N类: 指出不应该伪装主机名。
C{w}localhost.localdomain
# my name for error messages
DnMAILER-DAEMON
# Mailer table (overriding domains)
Kmailertable hash -o /etc/mail/mailertable.db
定义mailertable数据库,mailertable文件允许将特定的电子邮件转发到所选的服务器。
# Virtual user table (maps incoming users)
Kvirtuser hash -o /etc/mail/virtusertable.db
定义virtusertable数据库,virtusertable文件用于在多个域中为特定用户重定向邮件。
CPREDIRECT
给类P添加文本REDIRECT,它与重定向特性(在m4配置文件启用)一起使用,允许为不再有效的帐户创建别名。
# Access list database (for spam stomping)
Kaccess hash -T -o /etc/mail/access.db
定义access列表数据库,access文件可用于依据某种信息有选择地接收、拒绝、中继或者丢弃任何邮件。
# Configuration version number
DZ8.12.10
设定宏Z,它包含sendmail守护进程的所有版本信息。
############### sendmail.cf文件包含相当多的选项用于Red Hat Linux系统中设置
# Options # sendmail,选项定义在Option块之后开始。
###############
# strip message body to 7 bits on input?
O SevenBitInput=False
SevenBitInput指明Sendmail不应清除所有邮件信息的每一字节的最高位。
# 8-bit data handling
#O EightBitMode=pass8
EightBitMode指明sendmail如何处理未明确表明为8位的邮件数据。
pass8:允许原样传送所有的8位数据。
mimefy:把任何未指定的数据类型转化为MIME编码类型。
strict:拒绝任何非8位数据,注意,该选项对表明为8位的数据没有影响。
在重建别名数据库之前,sendmail先进行几项检测,以确保没有其他进程正在试图进行相同的操作。下面二个参数与别名文件有关。