Sendmail is a MTA (Mail Transfer Agent) server used for transferring email from between different hosts. Sendmail uses SMTP (Simple Mail Transfer Protocol) protocol. Most of the system administrators preferred to use Sendmail server as MTA than other MTAs.
RHEL 5 or its earlier versions were using Sendmail as a default mail server, But newer version’s of RHEL based systems adapted postfix as a default mail server. Most of the users are familiar with Sendmail and want to use it with version 6 also. This article will help users for installing Sendmail server on RHEL 7/6/5 or with minimal configuration.
1. Install Sendmail
If you don’t have installed Sendmail using the following command to install Sendmail with other required packages using yum package manager.
yum install sendmail sendmail-cf m4
2. Configure Sendmail Server
Before starting configuration we must know about various Sendmail configuration files exists in /etc/mail directory.
2.1 Comment out below line in
dnl DAEMON_OPTIONS(`Port=smtp,Addr=127.0.0.1, Name=MTA')dnl
2.2 Add this line also in sendmail.mc above ‘MAILER’ option
FEATURE(`relay_hosts_only')dnl
2.3 Add your PC’s full hostname in this file.
hostname >> /etc/mail/relay-domains
3. Recompile Sendmail Configuration
m4 ia a macro processor to compile the Sendmail configuration files. m4 is stream-based, that is, it doesn’t understand about lines.
m4 /etc/mail/sendmail.mc > /etc/mail/sendmail.cf
Restart Sendmail service
/etc/init.d/sendmail restart
4. Configure Domain-based E-mail Routing
As we read above that virtusertable file used for aliasing, allowing multiple virtual domains to be hosted on one machine.
1. All emails addressed to @example.com domain delivered to support@mydomain.com
@example.com support@mydomain.com
2. All emails addressed to support@mydomain.com will forward to local user jack.
support@mydomain.com jack
3. All emails addressed to @mydomain.com will forward to domain @otherdomain.com with corresponding usernames.
@mydomain.com %1@otherdomain.com
4. All emails addressed to @otherdomain.com will be rejected my mail server with acknowledging sender with the message
@otherdomain.com error:nouser User unknown
After making all changes in virtusertable execute following command to create updated virtusertable.db file containing the new configuration.
makemap hash /etc/mail/virtusertable < /etc/mail/virtusertable
Now restart Sendmail service
/etc/init.d/sendmail restart
Thanks for reading this article. I hope this article will help you to configure Sendmail on CentOS and Red Hat systems.
References:
http://www.sendmail.com/
::...
免责声明:
当前网页内容, 由 大妈 ZoomQuiet 使用工具: ScrapBook :: Firefox Extension 人工从互联网中收集并分享;
内容版权归原作者所有;
本人对内容的有效性/合法性不承担任何强制性责任.
若有不妥, 欢迎评注提醒:
或是邮件反馈可也:
askdama[AT]googlegroups.com
订阅 substack 体验古早写作:
点击注册~> 获得 100$ 体验券:
关注公众号, 持续获得相关各种嗯哼:
自怼圈/年度番新

关于 ~ DebugUself with DAMA ;-)
粤ICP备18025058号-1
公安备案号: 44049002000656 ...::