Sie sind auf Seite 1von 28

10/22/2019 How to Setup an Email Server on CentOS 7

Want your very own server? Get our 1GB memory, Xeon V4, 20GB SSD VPS for £10.00 /
month.

Get a Cloud Server

HostPresto! > Community > Tutorials > How to Setup an Email Server on CentOS 7

Liptan Biswas

How to Setup an Email Server on


CentOS 7
19th July 2016  176,459k

In this tutorial we are going to learn how to set up an Email server using Post x, Dovecot and
Squirrelmail on CentOS 7.x. We will be using Post x for SMTP (Simple Mail Transfer Protocol),
Dovecot for POP/IMAP and Squirrelmail as webmail client to send or receive emails. We will also
learn to setup MX records which is important to route the emails.

Requirements
The requirements for setting up email server will simply be a VPS or dedicated server with a fresh
CentOS 7.x install and also a static IP address. In this tutorial we will be using a root account to

https://hostpresto.com/community/tutorials/how-to-setup-an-email-server-on-centos7/ 1/28
10/22/2019 How to Setup an Email Server on CentOS 7

execute the commands. If you are logged in as non-root user, use sudo command at the start of all
the commands or you can execute su command to login as root user.

Setting up DNS
It is very important to setup DNS records, speci cally MX records in your domain control panel.
Login to your domain control panel and change your DNS settings to add these following MX
records entries. A typical MX record will look like this.

Type Host Destination Priority TTL


MX @ mail.yourdomain.com 10 3600
A mail 192.168.0.1 3600

Where MX is the type of record, MX stands for Mail Exchangers. Next is the value for host, you can
either enter your domain name or you can also use @ which represents the value of the zone name
which is same as your domain name. Next you will have to choose the destination, you will need to
enter the hostname or FQDN of your mail server.

The next value is the priority. The lowest number is priority. For example 0 will have the highest
priority and 20 will have a lower priority. Priority is used because we can add multiple MX records
for a single domain, mail is forwarded to the server having highest priority. If the server having
highest priority is not available then mail will be forwarded to the server having second highest
priority. Next is TTL or Time to Live, it should be set to 3600.

It is very important that you also setup an A record for your hostname of the mail server FQDN.
Again select the type as A record, host should be the hostname you are using in your FQDN, for
example in this case we have used the hostname as mail.yourdomain.com, hence our host will be
mail. Next, at destination, enter the IP address of your server. A records does not have priority
option hence, you will only need to provide TTL.

Once you have con gured your DNS settings, you will need to wait some time so that DNS gets
propagated. It usually takes around two hours these days. Once propagated, you can check your

https://hostpresto.com/community/tutorials/how-to-setup-an-email-server-on-centos7/ 2/28
10/22/2019 How to Setup an Email Server on CentOS 7

MX records here.

Until your DNS gets propagated, you can continue with the installation.

Installing Post x
Login to your server and run the following command to update the repository and packages
available in your system.

yum -y update

Now update the hostname of your system to the FQDN you want to use with your mail server. Run
the following command to change your hostname.

hostname mail.yourdomain.com

You can replace the hostname according to your choice, but it should be same as the FQDN which
we have used in our DNS settings.

Now add the hostname entry in the host les of your system. Edit /etc/hosts les using your
favorite editor. For example if your are using nano then you will need to run the following
command.

nano /etc/hosts

You will see two lines of entries in there, append your server IP address followed by hostname at
the end of the le. It should look like the one shown below.

127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain


1 l lh t l lh t l ld
https://hostpresto.com/community/tutorials/how-to-setup-an-email-server-on-centos7/
i l lh t6 l lh t6 l ld i 3/28
10/22/2019 How to Setup an Email Server on CentOS 7
::1 localhost localhost.localdomain localhost6 localhost6.localdomain
104.36.18.239 mail.yourdomain.com

Now we can install Post x, enter the following command to do so.

yum -y install postfix

Before con guring post x we will need to con gure SSL which will be used to encrypt and secure
the emails.

