top of page
liresfisigquiphras

How I Set Up a Postfix and Dovecot Email Server Without MySQL on Debian 7 in Less Than an Hour



Dovecot is a POP3 and IMAP server, which provides email clients with access to emails on the server. It also acts as the Local Delivery Agent (LDA), which takes email from Postfix (or other MTA / mail server software) and stores them.


Configure the Postfix email server to check each email with a score > 5.0, mark it as SPAM, and send it directly to the junk folder. Add or adjust the following lines inside /etc/spamassassin/local.cf to setup your anti-spam rules:




how to set up an email server with postfix and dovecot without MySQL on Debian 7




Postfix has several hundred configuration parameters. If you want to administer a mail server that reliably delivers business requirements to a sizable organization, you should make yourself intimate with all of them (man 5 postconf). This tutorial will not be enough, on its own, to make you a competent professional email admin. However, if you want to become familiar with postfix or set up a mail server for yourself and a few friends, this tutorial, and the ones to follow, will be your friend.


This article is part 1 of this tutorial series. In this article, I will show you how to set up a very basic Postfix SMTP server, also known as an MTA (message transport agent). Once you finish this article, you should be able to send and receive emails with your own email domain on your own email server. This tutorial is tested on Ubuntu 22.04, Ubuntu 20.04, and Ubuntu 18.04 server.


I am new to the idea of email server setup I wanted to understand the logic to create a FQDNi have a ubuntu machine with machine name as mb and my domain from go daddy is mb.inthen what should be my FQDN mb.in or mb.mb.in or mail.mb.in.


Hi XiaoGreat tutorials, first of all!I am just going through now.need some light, anyway:I set up few accounts by inserting manualy into mysql a username and an encrypted passwd.How can I create new accounts without typing into mysql?How can I recover or change a password?Thanks!


I need to take back the offer of posting neccessary changes to the apparmor profiles. The postfix profiles work out of the box, and the dovecot profiles were removed in debian buster, and I suspect also in ubuntu 20.04.


The official manpage indicates that the directions found in this and many other tutorials on OpenDKIM are flawed. The contents of the InternalHosts file should be more akin to postfix mynetworks. That is, IP addresses or IP ranges (CIDRs), not hostnames. The list should consist of hosts that may relay email through this host and, as it passes through, the relayed email is what gets digitally signed by this host. The contents of the ExternalIgnoreList file indicates hosts that may send on behalf of any of the domains in SigningTable without being logged in the log file. That is, ExternalIgnoreList just suppresses warnings in the log.


I always try to find a second, in-depth tutorial when doing stuff like this. That way I can spot the differences and pick the best options instead of just following along verbatim. I use MySQL with postfix + dovecot, so I have to adapt tutorials like these anyway.


Over a decade ago I wanted to turn my Debian server into a mail server with virus scanning, spam detection, email forwarding, POP3 and IMAP access and a webmail service. All the components were available but it took me quite a while until they worked properly together. So I summed up my desk full of scrawly notes into a tutorial that has become pretty famous over ten years ago. This document is not a simple copy-and-paste tutorial where you just copy the commands from the web site and run it on your server and hope they will work. Instead it will make you understand the different components that you are setting up. In the end you will be skilled enough to debug problems yourself. Unlike many other Postfix tutorials on the internet this is already the seventh edition. Writing this tutorial took a lot of work so these are not just quick draft notes thrown together but a consistent document guiding you. The whole tutorial is split into several pages. Please use the links on the right side to navigate through the pages. You are also invited to comment on the pages or ask questions. Just use the comment feature at the bottom of each page.


Now onto the more complex question. I am wanting to split the server into three logical services, filtering, postfix+dovecot, and datastore. Is it fairly easy to split the three functions out like that, and also is it worth the hassle of having the three separate functions on separate servers? I hope that makes sense.


So basically, how would I setup what I wrote in the last paragraph without losing existing data? I don't have much received emails on the server, but losing data is bad practice and preventing it is always nice.


