当前位置:网站首页>Sendmail无法发送邮件及发送过慢解决
Sendmail无法发送邮件及发送过慢解决
2022-07-03 13:53:00 【星哥玩云】
今天折腾CentOS的时候Sendmail碰到的一些问题,如邮件无法发送,发送后的一些问题等等,这里统一做个记录,以备不是之需,同时也希望能帮到一些碰到这些问题的童鞋。每个问题都会有详细的操作步骤,按照步骤操作即可;
折腾环境: CentOS 邮件组件:Sendmail
一、主机虽支持mail()函数,却无法发送邮件; 先使用以下命令检查是否已安装sendmail:
rpm –q sendmail检测结果确实未安装该组件,果断安装:
yum install sendmail等待安装完成后去检查了下php.ini配置,里面需要修改相关参数,直接:
vi /usr/local/php/etc/php.ini找到 sendmail_path 所在行,发现是未启用,去掉前面的分号;(按i编辑模式),去掉分号,并将其改为:
sendmail_path = /usr/sbin/sendmail -t –i这个有的默认就会是这个值。接着重启sendmail:
service sendmail restart二:发送邮件过慢问题 上面的步骤已经可以正常发送邮件了,但是却发现发送过慢,此时,请检查hosts:
cat /etc/hosts结果发现:
127.0.0.1 localhost.localdomain localhost中并没有hostname,将其加入,查看主机名称直接命令:hostname ,这里加入主机名称为:testhost,则改过后的内容则为:
127.0.0.1 localhost.localdomain localhost testhost接着,重启sendmail;
完成此步骤后还可以解决一个sendmail和sm-client启动慢的问题;
三、邮件发送方为:[email protected]代发问题
方法一:修改hostname为个人域 方法二:伪装成[email protected]
执行以下命令:
/etc/mail/sendmail.mc打开后编辑文件,在末端加入以下内容:
MASQUERADE_AS(gongzi.me)dnl FEATURE(masquerade_envelope)dnl FEATURE(masquerade_entire_domain)dnl MASQUERADE_DOMAIN(gongzi.me)dnl将其中的gongzi.me换成你自己的域名,然后保存。接着执行以下命令:
m4 /etc/mail/sendmail.mc > /etc/mail/sendmail.cf而后,重启sendmail服务。
四:执行 m4 /etc/mail/sendmail.mc > /etc/mail/sendmail.cf 时,报错:sendmail.mc:10: m4: cannot open `/usr/share/sendmail-cf/m4/cf.m4': No such file or directory,并且导致sendmail相关服务无法正常启动。
原因:未安装sendmail-cf 解决:执行以下命令:
yum install sendmail-cf完成后问题解决。
有别的再陆续补充!
边栏推荐
- Exercise 10-3 recursive implementation of exponential functions
- 虽然不一定最优秀,但一定是最努力的!
- Redis:字符串类型数据的操作命令
- 泰凌冲刺科创板:拟募资13亿 国家大基金与小米长江是股东
- Example analysis of QT learning 18 login dialog box
- Current situation, analysis and prediction of information and innovation industry
- Dlopen() implements dynamic loading of third-party libraries
- Redis: operation command of string type data
- Leetcode (4) -- find the median of two positively ordered arrays
- 【吉林大学】考研初试复试资料分享
猜你喜欢

Print. JS -- web page file printing

Exercise 7-6 count capital consonants

FPGA test method takes mentor tool as an example

JVM class loading

Why are grass-roots colleges and universities with "soil and poverty" called "Northeast small Tsinghua"?

玖逸云黑免费无加密版本源码

愉悦资本新双币基金近40亿元完成首次关账

Exercise 8-7 string sorting
[email protected])|制备路线"/>叶酸修饰的金属-有机骨架(ZIF-8)载黄芩苷|金属有机骨架复合磁性材料([email protected])|制备路线

QT learning 21 standard dialog box in QT (Part 2)
随机推荐
2021年区域赛ICPC沈阳站J-Luggage Lock(代码简洁)
Example analysis of QT learning 18 login dialog box
金属有机骨架材料ZIF-8包载姜黄素([email protected]纳米颗粒)|纳米金属有机框架搭载雷帕霉素|科研试剂
Too many files with unapproved license
Vite project commissioning
simpleParallax. JS (create poor visual effects for website pictures)
信创产业现状、分析与预测
Exercise 8-7 string sorting
MIL-100( Fe) 包裹小分子阿司匹林形成[email protected](Fe)|甘草次酸修饰金属有机框架材料UiO-66-NH2(简称UiO-66-NH2-GA)
Back to top implementation
Failure of vector insertion element iterator in STL
Exercise 8-2 calculate the sum and difference of two numbers
Webpage connection database ~ simple implementation of addition, deletion, modification and query complete code
JS continues to explore...
fpga阻塞赋值和非阻塞赋值
Redis: operation command of string type data
Print. JS -- web page file printing
Cross linked cyclodextrin metal organic framework loaded methotrexate slow-release particles | metal organic porous material uio-66 loaded with flavonoid glycosides | Qiyue
GRPC的四种数据流以及案例
Why are grass-roots colleges and universities with "soil and poverty" called "Northeast small Tsinghua"?