To Configure a Mail Server on RHEL v9 m/c ...
Mail erver

To Configure a Mail Server on RHEL v9 m/c ...

Mail Server is?a software program that sends and receives email. Often, it is used as a blanket term for both mail transfer agents (MTA) and mail delivery agents (MDA) Within the Internet email system, a message transfer agent, or mail transfer agent, or mail relay is software that transfers electronic mail messages from one computer to another using the Simple Mail Transfer Protocol.

mail server setup requirement

  • launch a machine on AWS by redhat image

No alt text provided for this image

  • add port in aws security (smtp=25, imap=143, pop3=110)

No alt text provided for this image

  • set a hostname # hostnamectl set-hostname mail.shubhamgupta.online

No alt text provided for this image

Rhel 9 EPEL configure

# dnf install https://dl.fedoraproject.org/pub/epel/epel-release-latest-9.noarch.rpm -y

No alt text provided for this image

  • DNS configure By the help of Route53 AWS service

No alt text provided for this image

  • entry in aws name server in hostinger child nameserver

No alt text provided for this image

#?yum install bind bind-utils -y

No alt text provided for this image

# nslookup mail.shubhagupta.online

No alt text provided for this image

# yum install postfix telnet s-nail -y

# systemctl enable --now postfix

No alt text provided for this image

# yum install vim wget -y

#?vim /etc/postfix/main.cf

No alt text provided for this image
No alt text provided for this image
No alt text provided for this image
No alt text provided for this image
No alt text provided for this image

# systemctl status postfix

No alt text provided for this image

# systemctl restart?postfix

yum install -y dovecot

# systemctl enable --now dovecot

# vim /etc/dovecot/dovecot.conf

?^ protocols = imap pop3 lmtp submission

No alt text provided for this image

# vim /etc/dovecot/conf.d/10-mail.conf

?^??mail_location = maildir:~/Maildir

No alt text provided for this image

# vim /etc/dovecot/conf.d/10-master.conf

?^?unix_listener /var/spool/postfix/private/auth {

No alt text provided for this image

??mode = 0660

??user = postfix

??group = postfix}

#vim /etc/dovecot/conf.d/10-auth.conf

No alt text provided for this image

?^ disable_plaintext_auth = no

# systemctl restart dovecot

# useradd shubham

# useradd gaurav

# passwd shubham

# passwd gaurav

No alt text provided for this image

# wget

https://downloads.sourceforge.net/project/squirrelmail/stable/1.4.22/squirrelmail-webmail-1.4.22.tar.gzmv squirrelmail-webmail-1.4.22/* .

# yum install httpd -y

No alt text provided for this image

# cd /var/www/html/

# tar -xvf /root/squirrelmail-webmail-1.4.22.tar.gz

# mv squirrelmail-webmail-1.4.22/* .

No alt text provided for this image

# yum install perl -y

# ./configure


redhat test page show becoz you have this squirrelmail script in php so you have to uinstall php v7.4

No alt text provided for this image

# systemctl restart httpd

# cd

# setenforce 0

# yum install -y https://rpms.remirepo.net/enterprise/remi-release-9.rpm

# rpm -Uvh https://dl.fedoraproject.org/pub/epel/epel-release-latest-9.noarch.rpm

# yum install -y https://rpms.remirepo.net/enterprise/remi-release-9.rpm

# yum module list php

# yum module enable php:remi-7.4 -y

# php -v

# yum install -y php php-cli php-common

No alt text provided for this image

# yum module list php

# yum module enable php:remi-7.4

cd /var/www/html/

No alt text provided for this image
you can't login the mail server becoz you have to make Dir where mail are save

# systemctl restart httpd

# systemctl restart postfix

# systemctl restart dovecot

cd /var/local/

# mkdir -p squirrelmail/data

# chown -R apache squirrelmail/

No alt text provided for this image
my mail server successfully configure my mail server

# systemctl restart httpd

# systemctl restart postfix

# systemctl restart dovecot


I want to Secure my mail-server

# yum install certbot python3-certbot-apache mod_ssl -y

# systemctl restart httpd

**** if you want to SSL/TLS?of ypur domain then you will have to do virtual host of your mail server ************

# vim /etc/httpd/conf.d/mail.conf

?^ <virtualhost *:80>

??servername mail.shubhamgupta.online

??documentroot /var/www/html

??RewriteEngine on

??RewriteCond %{SERVER_NAME} =mail.shubhamgupta.online

??RewriteRule ^ https://%{SERVER_NAME}%{REQUEST_URI} [END,NE,R=permanent]

??</virtualhost>

# vim mail-le-ssl.conf

??^ <IfModule mod_ssl.c>

???<virtualhost *:443>

???servername mail.shubhamgupta.online

???documentroot /var/www/html

SSLCertificateFile /etc/letsencrypt/live/mail.shubhamgupta.online/fullchain.pem

? SSLCertificateKeyFile /etc/letsencrypt/live/mail.shubhamgupta.online/privkey.pem

???Include /etc/letsencrypt/options-ssl-apache.conf

???</virtualhost>

???</IfModule>

No alt text provided for this image

#??certbot?--apache

#??systemctl restart httpd


No alt text provided for this image

要查看或添加评论,请登录

Shubham Gupta的更多文章

  • MySQL Script on ubuntu-server

    MySQL Script on ubuntu-server

    set-hostname sudo hostnamectl set-hostname mysql_script.server hostname write a script in file name mysql_setup.

    1 条评论
  • Install and Secure Grafana on Ubuntu 20.04

    Install and Secure Grafana on Ubuntu 20.04

    1. Introduction To Grafana Grafana is an open-source platform for data visualization, monitoring and analysis.

  • NFS (Network File System)

    NFS (Network File System)

    Network File System allows a system to share directories and files with others over a network. By using NFS, users and…

    1 条评论
  • Difference B/w Apache webserver vs Nginx webserver ??

    Difference B/w Apache webserver vs Nginx webserver ??

    Comparision : Apache vs Nginx web-server..

社区洞察

其他会员也浏览了