Modoboa is a modular open-source mail server and management platform that integrates with well-known software such as Postfix or Dovecot. A SQL database (MySQL, PostgreSQL, or SQLite) is used as a central point of communication between all components. As a result, you are able to create your own dependable and secure email server.


MXToolbox Test - Open MX Lookup Page, provide your domain name, and click MX Lookup Button. It will perform MX lookup and shows the MX record details. Now click the Find Problems Button. It will show the problems associated with your email server. You may further fine-tune your email server in case errors or warnings are listed by MXToolbox.


Now, let us get to the mail configuration file: /etc/dovecot/conf.d/10-mail.conf This file manages the way Dovecot interacts with the server file system to store and extract mail. Find the following commands and uncomment them.


This tutorial shows how to prepare a Debian 10 server (with Apache2, BIND, Dovecot) for the installation of ISPConfig 3.2, and how to install ISPConfig. The web hosting control panel ISPConfig 3 allows you to configure the following services through a web browser: Apache or nginx web server, Postfix mail server, Courier or Dovecot IMAP/POP3 server, MySQL, BIND or MyDNS nameserver, PureFTPd, SpamAssassin, ClamAV, and many more. This setup covers Apache (instead of nginx), BIND, and Dovecot.if(typeof ez_ad_units!='undefined')ez_ad_units.push([[728,90],'howtoforge_com-box-3','ezslot_12',106,'0','0']);__ez_fad_position('div-gpt-ad-howtoforge_com-box-3-0');1 Preliminary NoteIn this tutorial, I will use the hostname server1.example.com with the IP address 192.168.0.100 and the gateway 192.168.0.1. These settings might differ for you, so you have to replace them where appropriate. Before proceeding further you need to have a minimal installation of Debian 10. This might be a Debian minimal image from your Hosting provider or you use the Minimal Debian Server tutorial to set up the base system.if(typeof ez_ad_units!='undefined')ez_ad_units.push([[728,90],'howtoforge_com-medrectangle-3','ezslot_11',121,'0','0']);__ez_fad_position('div-gpt-ad-howtoforge_com-medrectangle-3-0');All commands below are run as root user. Either log in as root user directly or log in as your normal user and then use the commandsu -to become root user on your server before you proceed. IMPORTANT: You must use 'su -' and not just 'su', otherwise your PATH variable is set wrong by Debian.2 Install the SSH server (Optional)If you did not install the OpenSSH server during the system installation, you can do it now:apt-get install ssh openssh-serverFrom now on you can use an SSH client such as PuTTY and connect from your workstation to your Debian 9 server and follow the remaining steps from this tutorial.(adsbygoogle=window.adsbygoogle[]).push();3 Install a shell text editor (Optional)We will use nano text editor in this tutorial. Some users prefer the classic vi editor, therefore we will install both editors here. The default vi program has some strange behavior on Debian and Ubuntu; to fix this, we install vim-nox:apt-get install nano vim-noxIf vi is your favorite editor, then replace nano with vi in the following commands to edit files.4 Configure the HostnameThe hostname of your server should be a subdomain like "server1.example.com". Do not use a domain name without subdomain part like "example.com" as hostname as this will cause problems later with your mail setup. First, you should check the hostname in /etc/hosts and change it when necessary. The line should be: "IP Address - space - full hostname incl. domain - space - subdomain part". For our hostname server1.example.com, the file shall look like this:nano /etc/hosts127.0.0.1 localhost.localdomain localhost192.168.0.100 server1.example.com server1# The following lines are desirable for IPv6 capable hosts::1 localhost ip6-localhost ip6-loopbackff02::1 ip6-allnodesff02::2 ip6-allroutersThen edit the /etc/hostname file:if(typeof ez_ad_units!='undefined')ez_ad_units.push([[580,400],'howtoforge_com-medrectangle-4','ezslot_2',108,'0','0']);__ez_fad_position('div-gpt-ad-howtoforge_com-medrectangle-4-0');nano /etc/hostnameIt shall contain only the subdomain part, in our case:server1Finally, reboot the server to apply the change:systemctl rebootLog in again and check if the hostname is correct now with these commands:hostnamehostname -fThe output shall be like this:[email protected]:/tmp# hostnameserver1[email protected]:/tmp# hostname -fserver1.example.com5 Update your Debian InstallationFirst, make sure that your /etc/apt/sources.list contains the buster/updates repository (this makes sure you always get the newest security updates), and that the contrib and non-free repositories are enabled as some required packages are not in the main repository.nano /etc/apt/sources.listdeb buster main contrib non-freedeb-src buster main contrib non-freedeb -security buster/updates main contrib non-freedeb-src -security buster/updates main contrib non-freeRun:apt-get updateTo update the apt package databaseapt-get upgradeand to install the latest updates (if there are any).6. Change the Default Shell/bin/sh is a symlink to /bin/dash, however we need /bin/bash, not /bin/dash. Therefore, we do this:dpkg-reconfigure dashUse dash as the default system shell (/bin/sh)? CREATE DATABASE phpmyadmin;Then create a new user:MariaDB [(none)]> CREATE USER 'pma'@'localhost' IDENTIFIED BY 'mypassword';Replace the word mypassword with a secure password of your choice in the commands above and below, use the same password both times. Then grant the user access to this database and reload database permissions.MariaDB [(none)]> GRANT ALL PRIVILEGES ON phpmyadmin.* TO 'pma'@'localhost' IDENTIFIED BY 'mypassword' WITH GRANT OPTION;MariaDB [(none)]> FLUSH PRIVILEGES;MariaDB [(none)]> EXIT;Finally, load the SQL tables into the database:mysql -u root -p phpmyadmin $cfg['Servers'][$i]['controlhost'] = 'localhost';$cfg['Servers'][$i]['controlport'] = '';$cfg['Servers'][$i]['controluser'] = 'pma';$cfg['Servers'][$i]['controlpass'] = 'mypassword';/* Storage database and tables */$cfg['Servers'][$i]['pmadb'] = 'phpmyadmin';$cfg['Servers'][$i]['bookmarktable'] = 'pma__bookmark';$cfg['Servers'][$i]['relation'] = 'pma__relation';$cfg['Servers'][$i]['table_info'] = 'pma__table_info';$cfg['Servers'][$i]['table_coords'] = 'pma__table_coords';$cfg['Servers'][$i]['pdf_pages'] = 'pma__pdf_pages';$cfg['Servers'][$i]['column_info'] = 'pma__column_info';$cfg['Servers'][$i]['history'] = 'pma__history';$cfg['Servers'][$i]['table_uiprefs'] = 'pma__table_uiprefs';$cfg['Servers'][$i]['tracking'] = 'pma__tracking';$cfg['Servers'][$i]['userconfig'] = 'pma__userconfig';$cfg['Servers'][$i]['recent'] = 'pma__recent';$cfg['Servers'][$i]['favorite'] = 'pma__favorite';$cfg['Servers'][$i]['users'] = 'pma__users';$cfg['Servers'][$i]['usergroups'] = 'pma__usergroups';$cfg['Servers'][$i]['navigationhiding'] = 'pma__navigationhiding';$cfg['Servers'][$i]['savedsearches'] = 'pma__savedsearches';$cfg['Servers'][$i]['central_columns'] = 'pma__central_columns';$cfg['Servers'][$i]['designer_settings'] = 'pma__designer_settings';$cfg['Servers'][$i]['export_templates'] = 'pma__export_templates';I've marked the lines in red which I've edited. Replace mypassword with the password that you've chosen for the phpmyadmin user. Note that the // in front of the lines have been removed as well!19 Install RoundCube Webmail (optional)In this chapter, we will install the RoundCube webmail client. First, we have to create the database for Roundcube manually as there is currently an issue in the RoundCube Debian installer which causes it to fail to create the database automatically. Run this command to create the database:echo "CREATE DATABASE roundcube;" mysql --defaults-file=/etc/mysql/debian.cnfThen install RoundCube with this command:apt-get install roundcube roundcube-core roundcube-mysql roundcube-pluginsThe installer will ask the following questions:Configure database for roundcube with dbconfig.common? 2ff7e9595c


1 view0 comments

Recent Posts

See All

Comments


bottom of page