Configure Email Server using PostFix, Dovecot and Squirrel Mail in RHEL 7 (CentOS 7)| Nehra Classes
HTML-код
- Опубликовано: 26 авг 2024
- Configure Webmail/Dovecot Mail Server in RHEL 7 (CentOS 7):
==================================================
POSTFIX for SMTP (Simple Mail Transfer Protocol): Used for Sending the Emails.
DOVECOT for POP3 (Post Office Protocol): Used for Receiving the Emails.
SQUIRRELMAIL for IMAP (Internet Message Access Protocol): Used for Front Web End Mail Client.
===
Server Configuration: RHEL 7
IP Address: 192.168.1.104
===
1. Set the hostname in the machine.
hostnamectl set-hostname rhel7.nehraclasses.local
Add hostname entries in /etc/hosts file as shown below:
vim /etc/hosts
Add the following
192.168.1.104 rhel7.nehraclasses.local rhel7
2. Disable or make permissive the SELINUX
setenforce 0
getenforce
3. Install EPEL Repository:
wget dl.fedoraproje...
rpm -ivh epel-release-latest-7.noarch.rpm
yum install -y epel-release
4. Allow the Apache default port 80 through your firewall/router:
firewall-cmd --permanent --add-port=80/tcp
Reload firewall using command:
firewall-cmd --reload
5. Install the Postfix Package.
yum install postfix -y
6. Configuring PostFix
vim /etc/postfix/main.cf
Line no 77 - Uncomment and set your mail server FQDN ##
myhostname = rhel7.nehraclasses.local
Line 85 - Uncomment and Set domain name ##
mydomain = nehraclasses.local
Line 101 - Uncomment ##
myorigin = $mydomain
Line 115 - Uncomment and Set ipv4 ##
inet_interfaces = all
Line 121 - Change to all ##
inet_protocols = all
Line 166 - Comment ##
#mydestination = $myhostname, localhost.$mydomain, localhost,
Line 167 - Uncomment ##
mydestination = $myhostname, localhost.$mydomain, localhost, $mydomain
Line 266 - Uncomment and add IP range ##
mynetworks = 192.168.1.0/24, 127.0.0.0/8
Line 421 - Uncomment ##
home_mailbox = Maildir/
Save and exit the file.
Start/restart Postfix service now:
systemctl restart postfix
systemctl enable postfix
7. Test the Postfix Server:
Add the user account.
useradd nehra
passwd nehra
Install Telnet Package
yum install -y telnet
Check telnet
telnet localhost smtp
Type the commands:
ehlo localhost
mail from:nehra
rcpt to:vikasnehra
data
welcome to Postfix Mail Server
.
quit
ll /home/vikasnehra/Maildir/new/
Open the file with name using cat.
8. Install Dovecot Package
yum install -y dovecot
Configure Dovecot
vim /etc/dovecot/dovecot.conf
Line 24 - umcomment ##
protocols = imap pop3 lmtp
Edit file /etc/dovecot/conf.d/10-mail.conf file
vim /etc/dovecot/conf.d/10-mail.conf
Line 24 - uncomment ##
mail_location = maildir:~/Maildir
Edit /etc/dovecot/conf.d/10-auth.conf
vim /etc/dovecot/conf.d/10-auth.conf
And make the changes as shown below:
line 10 - uncomment##
disable_plaintext_auth = yes
Line 100 - Add the word: "login" ##
auth_mechanisms = plain login
Edit file /etc/dovecot/conf.d/10-master.conf,
vim /etc/dovecot/conf.d/10-master.conf
Make changes as shown below:
Line 91, 92 - Uncomment and add "postfix"
#mode = 0600
user = postfix
group = postfix
[...]
Start Dovecot service:
systemctl start dovecot
systemctl enable dovecot
Testing Dovecot
telnet localhost pop3
user vikasnehra
pass
retr 1
.
quit
9. Install Squirrel mail Package
yum install squirrelmail
Configuring Squirrel-Mail
cd /usr/share/squirrelmail/config/
./conf.pl
Enter 1
Enter 1 and change the organization Name
Press S
Press R for previous menu
Enter 2 for Server settings
Press 1
and type: rhel7.local (Name of Domain)
Press 3
Press 2 for switching from Send Mail to SMTP
Type S and Press Q for quit
10. Create a squirrelmail vhost in apache config file:
vim /etc/httpd/conf/httpd.conf
Enter the following:
Alias /webmail /usr/share/squirrelmail
Directory /usr/share/squirrelmail
Options Indexes FollowSymLinks
RewriteEngine On
AllowOverride All
DirectoryIndex index.php
Order allow,deny
Allow from all
/Directory
systemctl restart httpd
systemctl enable httpd
Enter the following command:
setsebool httpd_can_network_connect=1
Open Web Browser and type in address bar the following. And Use User Credentials to Login.
192.168.1.104/webmail
Your Dovecot Server is working.
===
Visit FB Page for Complete Steps:
/ nehraclasses
===
Thanks for watching the video. Please like our videos, share with your friends and feel free to ask anything, post your queries in comments section. We will be glad to answer your queries. Don't forget to subscribe the channel & turn on the bell notifications.
===============
Our Some Popular Videos:
Yum Server Configure in RHEL 7:
• Configure Local Yum Re...
Learn Linux Fundamentals:
• Learn Linux Fundamenta...
Concept of All RAID Levels:
• Session-31 | Concept o...
LVM Snapshot:
• Session-30 | Logical V...
============
©COPYRIGHT. ALL RIGHTS RESERVED.
#NehraClasses #LinuxTraining #MailServer
For complete steps kindly visit below link 👇
m.facebook.com/story.php?story_fbid=1542507319261849&id=856141747898413
on of the best mail server tutorial thank you so much sir
🙏
@@NehraClasses i want to course from you how can please advice im from bangladesh
Please ping me on whatsapp at +91-9410219232
Very impressive
Thanks
Very good explanation bro.
Thanks
Thank you- so useful
Glad it was helpful!
@@NehraClasses If i send an email it is not coming to the inbox, what to do?
Please check your facebook page inbox, I sent problem.
Nyc sir
Thanks
Thanks
Hi Sir, I have followed each and every steps, but I am facing the permission issue while opening it in
the browser: Forbidden...you dont have the permision to open /webmail...please help me.
Please share the logs and error screenshot in the telegram group
I'm not understanding what you did in /etc/dovecot/conf.d/10-auth.conf at the "auth_mechanisms" line. Did you add something or comment it out or just leave it? Also, in 10-master.conf your "mode" is configured differently in your notes than the file you saved; which one is right?
actually youtube doesn't allow to write angle brackets in video description, please check pinned comment for the same or get the step from our telegram group. The steps which are shown in video are correct.
This mail configuration is used for the domain user on same network? There is any settings for client side for mail?
No
I have a problem to install squirrelmail can you please help me.
I configured yum for local. Now I can install packages in offline, but it doesn't work for online packages.
Hello sir i am using squirrelmail server in ubuntu 18, i am able to send messages and it shows in INBOX. Sent. But i am not able to receive mail and others to. How to solve it.
So how to solve it
Please provide us all the details in our telegram channel
sir , i got error on rcpt to:
550 5.1.1 : Recipient address rejected: User unknown in local recipient table
Do you have this user account in your server?
/etc/postfix/main.cf: parameter mail_owner: unknown user name value: postfix myhostname = > how to fix this error ? any help
Please join our channel membership and provide us error screenshot in telegram.
How to Create an Outgoing Mail Relay with Postfix and SpamAssassin?
Will you make a tutorial for it?
yes we can, please provide us all details in telegram.
@@NehraClasses Which type of details, do you want?
Like OS: CentOS 7
Mail Server: Postfix, Dovecot, Rainloop and Spamassassin
Here's the details, no more than these needed to setup Outgoing Mail Relay...
What about sending mails to Gmail
What our postfix video
Plz do a video on samba as PDC
I have already uploaded videos on Samba
Hi Sir,
The video is really nice . I have a different requirement I need to sent a mail to my organisation mail id from my linux Server. Do you have any content for that
Let me check
# yum install squirrelmail
this command is not applicable dependencies are not apply it , support it to do this lab
Did u configure additional repositories?
Please ping me on 9410219232 or join our telegram channel for quicker response.
today i done this lab on new centos7 VM , sophos firewall issue myside to download squirrelmail dependencies , thks sir for ur kindest support , good luck sir for rest of the future videos
Thanks a lot 🙏
I am not getting the mail from when running retr 1 getting there's no message though I checked in maildir/new there is a mail and I uncommented this line mail_location = maildir:~/Maildir. Can you help me please
please post your questions in the telegram group.
@@NehraClasses can you send me the link of telegram class
Thank you- so useful
Thanks