mkdir /etc/postfix/ssl
cd /etc/postfix/ssl

Now we will have to create SSL certi cates. If you do not have openssl installed you can install it
using the following command.

yum -y install openssl

Now run the following command to create certi cate and key les.

openssl req -x509 -nodes -newkey rsa:2048 -keyout server.key -out server.cr

Now you will be asked some information which is to be added into your CSR (Code Signing
Request). You will be asked your country name in two letters, for example consider IN for India.

https://hostpresto.com/community/tutorials/how-to-setup-an-email-server-on-centos7/ 4/28
10/22/2019 How to Setup an Email Server on CentOS 7

Then you will be asked about the state or province. Then you will be asked about your city and
organization. Finally, a common name of your server and your email address. If you want to leave
some details blank use full stop or period ( . ) sign. You can also enter the default values just by
pressing enter. Example output is given below.

Generating a 2048 bit RSA private key


..........................+++
...........................+++
writing new private key to 'server.key'
-----
You are about to be asked to enter information that will be incorporated
into your certificate request.
What you are about to enter is what is called a Distinguished Name or a DN.
There are quite a few fields but you can leave some blank
For some fields there will be a default value,
If you enter '.', the field will be left blank.
-----
Country Name (2 letter code) [XX]:IN
State or Province Name (full name) []:RAJ
Locality Name (eg, city) [Default City]:

Organization Name (eg, company) [Default Company Ltd]:


