当前位置:网站首页>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完成后问题解决。
有别的再陆续补充!
边栏推荐
- MongoDB数据库入门的常用命令
- Leetcode (4) - - trouver la médiane de deux tableaux ordonnés positifs
- 虽然不一定最优秀,但一定是最努力的!
- FPGA test method takes mentor tool as an example
- Although not necessarily the best, it must be the hardest!
- Failure of vector insertion element iterator in STL
- JS input number and standard digit number are compared. The problem of adding 0 to 0
- QT learning 19 standard dialog box in QT (top)
- js . Find the first palindrome string in the array
- TS code automatically generates JS
猜你喜欢

Exercise 10-6 recursively find Fabonacci sequence

protobuf与grpc

Vite project commissioning

Uio-66-cooh loaded bendamostine | hydroxyapatite (HA) coated MIL-53 (FE) nanoparticles | baicalin loaded manganese based metal organic skeleton material

Redis: commandes d'action pour les données de type chaîne

npm install卡住与node-npy的各种奇怪报错

Dlopen() implements dynamic loading of third-party libraries

Cross linked cyclodextrin metal organic framework loaded methotrexate slow-release particles | metal organic porous material uio-66 loaded with flavonoid glycosides | Qiyue
[email protected] (FE) | glycyrrhetinic acid modified metal organ"/>Formation of mil-100 (FE) coated small molecule aspirin [email protected] (FE) | glycyrrhetinic acid modified metal organ

Global event bus
随机推荐
Uniapp tips - set background music
Interface for querying IP home
Failure of vector insertion element iterator in STL
Metal organic framework (MOFs) antitumor drug carrier | pcn-223 loaded with metronidazole | uio-66 loaded with ciprofloxacin hydrochloride(
虽然不一定最优秀,但一定是最努力的!
中国锂电池电解液行业市场专项调研报告(2022版)
Simulated access
Exercise 10-3 recursive implementation of exponential functions
Raft 协议
QT learning 21 standard dialog box in QT (Part 2)
Polestar美股上市:5.5万台交付如何支持得起超200亿美元估值
How to bold text in AI
jvm-运行时数据区
Selenium browser (1)
page owner特性浅析
556. 下一个更大元素 III
[ACNOI2022]猜数
Exercise 8-2 calculate the sum and difference of two numbers
Back to top implementation
Dlopen() implements dynamic loading of third-party libraries