首发:http://www.chuiniudi.cn/archives/66 基本 配置 需要修改的 配置 文件: /etc/mail/sendmail.mc /etc/mail/local-host-names /etc/mail/access 打开sendmail.mc,搜索”127.0.0.1″,找到如下代码; DAEMON_OPTIONS (`Port=smtp,Addr=127.0.0.1,Name=MTA’
首发:http://www.chuiniudi.cn/archives/66
基本配置需要修改的配置文件:
/etc/mail/sendmail.mc
/etc/mail/local-host-names
/etc/mail/access
打开sendmail.mc,搜索”127.0.0.1″,找到如下代码;
DAEMON_OPTIONS (`Port=smtp,Addr=127.0.0.1,Name=MTA’)
修改为:
DAEMON_OPTIONS (`Port=smtp,Addr=0.0.0.0,Name=MTA’)
监听所有IP地址
搜索”MD5″,找到如下代码:
dnl TRUST_AUTH_MECH(`EXTERNAL DIGEST-MD5 CRAM-MD5 LOGIN PLAIN’)dnl
dnl define(`confAUTH_MECHANISMS’, `EXTERNAL GSSAPI DIGEST-MD5 CRAM-MD5 LOGIN PLAIN’)dnl
去掉这两行前面的”dnl”,后面的dnl保留.
在shell下执行命令:m4 sendmail.mc > sendmail.cf
在local-host-names 中添加邮件服务所使用的域名,比如有账户zbwz@chuiniudi.cn,这里面就填test.com,一个域名占一行,域名最后不用加”.”,域名要解析要sendmail服务器的IP.
最后就是access文件,这个文件只有跨服务器发送邮件时才会用到.
比如我现在的sendmail服务器S1的IP为”192.168.1.2″,另外一台sendmail服务器S2的IP为”192.168.2.2″,要用S1上的一个邮箱帐号向S2服务器上的邮箱帐号发送邮件.在S2上就需要修改access文件了,在access文件中添加如下内容:
192.168.1.2 RELAY
中继来自192.168.1.2的邮件.
保存一下,然后在shell中执行命令:
makemap hash access.db 最终sendmail程序要用到的还是access.db文件,所以这里要把access文件转换为access.db文件. access文件中其他的一些选项: 192.168.1 REJACK(拒绝) 192.168.1.2 OK(绝对允许,完全信任该IP) 这里的IP可以使一个IP地址,也可以是一个网段. 两台sendmail服务器之间发送邮件需要注意的一些问题: 两台sendmail服务器的主机名不可为localhost.localdomain(默认的主机名). 需要修改配置文件:/etc/sysconfig/network.或者直接在”网络”里修改,修改后重启网卡,打开/etc/hosts.里面的内容为不能包含新的主机名. telnet到Sendmail服务器的25端口,这里的主机名不为localhost.localdomain时,两台Sendmail就可以互发邮件了. DNS服务器里一定要做好相应的A记录和MX记录. 以服务器S1为例:域名为chuiniudi.cn 在dns服务器中建立如下记录: @ IN A 192.168.1.2 mail IN A 192.168.1.2 @ IN MX 10 mail 群发功能的实现: 实现向team1发送邮件 People[1-3]都能收到 打开/etc/aliases文件.添加如下内容: team1: People1,People2,People3 team2: People4,People5,People6 这里的team[1-2],People[1-6]都是真实用户.需要用useradd命令创建 新建Sendmail用户时,如果不希望该用户登陆到系统,可以使用如下命令添加用户: useradd 用户名 -s /sbin/nologin 照这样配置好后,Sendmail服务器就可以进行最基本的收发邮件工作了
http://zserver.blog.51cto.com/370152/156419

MySQLviewshavelimitations:1)Theydon'tsupportallSQLoperations,restrictingdatamanipulationthroughviewswithjoinsorsubqueries.2)Theycanimpactperformance,especiallywithcomplexqueriesorlargedatasets.3)Viewsdon'tstoredata,potentiallyleadingtooutdatedinforma

ProperusermanagementinMySQLiscrucialforenhancingsecurityandensuringefficientdatabaseoperation.1)UseCREATEUSERtoaddusers,specifyingconnectionsourcewith@'localhost'or@'%'.2)GrantspecificprivilegeswithGRANT,usingleastprivilegeprincipletominimizerisks.3)

MySQLdoesn'timposeahardlimitontriggers,butpracticalfactorsdeterminetheireffectiveuse:1)Serverconfigurationimpactstriggermanagement;2)Complextriggersincreasesystemload;3)Largertablesslowtriggerperformance;4)Highconcurrencycancausetriggercontention;5)M

Yes,it'ssafetostoreBLOBdatainMySQL,butconsiderthesefactors:1)StorageSpace:BLOBscanconsumesignificantspace,potentiallyincreasingcostsandslowingperformance.2)Performance:LargerrowsizesduetoBLOBsmayslowdownqueries.3)BackupandRecovery:Theseprocessescanbe

Adding MySQL users through the PHP web interface can use MySQLi extensions. The steps are as follows: 1. Connect to the MySQL database and use the MySQLi extension. 2. Create a user, use the CREATEUSER statement, and use the PASSWORD() function to encrypt the password. 3. Prevent SQL injection and use the mysqli_real_escape_string() function to process user input. 4. Assign permissions to new users and use the GRANT statement.

MySQL'sBLOBissuitableforstoringbinarydatawithinarelationaldatabase,whileNoSQLoptionslikeMongoDB,Redis,andCassandraofferflexible,scalablesolutionsforunstructureddata.BLOBissimplerbutcanslowdownperformancewithlargedata;NoSQLprovidesbetterscalabilityand

ToaddauserinMySQL,use:CREATEUSER'username'@'host'IDENTIFIEDBY'password';Here'showtodoitsecurely:1)Choosethehostcarefullytocontrolaccess.2)SetresourcelimitswithoptionslikeMAX_QUERIES_PER_HOUR.3)Usestrong,uniquepasswords.4)EnforceSSL/TLSconnectionswith

ToavoidcommonmistakeswithstringdatatypesinMySQL,understandstringtypenuances,choosetherighttype,andmanageencodingandcollationsettingseffectively.1)UseCHARforfixed-lengthstrings,VARCHARforvariable-length,andTEXT/BLOBforlargerdata.2)Setcorrectcharacters


Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

Atom editor mac version download
The most popular open source editor

WebStorm Mac version
Useful JavaScript development tools

SublimeText3 English version
Recommended: Win version, supports code prompts!

Dreamweaver Mac version
Visual web development tools

Safe Exam Browser
Safe Exam Browser is a secure browser environment for taking online exams securely. This software turns any computer into a secure workstation. It controls access to any utility and prevents students from using unauthorized resources.
