Ferrets家的Wordpress

httpd_can_network_connect

CentOS下web服务器无法发送邮件的权限修复

2017年1月16日 by Ferrets Leave a Comment

不得不承认,不愧是服务器血统,这权限管理真的严格的,搭建好的owncloud报告没法发邮件,经过一番bing之后,找到了答案。

参考:http://stackoverflow.com/questions/25517281/swiftmailer-connection-could-not-be-established-with-host-smtp-gmail-com-conne

解决办法如下:

  1.  检查httpd_can_sendmail 是否设置为on
    getsebool httpd_can_sendmail
    • 如果返回的输出是 httpd_can_sendmail –> off , 运行
      setsebool -P httpd_can_sendmail 1
    • 如果你看到 httpd_can_sendmail –> on 那么跳到下一步
  2.  检查 httpd_can_network_connect 是否为on
    getsebool httpd_can_network_connect
    • 如果返回的输出是 httpd_can_network_connect –> off ,运行
      setsebool -P httpd_can_network_connect 1
    • 如果你看到 httpd_can_network_connect –> on 那么就跳到下一步
  3. 在服务器地址直接填ip而不是域名。

第三步感觉是另外的问题,而不是SELinux的权限阻止了邮件发送。

Posted in: 搭建服务 Tagged: Apache, CentOS, http, httpd_can_network_connect, httpd_can_sendmail, php, SELinux, smtp, web, 权限

日历

2021年4月
一二三四五六日
 1234
567891011
12131415161718
19202122232425
2627282930 
« 2月    

分类

  • Android
  • docker
  • Linux
  • OpenWrt
  • PHP
  • RaspberryPi
  • RouterOS
  • Windows
  • 吐槽
  • 搭建服务
  • 未分类
  • 生活
  • 网络

近期文章

  • windows无法解析域名
  • 在openwrt路由上运行shairplay作为远程音箱
  • 建立私有docker镜像源
  • RouterOS上抵挡扫描的防火墙策略
  • Windows Server作为Mikrotik设备管理员的3A服务器
  • 使用ipv6连接Proxmox VE
  • 根据audit.log来放通SELinux的拦截
  • 使用PXE从NFS服务器启动Debian Linux
  • 在运行ArchlinuxARM的PogoPlug上打开CPU的AES硬件加速
  • 增大mysql/mariadb的最大连接数

友链

  • ntzyz's space
  • Openwrt中文论坛
  • SNGR
  • Trevikids行止由心
  • 煎蛋

文章归档

功能

  • 登录
  • 条目feed
  • 评论feed
  • WordPress.org

Copyright © 2021 Ferrets家的Wordpress.

Beta WordPress Theme by themehall.com