当前位置:网站首页>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
完成后问题解决。
有别的再陆续补充!
边栏推荐
- Uniapp tips - scrolling components
- Formation of mil-100 (FE) coated small molecule aspirin [email protected] (FE) | glycyrrhetinic acid modified metal organ
- 中国锂电池电解液行业市场专项调研报告(2022版)
- 必贝特医药冲刺科创板:年营收97万亏损1.37亿 拟募资20亿
- MIL-100( Fe) 包裹小分子阿司匹林形成[email protected](Fe)|甘草次酸修饰金属有机框架材料UiO-66-NH2(简称UiO-66-NH2-GA)
- 【吉林大学】考研初试复试资料分享
- FPGA test method takes mentor tool as an example
- How to bold text in AI
- [acnoi2022] guess numbers
- Exercise 10-3 recursive implementation of exponential functions
猜你喜欢
[email protected])|制备路线"/>
叶酸修饰的金属-有机骨架(ZIF-8)载黄芩苷|金属有机骨架复合磁性材料([email protected])|制备路线
泰凌冲刺科创板:拟募资13亿 国家大基金与小米长江是股东
Polestar美股上市:5.5万台交付如何支持得起超200亿美元估值
QT learning 25 layout manager (4)
3D vision - 2 Introduction to pose estimation - openpose includes installation, compilation and use (single frame, real-time video)
Exercise 6-1 classify and count the number of characters
Exercise 10-1 calculate the sum of 1 to n using recursive functions
Exercise 8-8 moving letters
Solution to failure or slow downloading of electron when electron uses electron builder to package
[email protected](Fe)|甘草次酸修饰金属有机框架材料UiO-66-NH2(简称UiO-66-NH2-GA)"/>
MIL-100( Fe) 包裹小分子阿司匹林形成[email protected](Fe)|甘草次酸修饰金属有机框架材料UiO-66-NH2(简称UiO-66-NH2-GA)
随机推荐
28:第三章:开发通行证服务:11:在配置文件中定义属性,然后在代码中去获取;
Why don't I have a rookie medal
Analysis of the characteristics of page owner
Redis:Redis的数据结构、key的操作命令
Failure of vector insertion element iterator in STL
Cross linked cyclodextrin metal organic framework loaded methotrexate slow-release particles | metal organic porous material uio-66 loaded with flavonoid glycosides | Qiyue
simpleParallax. JS (create poor visual effects for website pictures)
金属有机骨架MIL-88负载阿霉素DOX|叶酸修饰UiO-66-NH2负载阿霉素[email protected]纳米粒子
C language,%d% Difference between 2D%2d%02d
js 2023. String pair equal to the target string after connection
JS Part 2
Leetcode(4)——尋找兩個正序數組的中比特數
Exercise 6-2 using functions to sum special A-string sequences
Rasp implementation of PHP
How to bold text in AI
QT learning 24 layout manager (III)
JS get DPI, PX to cm, cm to PX
超简单手机地图开发
可编程逻辑器件软件测试
Exercise 10-8 recursive implementation of sequential output of integers