当前位置:网站首页>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完成后问题解决。
有别的再陆续补充!
边栏推荐
- 牛客网:过河卒
- 关于回溯问题中的排列问题的思考(LeetCode46题与47题)
- jvm-类加载
- Why are grass-roots colleges and universities with "soil and poverty" called "Northeast small Tsinghua"?
- 7-10 calculate salary
- JS matrix zero
- 金属有机骨架材料ZIF-8包载姜黄素([email protected]纳米颗粒)|纳米金属有机框架搭载雷帕霉素|科研试剂
- 中国锂电池电解液行业市场专项调研报告(2022版)
- 交联环糊精金属有机骨架负载甲氨蝶呤缓释微粒|金属-有机多孔材料UiO-66负载黄酮苷类药物|齐岳
- Page generation QR code
猜你喜欢

Leetcode(4)——寻找两个正序数组的中位数

3D vision - 2 Introduction to pose estimation - openpose includes installation, compilation and use (single frame, real-time video)

Leetcode (4) -- find the median of two positively ordered arrays

concat和concat_ws()区别及group_concat()和repeat()函数的使用

FPGA测试方法以Mentor工具为例

【吉林大学】考研初试复试资料分享

QT learning 21 standard dialog box in QT (Part 2)

Redis:Redis的数据结构、key的操作命令

小项目(servelt+jsp+mysql+EL+JSTL)完成一个登录功能的Servlet,具有增删改查的操作。实现登录身份验证,防止非法登录,防止多点登录,记住用户名密码功能。

Redis: commandes d'action pour les données de type chaîne
随机推荐
C language,%d% Difference between 2D%2d%02d
Why don't I have a rookie medal
Common plug-ins for vite project development
Vite project commissioning
allegro,orcad, net alias,port,off-page connector之间的异同点和如何选取
Analysis of the characteristics of page owner
信创产业现状、分析与预测
MongoDB索引
[combinatorics] permutation and combination (examples of combinatorial number of multiple sets | three counting models | selection problem | combinatorial problem of multiple sets | nonnegative intege
Exercise 10-3 recursive implementation of exponential functions
npm install卡住与node-npy的各种奇怪报错
7-8 overspeed judgment
Scroll detection, so that the content in the lower right corner is not displayed at the top of the page, but is displayed as the mouse slides
Programmable logic device software testing
[acnoi2022] guess numbers
牛客网:过河卒
C library function - qsort()
etcd集群权限管理和账号密码使用
Redis:字符串类型数据的操作命令
Function calling convention