Organizational Unit Name (eg, section) []:My Unit
Common Name (eg, your name or your server's hostname) []:mail.rackvoucher.c
Email Address []:me@liptanbiswas.com

This will generate the key le and certi cates and will save then in /etc/postfix/ssl directory.

Now edit post x con guration le which can be found at /etc/postfix/main.cf, with your
favorite editor.

nano /etc/postfix/main.cf

https://hostpresto.com/community/tutorials/how-to-setup-an-email-server-on-centos7/ 5/28
10/22/2019 How to Setup an Email Server on CentOS 7

and append these lines at the end of the le.

myhostname = mail.yourdomain.com
mydomain = yourdomain.com
myorigin = $mydomain
home_mailbox = mail/
mynetworks = 127.0.0.0/8
inet_interfaces = all
inet_protocols = all
mydestination = $myhostname, localhost.$mydomain, localhost, $mydomain
smtpd_sasl_type = dovecot
smtpd_sasl_path = private/auth
smtpd_sasl_local_domain =
smtpd_sasl_security_options = noanonymous
broken_sasl_auth_clients = yes
smtpd_sasl_auth_enable = yes
smtpd_recipient_restrictions = permit_sasl_authenticated,permit_mynetworks,
smtp_tls_security_level = may
smtpd_tls_security_level = may
smtp_tls_note_starttls_offer = yes
smtpd_tls_loglevel = 1
smtpd_tls_key_file = /etc/postfix/ssl/server.key
smtpd_tls_cert_file = /etc/postfix/ssl/server.crt
smtpd_tls_received_header = yes

smtpd_tls_session_cache_timeout = 3600s
tls_random_source = dev:/dev/urandom

Now open another con guration le /etc/postfix/master.cf using your favorite editor.

nano /etc/postfix/master.cf

and nd the following lines in the con guration le.

https://hostpresto.com/community/tutorials/how-to-setup-an-email-server-on-centos7/ 6/28
10/22/2019 How to Setup an Email Server on CentOS 7

# service type private unpriv chroot wakeup maxproc command + args


# (yes) (yes) (yes) (never) (100)
# =========================================================================
smtp inet n - n - - smtpd

Now add the following lines at just below these lines.

submission inet n - n - - smtpd


-o syslog_name=postfix/submission
-o smtpd_sasl_auth_enable=yes
-o smtpd_recipient_restrictions=permit_sasl_authenticated,reject
-o milter_macro_daemon_name=ORIGINATING
smtps inet n - n - - smtpd
-o syslog_name=postfix/smtps
-o smtpd_sasl_auth_enable=yes
-o smtpd_recipient_restrictions=permit_sasl_authenticated,reject
-o milter_macro_daemon_name=ORIGINATING

Installing Dovecot
Now install Dovecot using the following command:

yum -y install dovecot

Once Dovecot is installed, edit the following le using your favorite editor.

nano /etc/dovecot/conf.d/10-master.conf

https://hostpresto.com/community/tutorials/how-to-setup-an-email-server-on-centos7/ 7/28
10/22/2019 How to Setup an Email Server on CentOS 7

and nd the following lines:

# Postfix smtp-auth

Now Append the following lines, just below these lines:

# Postfix smtp-auth
unix_listener /var/spool/postfix/private/auth {
mode = 0660
user = postfix
group = postfix
}

Now open another con guration using the following command.

nano /etc/dovecot/conf.d/10-auth.conf

and nd the following lines.

# Space separated list of wanted authentication mechanisms:


# plain login digest-md5 cram-md5 ntlm rpa apop anonymous gssapi otp skey
# gss-spnego
# NOTE: See also disable_plaintext_auth setting.
auth_mechanisms = plain

Append login at the end of the line auth_mechanisms = plain to make it look like

https://hostpresto.com/community/tutorials/how-to-setup-an-email-server-on-centos7/ 8/28
10/22/2019 How to Setup an Email Server on CentOS 7

auth_mechanisms = plain login

Again edit /etc/dovecot/conf.d/10-mail.conf le using your favorite editor.

nano /etc/dovecot/conf.d/10-mail.conf

Find the following lines

#
#
#mail_location =

Now add the following line just below these lines:

mail_location = maildir:~/mail

Now edit /etc/dovecot/conf.d/20-pop3.conf using your favorite editor.

nano /etc/dovecot/conf.d/20-pop3.conf

and nd the following lines.

#pop3_uidl_format = %08Xu%08Xv

https://hostpresto.com/community/tutorials/how-to-setup-an-email-server-on-centos7/ 9/28
10/22/2019 How to Setup an Email Server on CentOS 7

Uncomment the above line to make it look like as shown below.

# Note that Outlook 2003 seems to have problems with %v.%u format which was
# Dovecot's default, so if you're building a new server it would be a good
# idea to change this. %08Xu%08Xv should be pretty fail-safe.
#
pop3_uidl_format = %08Xu%08Xv

Now restart post x, and dovecot using the following command.

systemctl restart postfix


systemctl enable postfix
systemctl restart dovecot
systemctl enable dovecot

Now if you have a rewall running you will need to allow port number 25, 587, 465, 110, 143, 993,
995 and 80. All the ports except 80 are used to send and receive emails and port 80 is used to
make HTTP connections. HTTP connections will be used to access Squirrelmail using web interface.

To unblock all these ports from rewall, run the following commands.

firewall-cmd --permanent --add-service=smtp


firewall-cmd --permanent --add-port=587/tcp
firewall-cmd --permanent --add-port=465/tcp
firewall-cmd --permanent --add-port=110/tcp
firewall-cmd --permanent --add-service=pop3s
firewall-cmd --permanent --add-port=143/tcp
firewall-cmd --permanent --add-service=imaps
firewall-cmd --permanent --add-service=http
firewall-cmd --reload

https://hostpresto.com/community/tutorials/how-to-setup-an-email-server-on-centos7/ 10/28
10/22/2019 How to Setup an Email Server on CentOS 7

Testing Post x and Dovecot


You can check if Post x is working by executing the following command in your terminal.

telnet mail.yourdomain.com smtp

If you do not have telnet installed, then you can run the following command to install telnet.

yum -y install telnet

Once you are connected using telnet you will see following output.

Trying ::1...
Connected to localhost.
Escape character is '^]'.
220 mail.rackvoucher.com ESMTP Postfix

Now you can also send email using telnet. Use the following command to enter the sender
username.

mail from:

To enter the email of recipient, you can use the use the following command.

rcpt to:

https://hostpresto.com/community/tutorials/how-to-setup-an-email-server-on-centos7/ 11/28
10/22/2019 How to Setup an Email Server on CentOS 7

To enter the body of email, enter the following command.

data

Once you have entered your message, enter dot (.) to nish the message. Finally enter quit to exit
telnet.

To test Dovecot, enter the following command.

telnet mail.yourdomain.com pop3

You will see following output,

Trying 104.36.18.239...
Connected to mail.rackvoucher.com.
Escape character is '^]'.
+OK Dovecot ready.

It tells that Dovecot is working ne, you can login to your mail account by providing login
command, then use pass command to enter your password. To view the mails in your account,
use retr command.

user mailuser
+OK
pass Password
+OK Logged in.
retr
-ERR There's no message 1.
quit

https://hostpresto.com/community/tutorials/how-to-setup-an-email-server-on-centos7/ 12/28
10/22/2019 How to Setup an Email Server on CentOS 7

+OK Logging out.


Connection closed by foreign host.

Installing Squirrelmail
As we have both Post x and Dovecot working, we can now install Squirrelmail to your server.
Squirrelmail does not comes with the default CentOS repository, hence you will need to add EPEL
repository into your system using the following command.

yum -y install epel-release

Now you can install Squirrelmail using the following command.

yum -y install squirrelmail

After installing Squirrelmail you can con gure it by running the con guration script.

cd /usr/share/squirrelmail/config/
./conf.pl

You will see following output.

SquirrelMail Configuration : Read: config.php (1.4.0)


---------------------------------------------------------
Main Menu --
1. Organization Preferences

https://hostpresto.com/community/tutorials/how-to-setup-an-email-server-on-centos7/ 13/28
10/22/2019 How to Setup an Email Server on CentOS 7

2. Server Settings
3. Folder Defaults
4. General Options
5. Themes
6. Address Books
7. Message of the Day (MOTD)
8. Plugins
9. Database
10. LanguagesD. Set pre-defined settings for specific IMAP serversC Turn
S Save data
Q Quit
Command >>

In Option 1 you can change your organisation preferences. It is recommended to change it


according to your organisation in production environment. If you choose option 1, you will see
following output.

SquirrelMail Configuration : Read: config.php (1.4.0)


---------------------------------------------------------
Organization Preferences
1. Organization Name : SquirrelMail
2. Organization Logo : ../images/sm_logo.png
3. Org. Logo Width/Height : (308/111)
4. Organization Title : SquirrelMail $version
5. Signout Page :
6. Top Frame : _top
7. Provider link : http://squirrelmail.org/
8. Provider name : SquirrelMailR Return to Main Menu
C Turn color off
S Save data
Q Quit
Command >>

https://hostpresto.com/community/tutorials/how-to-setup-an-email-server-on-centos7/ 14/28
10/22/2019 How to Setup an Email Server on CentOS 7

Change the organisation name, logo and title according to your need. Once done, return to main
menu using R command. In main menu choose option 2 for Server settings.

SquirrelMail Configuration : Read: config.php (1.4.0)


---------------------------------------------------------
Server SettingsGeneral
-------
1. Domain : localhost
2. Invert Time : false
3. Sendmail or SMTP : SendmailA. Update IMAP Settings : localhost
B. Change Sendmail Config : /usr/sbin/sendmailR Return to Main Menu
C Turn color off
S Save data
Q Quit
Command >> 1

Change your domain name by selecting option 1.

The domain name is the suffix at the end of all email addresses. If for ex
[localhost]: yourdomain.com

Now change your MTA by selecting the 3rd option.

SquirrelMail Configuration : Read: config.php (1.4.0)


---------------------------------------------------------

Server SettingsGeneral
-------
1. Domain : rackvoucher.com
2. Invert Time : false
3. Sendmail or SMTP : SendmailA. Update IMAP Settings : localhost
https://hostpresto.com/community/tutorials/how-to-setup-an-email-server-on-centos7/ 15/28
10/22/2019 How to Setup an Email Server on CentOS 7
3. Se d a o S : Se d a p
. Update Sett ggs : oca ost
B. Change Sendmail Config : /usr/sbin/sendmailR Return to Main Menu
C Turn color off
S Save data
Q QuitCommand >> 3You now need to choose the method that you will use for
messages in SquirrelMail. You can either connect to an SMTP server
or use sendmail directly.
1. Sendmail 2. SMTP Your choice [1/2] [1]: 2

Now save your setting by giving S command and nally quit using Q command.

Now you will need to install the Apache web server, so that we can access Squirrelmail using web
interface. Run the following command to install Apache web server.

yum -y install httpd

Once Apache is installed, edit the con guration le to add a new virtual host.

nano /etc/httpd/conf/httpd.conf

Now add the following lines at the end of the le.

Alias /webmail /usr/share/squirrelmailOptions Indexes FollowSymLinks


RewriteEngine On
AllowOverride All
DirectoryIndex index.php
Order allow,deny
Allow from all

https://hostpresto.com/community/tutorials/how-to-setup-an-email-server-on-centos7/ 16/28
10/22/2019 How to Setup an Email Server on CentOS 7

Save the le and start and enable Apache web server using the following commands.

systemctl start httpd


systemctl enable httpd

Now create email users, run the following command to add a user.

useradd -m liptan -s /sbin/nologin


passwd liptan

Theabove command will add a new user liptan and the attribute -s /sbin/nologin will deny
login using SSH. Last command will create a password for the new user.

Now you can browse Squirrelmail by going to following link into the browser.

http:///webmail

You will see following screen.

Once you login you will see the following webmail interface.

You can now read your emails and send emails through this interface.

Conclusion
In this tutorial we have installed an email server, using Post x, Dovecot and the Squirrelmail
webmail client. You can now successfully deploy the email server and start sending via the mail
server.

https://hostpresto.com/community/tutorials/how-to-setup-an-email-server-on-centos7/ 17/28
10/22/2019 How to Setup an Email Server on CentOS 7

Liptan Biswas

Want your very own server? Get our 1GB memory, Xeon V4, 20GB SSD VPS for £10.00 /
month.

View Plans

Related Posts

How to Setup Your iPhone for Email Access

https://hostpresto.com/community/tutorials/how-to-setup-an-email-server-on-centos7/ 18/28
10/22/2019 How to Setup an Email Server on CentOS 7

How to Setup your Android for Email Access

What are my Email Server Login Details?

https://hostpresto.com/community/tutorials/how-to-setup-an-email-server-on-centos7/ 19/28
10/22/2019 How to Setup an Email Server on CentOS 7

How to Install and Secure ProFTPD Server on CentOS 7

Comments

29 Comments hostpresto.com 
1 Login

 Recommend t Tweet f Share Sort by Best

Join the discussion…

LOG IN WITH
OR SIGN UP WITH DISQUS ?

Name

M Bogdan • 3 years ago


Hi, you are missing the <directory>...</directory> directives in /etc/httpd/conf/httpd.conf


https://hostpresto.com/community/tutorials/how-to-setup-an-email-server-on-centos7/ 20/28
10/22/2019 How to Setup an Email Server on CentOS 7

2△ ▽ • Reply • Share ›

Faress ElFarissi > M Bogdan • 3 months ago


Thanks
△ ▽ • Reply • Share ›

tr@5h## > M Bogdan • 9 months ago


Very good ... tnks,
this is very helpfull.
△ ▽ • Reply • Share ›

Jr Programmer > M Bogdan • 2 years ago


Thanks for the hint, otherwise the server wont start.
△ ▽ • Reply • Share ›

google-ff2446c0e5ab4f2c7e7cbc720db9c2ba • a year ago


Thanks for the detailed guideline! I really need this!
Anyway, sorry to annoy you but I'm totally a newbie here. At the first step checking DNS
propagation on mxtoolbox.com, while the DNS Record is OK, I came into a "No DMARC Record
found". Is it necessary to setup this DMARC thing? How?
1△ ▽ • Reply • Share ›

Jose Vicente Núñez Delgado • 3 months ago


I have problems with the login, I put the newly created username and password and it does not
work. What could it be?
△ ▽ • Reply • Share ›

Chris C • 9 months ago • edited


I'm now facing the following warning and error when trying to start httpd:

Starting httpd: [Wed Jan 23 16:47:36 2019] [warn] The Alias directive in /etc/httpd/conf/httpd.conf
at line 1014 will probably never match because it overlaps an earlier Alias.
Syntax error on line 1017 of /etc/httpd/conf/httpd.conf:
AllowOverride not allowed here
[FAILED]

Is there anything wrong / missing in the Alias statement given above, by any chance?
I noticed a line break was needed for "Options Indexes FollowSymLinks"

[SOLVED] The <directory> lines were missing. The Alias should be stated as follows
(without the space between '<' and 'Directory'):
Alias /webmail /usr/share/squirrelmail
< Directory /usr/share/squirrelmail>
https://hostpresto.com/community/tutorials/how-to-setup-an-email-server-on-centos7/ 21/28
10/22/2019 How to Setup an Email Server on CentOS 7
y / / / q
Options Indexes FollowSymLinks
RewriteEngine On
AllowOverride All
DirectoryIndex index.php
Order allow,deny
Allow from all
< /Directory>

You can then open the webmail through http://yourdomain.test/webmail

Now I'm not sure why I still get this warning but it doesn't seem to disturb the webmail:
[warn] The Alias directive in /etc/httpd/conf/httpd.conf at line 1014 will probably never match
because it overlaps an earlier Alias.
△ ▽ • Reply • Share ›

Jeffrey Lyne • 9 months ago


If you can send but not receive emails after using this guide check your aliases to make sure your
emails are not being redirected to root.
/var/log/maillog
/etc/aliases
△ ▽ • Reply • Share ›

Rizwan Ali • a year ago


Thank you , Liptan Biswas for your great post,
I have some issues that you mentioned in post that append these lines, so what that means , i
mean those line which you mentioned mostly already in files, but commented, so please clear me
that weather i should uncomment or add your mentioned lines again in the said file.
△ ▽ • Reply • Share ›

Charlie Yang • 2 years ago • edited


Thank you, Liptan Biswas, for a such well written instruction.

I am having some issues with httpd/Apache won't start. I have CentOS 7 the latest build with the
Everything package with Server option installed, fresh install, but couldn't get it going. Errors out
with Failed to start the Apache Httpd. Wondering is anyone can pointing me to the right direction.
Manual install of Apache won't start either. Thanks.

Update:
reinstall Apache http server worked. Thanks
△ ▽ • Reply • Share ›

Jr Programmer • 2 years ago


Thanks for this excellent tutorial, long time I wanted to experiment with mail server. your post is an
fantastic step by step guide that I was looking for.
△ ▽ • Reply • Share ›

snoopygh • 2 years ago


https://hostpresto.com/community/tutorials/how-to-setup-an-email-server-on-centos7/ 22/28
10/22/2019 How to Setup an Email Server on CentOS 7

What if you have already installed vpssim on the cent Os, how do you configure hostpresto on it?
△ ▽ • Reply • Share ›

Democrat Terrorist • 2 years ago


Hi. Thanks for awesome tutorial Liptan. one problem, i am unable to send email outside of my
own domain.
it throws Relay Access Denied error.
△ ▽ • Reply • Share ›

Your Videos • 2 years ago


hello i had an error like this "telnet: connect to address 102.35.18.239: Connection refused
" how can i do ?i try to change ip but it still error. Please help me
△ ▽ • Reply • Share ›

Jr Programmer > Your Videos • 2 years ago • edited


Try to port forward ports like 110, 143, 587, ...etc in your router to the computer/server that
is hosting the mail server.

then use this tool to verify open ports https://www.yougetsignal.co...


△ ▽ • Reply • Share ›

Michael Hall • 2 years ago


Worked first time, brilliant! Thank you so much
△ ▽ • Reply • Share ›

Nur Sakibul Huda • 2 years ago


Hi I'm getting this error after modifying main.cf file:
Job for postfix.service failed. See 'systemctl status postfix.service' and 'journalctl -xn' for details.

The journalctl -xn says the following:

Aug 07 17:39:08 mail.xyz.org postfix/postfix-script[10396]: fatal: unable to create missing queue


directories
Aug 07 17:39:08 mail.xyz.org postfix/postfix-script[10397]: fatal: Postfix integrity check failed!
Aug 07 17:39:08 mail.xyz.org systemd[1]: postfix.service: control process exited, code=exited
status=1
Aug 07 17:39:08 mail.xyz.org systemd[1]: Failed to start Postfix Mail Transport Agent.

Please help me resolve the issue.


△ ▽ • Reply • Share ›

tanvirul islam • 2 years ago


i am having issue with the smtp. when i use "telnet mydomain.com pop3", it is working exactly
shown above but when i try to use "telnet mydomain.com smtp", it says "telnet: connect to
address 123.456.789.12: Connection refused" i have disabled the firewall but still facing the same
issue. any solution??
△ ▽ • Reply • Share ›
https://hostpresto.com/community/tutorials/how-to-setup-an-email-server-on-centos7/ 23/28
10/22/2019 How to Setup an Email Server on CentOS 7

The_Don_Himself > tanvirul islam • 2 years ago


I had this problem too, but first, this is one awesome tutorial, thanks Liptan!

Now to solve this issues, please note a small error but the writer in

sudo vi /etc/postfix/main.cf

inet_interfaces = all
inet_protocols = all
inet_interfaces = localhost

inet_interfaces = all is overwritten by localhost binding it to localhost. Delete or uncomment


that line, then restart postfix.

sudo systemctl restart postfix

Cheers!
△ ▽ • Reply • Share ›

Дарко Максимовић > The_Don_Himself • a year ago


Thank you buddy! All that copying/pasting, I could hardly read what I was doing.
You did a great job doing it instead of everybody else. Worked for me, now telnet
connects. Thanks mate
△ ▽ • Reply • Share ›

ArafatX > The_Don_Himself • 2 years ago


Doesn't work.
△ ▽ • Reply • Share ›

ali > ArafatX • 2 years ago


Try removing the white spaces. If you begin a line with white spaces, the
exe assume this is a continuation of the previous line.
△ ▽ • Reply • Share ›

Liptan > tanvirul islam • 2 years ago


Try disabling SELinux
△ ▽ • Reply • Share ›

love guru • 3 years ago


Hello, dear special thanks to give this tutorial .God bless.
△ ▽ • Reply • Share ›

Noel Becks • 3 years ago


Your love for Cento OS7 is really admirable and enviable. Your knowledge of it is likewise
respected. Liptan I may be new to this OS but I've catched the cento fever right now and I want to
try put everything I've learned on here myself. Thanks for making me love what you love. Its really
admirable.
https://hostpresto.com/community/tutorials/how-to-setup-an-email-server-on-centos7/ 24/28
10/22/2019 How to Setup an Email Server on CentOS 7

△ ▽ • Reply • Share ›

Warrick Philip Shannon • 3 years ago


Hey Liptan, your knowledge on this topic seems incredibly deep! Thanks for the code and
pointers. This tutorial makes it easy for anyone to install an email server, using Postfix, Dovecot
and the Squirrelmail webmail client!

Thanks for posting


△ ▽ • Reply • Share ›

Emmanuel Babatunde • 3 years ago


Hello Liptan Biswas, I really appreciate this Fantastic article; right level of depth and explanation. I
am new to
setting up mail servers on centos 7, and this article was incredibly
helpful. Now have a working mail server for JIRA to use; Thanks for the Great tutorial!
△ ▽ • Reply • Share ›

Ishem DIB • 3 years ago


hi, thank you for the detailed explanation, what easier way to deploy
mail server on linux, I had in mind for some time to install an email
server on my machine but I abandoned that idea thinking it was some complicated
thing, your tutorial proved me wrong and now I'll do it knowing that some
command line are sufficient
△ ▽ • Reply • Share ›

Chris C • 9 months ago • edited


Hello,

Great, clear guide but I'm stuck at the testing stage after the Dovecot installation. :-(

After running telnet mail.domain.test smtp I get the following output:


Trying 10.0.2.15...
Connected to mail.domain.test.
Escape character is '^]'.
Connection closed by foreign host.

In /var/log/maillog you can see the following corresponding log entries:


Jan 23 12:43:32 mail postfix/smtpd[3189]: fatal: unexpected command-line argument: submission
Jan 23 12:43:33 mail postfix/master[3151]: warning: process /usr/libexec/postfix/smtpd pid 3189
exit status 1
Jan 23 12:43:33 mail postfix/master[3151]: warning: /usr/libexec/postfix/smtpd: bad command
startup -- throttling

The pop3 and imap telnet seem to work fine.

Note: I'm setting this up on a CentOS 6.10 (not 7).

Any help appreciated. Thanks!


https://hostpresto.com/community/tutorials/how-to-setup-an-email-server-on-centos7/ 25/28
10/22/2019 How to Setup an Email Server on CentOS 7

[SOLVED] My bad... that's because I left a few blank spaces between the line start and
"submission". Didn't know those config files cared about spaces at the beginning.
△ ▽ 1 • Reply • Share ›

ALSO ON HOSTPRESTO.COM

8 Advantages of Hosting on a Linux Server Attracting Freelance Clients: Where to Find


1 comment • 2 years ago Work
Solarvps — Thanks for sharing this 8 1 comment • 2 years ago
Avataradvantages of Linux cloud server through your Cody Deegan — This article is indeed very
valuable blog post. I must say, this post will be Avatarhelpful for freelancers like me. Here in the
Philippines, most of the Freelancers prefer to

8 Great Resources for Dropshippers 7 Tips for Gaining Upvotes on Reddit


1 comment • 2 years ago 2 comments • 2 years ago
Lyu Hey — You should include AliDropship Niño Regala — Is buying upvotes a good
Avatarplugin in this list, because it worth attention Avatarchoice? I had been seeing a lot of services such
as this one. https://upvotes.io/buy-redd...

HostPresto! Were known as Dream Hosting (dream-hosting.co.uk) until June 2014

© HostPresto 2019 All Rights Reserved

ACCOUNT & HELP

My HostPresto
Help
Community
Contact

https://hostpresto.com/community/tutorials/how-to-setup-an-email-server-on-centos7/ 26/28
10/22/2019 How to Setup an Email Server on CentOS 7

COMPANY

About
Articles
Blog
Terms
Privacy Policy
Sitemap

SERVICES

Web Hosting
Wordpress Hosting
Magento Hosting
Reseller Hosting
Domain Names
Cloud Servers
Email Hosting
Hosted Apps
SSL Certi cates
cPanel Hosting
Website Builder
Free Charity Hosting
Free Open Source Project Hosting
FileMaker Hosting
Plesk Hosting
Windows Hosting
ASP Hosting
Node.js Hosting
Serif WebPlus Hosting

THINGS OF INTEREST
23rd Aug 2019
New Website, New Packages and New Prices Coming Soon

11th Apr 2019


Brexit Hosting - For those needing EU located data
https://hostpresto.com/community/tutorials/how-to-setup-an-email-server-on-centos7/ 27/28
10/22/2019 How to Setup an Email Server on CentOS 7

9th Apr 2019


Brexit Warning - .eu Domain names

https://hostpresto.com/community/tutorials/how-to-setup-an-email-server-on-centos7/ 28/28

Das könnte Ihnen auch gefallen