How to Quickly Set up a Mail Server on Ubuntu 18.04 with Modoboa

This tutorial is going to show you how to quickly set up your own email server on Ubuntu 18.04 with Modoboa, which is a free and open source mail hosting and management platform designed to work with Postfix SMTP server and Dovecot IMAP/POP3 server.

Modoboa is written in Python, released under the terms of ISC license. The latest version is v1.12.2, released on October 19, 2018. Main features of Modoboa are as follows:

  • Compatible with Postfix and Dovecot.
  • Support MySQL/MariaDB, or PostgreSQL database.
  • Includes a webmail client and web-based admin panel.
  • Easily create unlimited mailboxes and unlimited mail domains in a web-based admin panel.
  • The webmail client provides an easy-to-use message filter to help you organize messages to different folders.
  • Modoboa uses Nginx web server.
  • It can help you protect your domain reputation by monitoring email blacklists and generating DMARC report, so your emails have better chance to land in inbox instead of spam folder.
  • Includes amavis frontend to block spam and detect virus in email.
  • Calendar and address book.
  • Integration with Let’s Encrypt.

Prerequisites

To set up a complete email server with Modoboa, you need a server with at least 2GB RAM. After the installation, your server will use more than 1GB of RAM. This tutorial is done on a $10/month Linode VPS (virtual private server). I recommend Linode because it doesn’t block port 25, so you can send unlimited emails with no extra cost. Other VPS providers like DigitalOcean blocks port 25 and you will need to set up SMTP relay to bypass port 25 blocking, which can cost you additional money. Once you have a VPS, install Ubuntu on it and follow the instructions below. You also need to have a domain name. I registered my domain name from NameCheap because the price is low and they give whois privacy protection free for life.

It is recommended that you follow the instructions below on a clean install of Ubuntu 18.04 system.

Also, make sure your server IP address isn’t listed in any email blacklist. You can go to mxtoolbox.com and dnsbl.info to check your server IP address. If it’s in a blacklist, you can delete your VPS instance in Linode and create a new one. As Linode uses an hourly billing model, you won’t be charged by month, but by how many hours you used, which makes it convenient to delete a VPS instance at any time.

Step 1: Creating DNS MX Record

The MX record specifies which host or hosts handle emails for a particular domain name. For example, the host that handles emails for linuxbabe.com is mail.linuxbabe.com. If someone with a Gmail account sends an email to [email protected], then Gmail server will query the MX record of linuxbabe.com. When it finds out that mail.linuxbabe.com is responsible for accepting email, it then query the A record of mail.linuxbabe.com to get the IP address, thus the email can be delivered.

In your DNS manager, create a MX record for your domain name. Enter @ in the Name field to represent the main domain name, then enter mail.your-domain.com in the Value field.

modoboa web interface

Note: The hostname for MX record can not be an alias to another name. Also, It’s highly recommended that you use hostnames, rather than bare IP addresses for MX record.

Your DNS manager may require you to enter a preference value (aka priority value). It can be any number between 0 and 65,356. A small number has higher priority than a big number. You can enter 0 for your email server, or accept the default value.

After creating MX record, you also need to create an A record for mail.your-domain.com , so that it can be resolved to an IP address. If your server uses IPv6 address, be sure to add AAAA record.

If you uses Cloudflare DNS service, you should not enable the CDN feature when creating A record for your mail server.

Step 2: Set up Mail Server on Ubuntu 18.04 with Modoboa Installer

SSH into your server, then update software packages.

sudo apt update

sudo apt upgrade

Download modoboa installer from Github.

git clone https://github.com/modoboa/modoboa-installer

Modoboa is written in Python. Run the following command to install the necessary Python software.

sudo apt-get install python-virtualenv python-pip

Then navigate to the modoboa-installer directory and create a configuration file. Replace example.com with your own domain name.

cd modoboa-installer

sudo ./run.py --stop-after-configfile-check example.com

modoboa mail server

Edit the configuration file installer.cfg with a command line text editor like nano.

sudo nano installer.cfg

To obtain a valid TLS certificate from Let’s Encrypt for your mail server, in [certificate] section, change the value of type from self-signed to letsencrypt.

type = letsencrypt

And change the email address from [email protected] to your real email address, which will be used for account recovery and important notifications.

modoboa installer

Save and close the file. Now run the following command to start the installation.

sudo ./run.py --interactive example.com

install modoboa ubuntu

The installation process can take a while. It took 20 minutes on my server. After Modoboa finishes installation, you can log into the admin panel with username admin and password password.

modoboa mail server ubuntu 18.04

Once you are logged in, you should go to Admin -> Settings -> Profile to change the password.

modoboa install

Step 3: Adding Mailboxes in Modoboa Admin Panel

Go to Domains tab and click Add button to add a new domain.

modoboa review

Then enter your main domain name in the Name field. It is highly recommended that you enable DKIM signing, which can help with your domain reputation. In Key selector filed, you can enter a random word like modoboa.  Choose 2048 as the key length.

adding domain name in modoboa

In the next screen, you can choose to create an admin account for your domain. The SMTP protocol requires that a mail server should have a [email protected] address.

modoboa postmaster account

Click the Submit button and your domain name will be added in Modoboa.

To add email addresses, go to Domains tab and click your domain name.

add mailboxes in modoboa

Then click mailboxes.

adding email addresses in modoboa

Click Add button and choose Account.

modoboa alias

Then choose Simple user as the role. Enter an email address in Username field and enter a password.

qucikly set up an email server modoboa

In the next screen, you can optionally create an alias for this email address.

create alias in modoboa

After clicking the submit button, the email address is created.

Step 4: Sending Test Emails

To login to the webmail, you need to log out the admin account first and then enter the user credentials.

modoboa login

Once you are logged into Modoboa webmail, you can send a test email from your private email server to your other email address and vice versa.

modoboa webmail

Inbound emails will be delayed for a few minutes, because by default Modoboa enables greylisting, which tells other sending SMTP server to try again in a few minutes. This is useful to block spam. The following message in /var/log/mail.log indicates greylisting is enabled.

postfix/postscreen[20995]: NOQUEUE: reject: RCPT from [34.209.113.130]:36980: 450 4.3.2 Service currently unavailable;
If your hosting provider or ISP blocks port 25, then you can’t send emails directly. You can set up SMTP relay to solve this problem.

The following message in /var/log/mail.log indicates port 25 is blocked.

Nov 3 10:43:43 mail postfix/smtp[9969]: connect to gmail-smtp-in.l.google.com[74.125.200.27]:25: Connection timed out
Nov 3 10:44:13 mail postfix/smtp[9969]: connect to gmail-smtp-in.l.google.com[2404:6800:4003:c03::1b]:25: Connection timed out

Step 5: Using Mail Clients on Your Computer or Mobile Device

Fire up your desktop email client such as Mozilla Thunderbird and add a mail account.

  • In the incoming server section, select IMAP protocol, enter mail.your-domain.com as the server name, choose port 993 and SSL/TLS. Choose normal password as the authentication method.
  • In the outgoing section, select SMTP protocol, enter mail.your-domain.com as the server name, choose port 587 and STARTTLS. Choose normal password as the authentication method.

modoboa mail server desktop mail client configuration

You can also use IMAP on port 143 with STARTTLS encryption.

Step 6: Improving Your Email Server Reputation

To prevent your emails from being flagged as spam, you should set PTR, SPF, DKIM and DMARC records.

PTR record

A pointer record, or PTR record, maps an IP address to a FQDN (fully qualified domain name). It’s the counterpart to the A record and is used for reverse DNS lookup, which can help with blocking spammers. Many SMTP servers reject emails if no PTR record is found for the sending server.

To check the PTR record for an IP address, run this command:

dig -x IP-address +short

or

host IP-address

Because you get IP address from your hosting provider or ISP, not from your domain registrar, so you must set PTR record for your IP in the control panel of your hosting provider or ask your ISP.  Its value should be your mail server’s hostname: mail.your-domain.com. If your server uses IPv6 address, be sure to add a PTR record for your IPv6 address as well.

To edit the reverse DNS record for your Linode server, log into Linode control panel, select your server and the networking tab. Click the 3 dots and Edit RDNS.

mail server ptr record

SPF Record

SPF (Sender Policy Framework) record specifies which hosts or IP address are allowed to send emails on behalf of a domain. You should allow only your own email server or your ISP’s server to send emails for your domain. In your DNS management interface, create a new TXT record like below.

modoboa spf record

Explanation:

  • TXT indicates this is a TXT record.
  • Enter @ in the name field to represent the main domain name.
  • v=spf1 indicates this is a SPF record and the version is SPF1.
  • mx means all hosts listed in the MX records are allowed to send emails for your domain and all other hosts are disallowed.
  • ~all indicates that emails from your domain should only come from hosts specified in the SPF record. Emails that are from other hosts will be flagged as forged.

To check if your SPF record is propagated to the public Internet, you can use the dig utility on your Linux machine like below:

dig your-domain.com txt

The txt option tells dig that we only want to query TXT records.

DKIM Record

DKIM (DomainKeys Identified Mail) uses a private key to digitally sign emails sent from your domain. Receiving SMTP servers verify the signature by using the public key, which is published in the DNS DKIM record.

When we were adding domain name in Moboboa admin panel earlier, we enabled DKIM signing, so the signing part is taken care of. The only thing left to do is creating DKIM record in DNS manager. First go to Modoboa admin panel and select your domain name. In the DNS section, click Show key button.

modoboa dkim signing

The public key will be revealed. There are two formats. We only need the Bind/named format.

modoboa dkim public key

Go to your DNS manager, create a TXT record, enter modoboa._domainkey in the Name field. (Recall that we used modoboa as the selector when adding domain name in the admin panel.) Copy everything in the parentheses and paste into the value field. Delete all double quotes. Your DNS manager may require you to delete other invalid characters, such as carriage return.

modoboa dkim format

For those who are interested, Modoboa uses OpenDKIM to generate private key for your domainkey and verify signatures of inbound emails.

DMARC Record

DMARC stands for Domain-based Message Authentication, Reporting and Conformance. DMARC can help receiving email servers to identify legitimate emails and prevent your domain name from being used by email spoofing.

To create a DMARC record, go to your DNS manager and add a TXT record. In the name field, enter _dmarc. In the value field, enter the following:

v=DMARC1; p=none; pct=100; rua=mailto:[email protected]

create dmarc record txt

The above DMARC record is a safe starting point. To see the full explanation of DMARC, please check the following article.

Step 7: Testing Email Score and Placement

After creating PTR, SPF, DKIM record, go to https://www.mail-tester.com. You will see a unique email address. Send an email from your domain to this address and then check your score. As you can see, I got a perfect score.

imporve email server reputation

Mail-tester.com can only show you a sender score. There’s another service called GlockApps that allow you to check if your email is placed in the recipient’s inbox or spam folder, or rejected outright. It supports many popular email providers like Gmail, Outlook, Hotmail, YahooMail, iCloud mail, etc

glockapps email placement test

Auto-Renew Let’s Encrypt TLS Certificate

Modoboa installed the latest version of Let’s Encrypt client (certbot) as /opt/certbot-auto. You can find the location of certbot binary by executing the following command.

sudo find / -name "*certbot*"

Let’s Encrypt TLS certificate is valid for 90 days. To automatically renew the certificate, edit root user’s crontab file.

sudo crontab -e

Add the following line at the end of this file.

@daily /opt/certbot-auto renew -q && systemctl reload nginx postfix dovecot

Save and close the file. This tells Cron to run the certbot renew command every day. If the certificate has 30 days left, certbot will renew it. It’s necessary to reload Nginx web server, Postfix SMTP server and Dovecot IMAP server so they can pick up the new certificate.

Host Multiple Domains in Modoboa

See the following article:

Enabling SMTPS Port 465

If you are going to use Microsoft Outlook client, then you need to enable SMTPS port 465 in Postfix SMTP server.

Setting Up Backup Mail Server

Your primary mail server could be down sometimes. If you host your mail server in a data center, then the downtime is very minimal, so you shouldn’t be worried about losing inbound emails. If you host your mail server at home, the downtime can’t be predicted so it’s a good practice for you to run a backup mail server in a data center to prevent losing inbound emails. The backup mail server needs just 512MB RAM to run. Please check the full detail in the following article.

I hope this tutorial helped you set up a mail server on Ubuntu 18.04 with Modoboa. As always, if you found this post useful, then subscribe to our free newsletter to get more tips and tricks. Take care 🙂

Rate this tutorial
[Total: 14 Average: 4.9]

172 Responses to “How to Quickly Set up a Mail Server on Ubuntu 18.04 with Modoboa

  • Mysterion
    9 months ago

    Thanks! Worked like a charm!

  • Thank you for very clear and concise tutorials! This is a very complex topic and you have a way of making it much more accessible. I would like to create a mail server on a virtual machine that I will create running 18.04 and I recently found your tutorial that I have been studying on using iRedMail on 16.04 (which I am sure would work on 18.04). What is your opinion on the comparison between Modoboa & iRedMail?

    • Yes, iRedMail works on Ubuntu 18.04 too.

      Both Modoboa and iRedMail make it easy to set up your own email server and host multiple mail domains on a single server.

      Modoboa is more easy to set up, because it has predefined configurations in the installer.cfg file and it integrates with Let’s Encrypt. So you have less work to do compared to iRedMail. If you are lazy, choose Modoboa.

      Other than that, they are very similar.

  • That is very helpful, thank you!

    • Camilo Montoya
      1 month ago

      Hello, I am really happy to find your tutorials, I already setup my own mail server following this tutorial, now I am sending emails without been flag as Spam and receiving emails from other accounts created on the same domain, thanks to you, I am just having some issues to receive emails from other servers like gmail. I tried to followed the tutorial step by step 3 times and I couldn’t. Do you have any idea how to identify the problem?

      • Check the /var/log/mail.log file. You will see logs of inbound and outbound emails. Find Gmail related lines in the file. If you can’t gmail.com, then Gmail can’t reach your mail server, which means either your MX record is incorrect, or there’s a firewall preventing access to port 25 on your mail server. If you host mail server at your home, be sure to set up port forwarding in your router.

  • Thanks for your great efforts.
    Did you ever experience issues establishing SSL with imap?

  • Correct – but there seems to be an cert issue regarding imap. So that I have to manually trust it in a mail client. Ever seen this one before and solved it without a reinstallation?

  • I tested Modoboa on two servers node – and your guide runs smooth on a fresh install.

    But that’s the thing.
    I tried to establish Let’s encrypt on an install that was setup on open ssl.
    Somehow 993 would still not be trusted though SMTP runs fine.

    I just was keen if you did find a way around the fresh install.

    • Sorry, but I don’t quite understand your situation.

      Are you saying Let’s Encrypt certificate is not trusted by mail client? Or you didn’t choose Let’s Encrypt in the installer.cfg file and now you want to install Let’s Encrypt certificate?

  • The later: I didn’t choose Let’s Encrypt in the installer.cfg file and now I want to install Let’s Encrypt certificate.

    • Please run the following command to install Let’s Encrypt client software (certbot).

      sudo add-apt-repository ppa:certbot/certbot
      sudo apt update
      sudo apt install certbot python3-certbot-nginx

      Then obtain and install a TLS certificate with the following command.

      sudo certbot --nginx --agree-tos --redirect --hsts --staple-ocsp --email [email protected] -d mail.your-domain.com

      Then edit Postfix configuration file.

      sudo nano /etc/postfix/main.cf

      Find the following two directives.

      smtpd_tls_cert_file=
      smtpd_tls_key_file=

      Add your certificate and private key.

      smtpd_tls_cert_file=/etc/letsencrypt/live/mail.your-domain.com/fullchain.pem
      smtpd_tls_key_file=/etc/letsencrypt/live/mail.your-domain.com/privkey.pem

      Save and close the file. Then edit Dovecot TLS configuration file.

       sudo nano /etc/dovecot/conf.d/10-ssl.conf

      Find the following two directives.

      ssl_cert = 
      ssl_key = 

      Add your certificate and private key.

      ssl_cert = </etc/letsencrypt/live/mail.your-domain.com/fullchain.pem
      ssl_key = </etc/letsencrypt/live/mail.your-domain.com/privkey.pem

      Save and close the file. Now reload Nginx, Postfix and Dovecot.

      sudo systemctl reload nginx postfix dovecot
  • That did it! – I somehow had dovecot pointing to the wrong directory.
    Thanks for your efforts Xiao Guo-An!

  • I’m having problems installing it a clean version of Ubuntu 18.04. It just stops during the installation of components right after installing modoboa. Any suggestions?

    Installing amavis
    Installing spamassassin
    Installing razor
    Installing clamav
    Installing modoboa

    [email protected]:~/modoboa-installer#

  • ihasaface
    7 months ago

    I followed step by step, but when it first asks me to go to mail.mydomain.com to login to modoboa, I only get a server not found error. Please help.

    • Perhaps a firewall is preventing access to port 80 or 443.

      • Ihasaface
        7 months ago

        No firewall, but I have ports 80 and 443 forwareded to my website server, on another IP address.

    • That’s the problem. The mail server needs its own web server and should be accessible from port 80 and 443.

    • Looks like you are setting up the mail server on your home network?

      • Ihasaface
        7 months ago

        Correct, I have a dedicated server which I already have a website actively hosted on, and I’m trying to get email going as well, with no success.

    • You need to set up a rule in your router that forward request to the IP address of the mail server if the request is meant for mail.your-domain.com.

      • Ihasaface
        7 months ago

        I already have ports 80 and 443 sent to my website server- can I somehow forward them to both servers?

    • If your router doesn’t have this capability, you can set up a reverse proxy on your website server. HAProxy is an open-source reverse proxy software that can redirect HTTP/HTTPS requests to different IP addresses by inspecting the domain name in HTTP header. Your router configuration stay the same.

      • ihasaface
        7 months ago

        So I did this install on the same server as my website, and I still can’t get past the part where I’m supposed to be able to get to a URL.

    • What does the browser say?

  • Ihasaface
    7 months ago

    Says the site cannot be reached

  • Ihasaface
    7 months ago

    I did and it is there… I do not understand this. Maybe I need to contact GoDaddy?

    • Yes, contact GoDaddy.

      • Ihasaface
        7 months ago

        Will do, thank you so much for your time. I’ll probably end up buying bugging you again after I talk to them!

    • Note that you need to create A record for both lexingtonitsolutions.com and mail.lexingtonitsolutions.com.

      • ihasaface
        7 months ago

        Looks like the A record is squared away, but it only brings me to my homepage for the website, while maintaining the mail.lexingtonitsolutions.com URL.

    • I see your lexingtonitsolutions.com website is using Apache web server. Modoboa installs Nginx web server, so the Nginx web server fails to start if Apache is already running on your server.

      One solution is to use Nginx instead of Apache for your lexingtonitsolutions.com website. It’s easy to create a Nginx virtual host for your WordPress site. Please see step 4 of this article: How to Install WordPress on Ubuntu 17.10 with Nginx, MariaDB, PHP7.1 (LEMP). When creating the virtual host file, just replace the domain name, the web root directory and the PHP socket file name.

      After that, stop Apache and restart Nginx.

      sudo systemctl stop apache2
      sudo systemctl disable apach2
      sudo systemctl start nginx

      You also need to enable HTTPS on the WordPress website. See this article: How to Properly Enable HTTPS on Nginx with Let’s Encrypt on Ubuntu 16.04/17.10

      • Ihasaface
        7 months ago

        I’d really rather not risk moving my website to the new server application… Is there any way to get an email server going with Apache?

        • You know you mentioned exactly nowhere that your method is not compatible with apache.

    • Yes, there are other ways.

      1.) Use Apache instead of Nginx as a reverse proxy to the back end Modoboa web app.
      2.) Use HAProxy as a reverse proxy to your WordPress site and the Modoboa web app.

      The details of which warrants another article.

  • ihasaface
    7 months ago

    Me again!
    So I started a fresh VM, forwarded all the ports to it, and was successful to the point of making my email address, and being able to successfully send an email. However, I cannot receive any. When I send an email from my gmail account, i receive the error:

    550 5.1.1 Recipient address rejected: undeliverable address: unknown user: “info”

    I’m so close! What is this, been at it for hours.

  • Starting…
    Overwrite the existing SSL certificate? (y/N) y
    Generating new self-signed certificate
    Installing amavis
    Amavis is not installed

    my installation stops on first package Amavis ? why is that

  • Dan Gibson
    6 months ago

    Followed your instructions verbatim… didn’t work 🙁

    • Dan Gibson
      6 months ago

      It would have been helpful to know about Apache vs. NGinX! I have an Apache server running and didn’t know (until I started reading through the comments) that the crap ran on NGINX!

  • Hi friend

    How to connect my domain to mail server in namecheap ?
    I have domain name in NameCheap and i have cloudflare account!

    • If you register domain name at NameCheap and uses Cloudflare’s DNS service, you need to create MX and other DNS records at Cloudflare, but remember you should not enable the CDN feature for your mail server.

      • Hi,

        Already, I completed the above mail configuration.
        but mail server, not working for outgoing and incoming mails.

        what wrong in my server ? please tell me

    • After you send an email from your mail server, please check the mail log (/var/log/mail.log) and after you send an email from another email address to your mail server, also check the mail log. You can know what’s going wrong from the log.

      • Hi Xiao Guo An,

        I see mail log in my server,

        My mail log says :

        Sometimes Connection refused,
        Sometimes Connection closed,
        Sometimes : (delivery temporarily suspended: connect to alt4.gmail-smtp-in.l.google.com[64.233.185.26]:25: Connection timed out)
        Sometimes Connection timed out.

        And

        i am using mail server ports : 587, 993.

        Port 25 is Blocked (i am already asked to ISP, my ISP not allowd 25 unblocking).

        In Modoboa admin panel all DNS records indicates are Green.
        MX, DNSBL, SPF, DKIM DMARC, autoconfig are in Green Highlight.

        what is the problem exactly in my website : mail.s46.win?

        • Krishna
          6 months ago

          and also Send button not working properly in Modoboa webmail !

    • If your ISP refuses to unblock port 25, you should set up SMTP relay to send outgoing email. See this article: https://www.linuxbabe.com/mail-server/postfix-smtp-relay

      In order to receive email from outside, you need to open port 25 on your firewall. If your mail server is at your home, then you also need to configure port forwarding for port 25.

      Your ISP usually blocks outbound connection on port 25, but allows inbound connection on port 25.

      • Hi Xiao Guo An,

        thank for your answers!

        Can i use port 26 instead of port 25 in my modoboa mail server ?

    • In order to delivery email, your mail server needs to hit the port 25 on the recipient’s mail server. They are listening on port 25 to receive incoming email. If your ISP blocks outbound port 25, you need to set up SMTP relay. The SMTP relay server need to hit port 25 on the recipient’s email server as well.

      In order to receive email, your mail server needs to listen on port 25 because SMTP clients expect you to listen on port 25.

      It’s SMTP standard. You can’t ask recipient’s mail server to change the listening port from 25 to another port. And if you change the listening port from 25 to another port on your own mail server, you won’t receive emails from others.

      • Hi Xiao Guo An,

        Thank you

        Ok, i will setup smtp or another ISP
        or i will request to my ISP to unblock port25.
        and
        How to remove modoboa mail server from my ubuntu ?

  • does smtp not work if it is not on smarttls? why I tried configuring an email in a panel my more the same only has tls protocol or ssl does not have starttls 🙁

    • The submission port 587 uses STARTTLS. If this doesn’t work, you can use port 465 with SSL/TLS for submission.

    • Hi,

      Thanks for your answers,

      How to use modoboa mail server for incoming and outgoing mails properly without port 25 ?

      If i use smtp relay its is limited per day 200 mails.

      Already i have namecheap hosting but its not sent more than 200 mails per day (this is my opinion only).

      I have 5000 customers, i need to send 5000 mails. I need a private server i choose my home server with ubuntu.

      I want how to use modobia mail server
      without 25 port or smtp relay.

      I am requested to my iso to unblock but, he is not convinced.

      I am using 587 and 993

      Please help me.

      • Hi Krishna,

        Diego is in a different situation than yours. Port 587 is a submission port for mail clients
        to submit emails to your mail server.

        After your mail server accepts mail submissions from mail clients, the mail server needs to use port 25 to send the email to the recipient’s mail server. If port 25 is blocked, you need to set up SMTP relay.

        In a nutshell, you have to use port 25 or smtp relay. There’s no other way. The SMTP relay service I mentioned allows you to send 200 emails per day for free. After that, you need to upgrade to a premium account to send more emails.

        If you don’t like paying an SMTP relay service, you can use VPS hosting that doesn’t block port 25, like Linode

        • Krishna
          6 months ago

          Hi Xiao Guo An,

          Thanks for your answers.

          1. Ssdnodes.com Prices are very low than linode.

          What is your opinion about ssdnodes. ?

          I don’t know ssdnodes.com port 25 is blocked or not. But, its very low price. It is better for me. At this time i am facing financial crises. And i need to run hosting and mail server.

          2. Amazon web services
          I try to install Modoboa into amazon ubuntu linux server (free tier) but it is not successful modoboa installing hang in middle of installation.

          AWS not worked for Modoboa mail server. I dont know What is the problem actually in AWS.

          Thank you

      • I haven’t used ssdnods.com hosting, so I can not say much about it. You can always ask them questions before buying their products.

        Make sure your AWS server has enough RAM (2GB) before installing Modoboa.

        • Krishna
          3 months ago

          Hi Admin,

          Can i host my website in my home pc desktop ubuntu 16.04
          (i am using pc desktop 4gb ram and 2.9 ghz cpu and 160gb hdd and os is ubuntu desktop 16.04), and i have opened port 80 and 443 isp. It is best or not ?

          If It is best for me, how to setup security for my home pc ?

        • Krishna
          2 months ago

          Hi,

          How to setup modoboa mail server with ubuntu 18.04, apache2, mariadb, Php and phpmyadmin ?

          I am already using amazon aws vps so, how to setup already i am used my own hosting at amazon aws vps ?

          please tell me !
          thanks for your previous answers !

        • Modoboa will install Nginx web server. If you have installed Apache web server already, you need to uninstall Nginx or Apache web server.

      • If you want to set up a production website, I would recommend you to host it in a data center, instead of hosting it at your home.

        To secure your website, first, you need to harden SSH server: 5 steps to harden SSH server on Ubuntu

        Then set up UFW firewall: Getting Started with UFW Firewall on Debian, Ubuntu, Linux Mint Server

        Next, set up a web application firewall like mod_security with Apache/Nginx.

        • Krishna
          3 months ago

          Dear admin, I have already public ip address to host multiple websites,

          Why not use our home desktop pc ubuntu 16.04 as server for my website production.

          I know how to install lamp in ubuntu home pc, and
          I don’t have ssh server, and I dont want use ssh server for my website.

          Home server pc is easy for editing and writing and backup for my website content and all data.

          So. Why not use our home desktop as server for my websites?

      • If you host website on your home PC,

        1.) The latency between visitors and your website is higher.

        2.) You have to prepare for Internet/Power outage. You need to buy UPS (Uninterruptible Power Supply).

        3.) You need to make sure your other applications’ traffic don’t use up all your Internet bandwidth.

        4.) Running Home PC 24 x 7 will decrease the life expectancy of PC hardware.

        Conclusion: Hosting websites on home PC is for hobbyists. Just pay $5 per month to get professional hosting service.

        • Krishna
          3 months ago

          Dear admin,

          Thank you,

          I know Above details,

          What is the difference between server hardware and desktop hardware ?
          I mean what is the difference between
          1. Server motherboard and pc motherboard
          2. Server Ram and Pc Ram
          3. Server Hdd and Pc Hdd
          4. Server Smps and Pc Smps
          5. Server Cpu and Pc Cpu

          Can i use server motherboard for my home server or my website

          and

          I am using amazon ubuntu instance
          Please give me your suggestion about my amazon ubuntu instance.

          How to setup ftp user document root to var/www/ in my amazon ubuntu 18.04 ?

          or

          How to setup ftp server in amazon ubuntu 18.04

          I am already configured Lamp with phpmyadmin in my amazon ubuntu 18.04. I know how to upload files in to my web directory but i dont know how to setup ftp user document root to var/www/ in my amazon ubuntu 18.04

  • [email protected]:~$ sudo nginx -t
    nginx: [emerg]BIO_new_file("/etc/letsencrypt/live/mail.linuxbabe.ml/fullchain.pem") failed (SSL: error:02001002:system library:fopen:No such file or directory:fopen('/etc/letsencrypt/live/mail.linuxbabe.ml/fullchain.pem','r') error:2006D080:BIO routines:BIO_new_file:no such file)
    nginx: configuration file /etc/nginx/nginx.conf test failed
    • Currently there’s an issue with certbot-auto creating a Python virtual environment. It will be fixed by Let’s Encrypt soon.

      For now, you need to reinstall Modoboa with a self-signed certificate. It’s a good idea to reinstall the OS as well.

      After modoboa is installed, please check this comment to obtain and install Let’s Encrypt certificate manually.

    • If the modoboa reinstallation fails, then reinstall the OS.

    • Hi Xiao Guo An,

      Amazon ses works on modoboa server ?
      If it works how to setup amazon ses on modoboa server ?

  • I see the “Welcome to nginx page” when i enter my server’s ip address in the browser. Am i missing anything like nginx configuration?

    • This is normal. When you enter the public IP address in browser, the default Nginx virtual host will show up.

      • Abishek D
        6 months ago

        Thanks for your response. I’m facing issue while installing ssl certificates. I tried this command “sudo certbot –nginx –agree-tos –redirect –hsts –staple-ocsp –email [email protected] -d mail.example.com”. And heres the error:-

        Saving debug log to /var/log/letsencrypt/letsencrypt.log
        Plugins selected: Authenticator nginx, Installer nginx
        Obtaining a new certificate
        Performing the following challenges:
        http-01 challenge for mail.example.com
        Waiting for verification...
        Cleaning up challenges
        Failed authorization procedure. mail.example.com (http-01): urn:ietf:params:acme:error:dns :: DNS problem: SERVFAIL looking up A for mail.example.com
        
        IMPORTANT NOTES:
         - The following errors were reported by the server:
        
           Domain: mail.example.in
           Type:   None
           Detail: DNS problem: SERVFAIL looking up A for mail.example.cpm
         
      • Abishek D
        6 months ago

        And i already have an A record with hostname mail.example.com pointing to the ip address.

    • “SERVFAIL” indicates something is wrong with your name server. Run the following command to query the A record.

      dig A +short mail.example.com

      You might need to wait sometime for the DNS record to propagate to the Internet.

      • Abishek D
        6 months ago

        This command outputs the ip address of my server.

        • On my computer, the dig command failed to find the A record of your domain name, also I couldn’t find the NS record of your domain name. As I said before, there’s something wrong with your name server.

        • The whois record of your domain name says you are using DigitalOcean name server, but I couldn’t find your name server by using the following command:

          dig NS blackweb.in
        • If you choose not to use the name servers of your domain registrar, you need to specify the new name servers at your domain registrar’s website.

      • Abishek D
        6 months ago

        I tried reinstalling modoboa with letsencrypt and then mail.example.com stopped working!. So i tried “sudo certbot –nginx –agree-tos –redirect –hsts –staple-ocsp –email [email protected] -d mail.example.com” but the following error occurs:-

         Saving debug log to /var/log/letsencrypt/letsencrypt.log
        Error while running nginx -c /etc/nginx/nginx.conf -t.
        
        nginx: [emerg] BIO_new_file("/etc/letsencrypt/live/mail.blackweb.in/fullchain.pem") failed (SSL: error:02001002:system library:fopen:No such file or directory:fopen('/etc/letsencrypt/live/mail.blackweb.in/fullchain.pem','r') error:2006D080:BIO routines:BIO_new_file:no such file)
        nginx: configuration file /etc/nginx/nginx.conf test failed
        
        The nginx plugin is not working; there may be problems with your existing configuration.
        The error was: MisconfigurationError('Error while running nginx -c /etc/nginx/nginx.conf -t.\n\nnginx: [emerg] BIO_new_file("/etc/letsencrypt/live/mail.blackweb.in/fullchain.pem") failed (SSL: error:02001002:system library:fopen:No such file or directory:fopen(\'/etc/letsencrypt/live/mail.blackweb.in/fullchain.pem\',\'r\') error:2006D080:BIO routines:BIO_new_file:no such file)\nnginx: configuration file /etc/nginx/nginx.conf test failed\n',)
        
      • Abishek D
        6 months ago

        I used the manual approach but still fails to install ssl certificate as per your steps mentioned above.

        Obtaining a new certificate
        Performing the following challenges:
        http-01 challenge for mail.blackweb.in
        Waiting for verification...
        Cleaning up challenges
        Failed authorization procedure. mail.blackweb.in (http-01): urn:ietf:params:acme:error:dns :: DNS problem: SERVFAIL looking up A for mail.blackweb.in
        
        IMPORTANT NOTES:
         - The following errors were reported by the server:
        
           Domain: mail.blackweb.in
           Type:   None
           Detail: DNS problem: SERVFAIL looking up A for mail.blackweb.in
         - Your account credentials have been saved in your Certbot
           configuration directory at /etc/letsencrypt. You should make a
           secure backup of this folder now. This configuration directory will
           also contain certificates and private keys obtained by Certbot so
           making regular backups of this folder is ideal.
        

        This is my ip 68.183.244.134 Could you please check?

        • As I said before, there’s something wrong with your name server (aka DNS server). The Internet can’t find the authoritative DNS server of your domain name. You may need to ask your domain registrar to troubleshoot this problem.

      • Abishek D
        6 months ago

        I have checked with godaddy about DNS and they say the A records have been updated successfully. they ask me to check if any ports are blocked on the server. So does the port have anything to do with querying A record?

        • No. Your mail server has nothing to do with DNS record update. However, It will take some time for the DNS change to propagate to the Internet.

        • I have a feeling that your DNS server is still not working.

        • Abishek D
          6 months ago

          @xiao Thankyou for responding with patience. However i fixed the issue now. I thing it’s because of the DNSSEC feature enabled on my godaddy control panel(which i disabled), but not sure if that is the only cause. It would be interesting to know how to enable DNSSEC in Modoboa though! Thanks again.

  • Muhammad farhan Saleem
    5 months ago

    excellent tutorial, but my url opens main website mail.pagedesigner.pk my ports https://www.screencast.com/t/7WWqhIRfYqq6

    thanks

  • Hi, will this work with the latest version of EasyEngine which is Version 4? Please let me know if you have tested with EasyEngine. Thank you.

  • Hi,

    I’m planning to set this up Modoboa on $10/month Linode VPS.
    I’m also planning to set up a PHP website in the same VPS. Will that be ok or does the website need to be in a separate VPS.
    I plan to use Modoboa for a single domain. Is this overkill? Should I just install postfix and dovecot from scratch if I’ll only use one domain?

    Thanks in advance for your feedback,
    Michael.

    • Modoboa and PHP website can run on the same VPS, but if your website needs to be put behind a CDN like Cloudflare, I suggest you set up the website on a different IP address.

      If the mail server is only used by you and you are familiar with Postifx/Dovecot, Modoboa is an overkill. If there are many people using the mail server, or I need to set up multiple domains, I will choose Modoboa.

  • Excellent, i followed step by step and wow, my own email server is up and running with multiple domains and email accounts. Thank you.

  • There isnt any webmail option in my dashboard although i installed web mail package from here https://github.com/modoboa/modoboa-webmail

    after installation I shows internal serve error

    Can you tell me what could go wrong and how to restart python process?

    • The Modoboa installer will install webmail alongside other mail components. Why do you want to install the webmail separately?

      • Because when i logged-in there was no webmail option

        it was something like this image here

        https://3.bp.blogspot.com/-fivtShvnh6M/Wr5DTG3YG2I/AAAAAAAABLs/BNEgch1LK20lctdAR4X2j_1jEfbDGZmiwCLcBGAs/s1600/modoboa%2Badmin%2Bweb%2Binterface.JPG

        Hopefully you can test and update your post

  • See yourself in official demo It would be awesome if you write additional post or simply update this one
    although how to use it to send mail via smtp

    • The default admin account isn’t an email account. It’s used to manage the mail server only. You need to create an email account (for example: [email protected]) and use that to login, then you will see the webmail.

      • Wow its working awesome Thanks

        Can you tell me how can i use it for smtp?

    • That depends on what software you use to connect to the Modoboa mail server. Most web applications allows you to use your own mail server. You just need to enter your email address and password in that web application. The port for SMTP relay is 587.

      • I will connect it to mastodon I used sendmail earlier but in new server its not working and i am not able to fix it

    • Use sendmail option if Mastodon and Modoboa are installed on the same server. If they are on different servers, you should configure SMTP relay. Check the Mastodon dodumentation. Scroll down to the end of that page.

  • Abishek D
    5 months ago

    Hi, when I compose email and send, it literally takes over 15 seconds to send. How to resolve this? Additionally, when I test email server with mxtoolbox tool it shows SMTP Connection Time- 7.343 seconds – Warning on Connection time and SMTP Transaction Time-10.003 seconds – Not good! on Transaction Time.

    • I think its the server mine doesnt any type of issue

      • Abishek D
        5 months ago

        Is it normal?

        • I am using digital ocean and its working without an issue Email sent in almost instant. it could be because of server which company server you are using

        • Abishek D
          5 months ago

          i’m also using digital ocean server

  • saksham D
    4 months ago

    I installed modoboa but whenever i send a mail google postmaster shows no dkim configured and even in the inbox only mailed by option is shown, not signed by domain.

    do I have to add open-dkim manually

    • Make sure you enable DKIM signing when adding a domain in Modoboa admin panel, and the DKIM record is correctly set in DNS.

      And can you show the DKIM header in Gmail? (Click “show original” button in the Gmail inbox to show email headers.)

  • After installation using letsencrypt, nginx fails to start.

  • justsomexanda
    4 months ago

    Clean install, but HTTP 502

  • Installed but can’t access webmail.

    Whenever I try to visit the page (A records all set up), it just gives me:

    This site can’t be reached
    mail.********.*** refused to connect.

    • Be sure to open port 80 and 443 in firewall.

      • Yeah, I’ve got other sites running on the server through HTTPS already and they still work as do the Non-SSL versions, it’s literally everytime I try to access the mail subdomain.

        Hmmm.

  • Hi, I’m trying to access the given radicale contact url but I get this error : The requested resource could not be found.
    URL : https://DOMAIN/radicale/[email protected]/contacts
    Any idea ?

    Note : Access to calendar works

    Regards

  • Dennis Smeltink
    2 months ago

    Where can i find that edit dns recoored/mx

    • You can create DNS record at your domain registrar’s website 🙂

      • Dennis Smeltink
        2 months ago

        we are hosting are own server/domain and after install of modoboa i cant reach the default modoboa inlog page any help?

    • If you run your own DNS server, then create DNS record on your DNS server. Also make sure your firewall doesn’t block port 80 and 443 on the mail server.

  • Abishek D
    1 month ago

    Is it possible to use aws certificate manager to issue certificate to mododao mail server domain? What are the steps?

  • I went through this but skipped the DKIM bit. Now want to add DKIM and have found this (https://modoboa.readthedocs.io/en/latest/manual_installation/opendkim.html) as a way to do it. My problem si I cannot find the modoboa databse. No sign of it in mysql and I can’t (obviously) see any other engines. ANy ideas as to where to go next?

  • I am not able to send email from modoboa mailbox. It doesn’t even end up in spam. This is the recent log when I try to send an email >however I am able to receive an email from Gmail.

      dovecot: imap-login: Login: user=, method=PLAIN, rip=127.0.0.1, lip=127.0.0.1, mpid=14306, secured, session=
    Jun 11 16:59:28 ip-172-31-62-168 postfix/postscreen[14454]: CONNECT from [127.0.0.1]:55618 to [127.0.0.1]:25
    Jun 11 16:59:28 ip-172-31-62-168 postfix/postscreen[14454]: WHITELISTED [127.0.0.1]:55618
    Jun 11 16:59:28 ip-172-31-62-168 postfix/smtpd[14455]: connect from localhost[127.0.0.1]
    Jun 11 16:59:28 ip-172-31-62-168 postfix/smtpd[14455]: NOQUEUE: client=localhost[127.0.0.1]
    Jun 11 16:59:28 ip-172-31-62-168 amavis[10092]: (10092-10) (!)connect to /var/run/clamav/clamd.ctl failed, attempt #1: Can't connect to a UNIX socket /var/run/clamav/clamd.ctl: Connection $
    Jun 11 16:59:29 ip-172-31-62-168 amavis[10092]: (10092-10) (!)connect to /var/run/clamav/clamd.ctl failed, attempt #1: Can't connect to a UNIX socket /var/run/clamav/clamd.ctl: Connection $
    Jun 11 16:59:29 ip-172-31-62-168 amavis[10092]: (10092-10) (!)ClamAV-clamd: All attempts (1) failed connecting to /var/run/clamav/clamd.ctl, retrying (2)
    Jun 11 16:59:35 ip-172-31-62-168 amavis[10092]: (10092-10) (!)connect to /var/run/clamav/clamd.ctl failed, attempt #1: Can't connect to a UNIX socket /var/run/clamav/clamd.ctl: Connection $
    Jun 11 16:59:35 ip-172-31-62-168 amavis[10092]: (10092-10) (!)ClamAV-clamd av-scanner FAILED: run_av error: Too many retries to talk to /var/run/clamav/clamd.ctl (All attempts (1) failed c$
    Jun 11 16:59:35 ip-172-31-62-168 amavis[10092]: (10092-10) (!)WARN: all primary virus scanners failed, considering backups
    Jun 11 17:00:01 ip-172-31-62-168 postfix/smtpd[14476]: connect from localhost[127.0.0.1]
    Jun 11 17:00:01 ip-172-31-62-168 postfix/smtpd[14476]: 5EC4485DE0: client=localhost[127.0.0.1], orig_client=localhost[127.0.0.1]
    Jun 11 17:00:01 ip-172-31-62-168 postfix/cleanup[14477]: 5EC4485DE0: message-id=
    Jun 11 17:00:01 ip-172-31-62-168 opendkim[16384]: 5EC4485DE0: DKIM-Signature field added (s=modoboa, d=blackweb.in)
    Jun 11 17:00:01 ip-172-31-62-168 postfix/qmgr[6185]: 5EC4485DE0: from=, size=1046, nrcpt=1 (queue active)
    Jun 11 17:00:01 ip-172-31-62-168 postfix/smtpd[14476]: disconnect from localhost[127.0.0.1] ehlo=1 xforward=1 mail=1 rcpt=1 data=1 quit=1 commands=6
    Jun 11 17:00:01 ip-172-31-62-168 amavis[10092]: (10092-10) Passed CLEAN {RelayedOpenRelay}, [127.0.0.1]:55618  -> , Message-ID: <20190611165928.1$
    Jun 11 17:00:01 ip-172-31-62-168 postfix/smtpd[14455]: proxy-accept: END-OF-MESSAGE: 250 2.0.0 from MTA(smtp:[127.0.0.1]:10025): 250 2.0.0 Ok: queued as 5EC4485DE0; from=<[email protected]$
    Jun 11 17:00:01 ip-172-31-62-168 postfix/smtpd[14455]: disconnect from localhost[127.0.0.1] ehlo=1 mail=1 rcpt=1 data=1 quit=1 commands=5
    Jun 11 17:00:31 ip-172-31-62-168 postfix/smtp[14479]: connect to gmail-smtp-in.l.google.com[74.125.195.27]:25: Connection timed out
    Jun 11 17:01:01 ip-172-31-62-168 postfix/smtp[14479]: connect to alt1.gmail-smtp-in.l.google.com[209.85.234.26]:25: Connection timed out
    Jun 11 17:01:31 ip-172-31-62-168 postfix/smtp[14479]: connect to alt2.gmail-smtp-in.l.google.com[64.233.176.27]:25: Connection timed out
    
    • Check if ClamAV is running.

      sudo systemctl status clamav-daemon
      •  
        ● clamav-daemon.service - Clam AntiVirus userspace daemon
           Loaded: loaded (/lib/systemd/system/clamav-daemon.service; enabled; vendor preset: enabled)
          Drop-In: /etc/systemd/system/clamav-daemon.service.d
                   └─extend.conf
           Active: failed (Result: signal) since Tue 2019-06-11 00:04:41 UTC; 1 day 7h ago
             Docs: man:clamd(8)
                   man:clamd.conf(5)
                   https://www.clamav.net/documents/
         Main PID: 14092 (code=killed, signal=KILL)
        
        Jun 10 15:44:22 ip-172-31-62-168 clamd[14092]: Mon Jun 10 15:44:22 2019 -> Self checking every 3600 seconds.
        Jun 10 16:44:22 ip-172-31-62-168 clamd[14092]: Mon Jun 10 16:44:22 2019 -> SelfCheck: Database status OK.
        Jun 10 17:59:00 ip-172-31-62-168 clamd[14092]: Mon Jun 10 17:59:00 2019 -> SelfCheck: Database status OK.
        Jun 10 19:00:13 ip-172-31-62-168 clamd[14092]: Mon Jun 10 19:00:13 2019 -> SelfCheck: Database status OK.
        Jun 10 20:00:13 ip-172-31-62-168 clamd[14092]: Mon Jun 10 20:00:13 2019 -> SelfCheck: Database status OK.
        Jun 10 21:00:13 ip-172-31-62-168 clamd[14092]: Mon Jun 10 21:00:13 2019 -> SelfCheck: Database status OK.
        Jun 10 22:30:10 ip-172-31-62-168 clamd[14092]: Mon Jun 10 22:30:10 2019 -> SelfCheck: Database status OK.
        Jun 10 23:30:10 ip-172-31-62-168 clamd[14092]: Mon Jun 10 23:30:10 2019 -> SelfCheck: Database status OK.
        Jun 11 00:04:41 ip-172-31-62-168 systemd[1]: clamav-daemon.service: Main process exited, code=killed, status=9/KILL
        Jun 11 00:04:41 ip-172-31-62-168 systemd[1]: clamav-daemon.service: Failed with result 'signal'.
        
    • Check the ClamAV log (/var/log/clamav/clamav.log) to find out why it’s killed.

      • I think it has stopped logging a few days back only.

        Mon Jun 10 15:44:22 2019 -> Limits: MaxHTMLNormalize limit set to 10485760 bytes.
        Mon Jun 10 15:44:22 2019 -> Limits: MaxHTMLNoTags limit set to 2097152 bytes.
        Mon Jun 10 15:44:22 2019 -> Limits: MaxScriptNormalize limit set to 5242880 bytes.
        Mon Jun 10 15:44:22 2019 -> Limits: MaxZipTypeRcg limit set to 1048576 bytes.
        Mon Jun 10 15:44:22 2019 -> Limits: MaxPartitions limit set to 50.
        Mon Jun 10 15:44:22 2019 -> Limits: MaxIconsPE limit set to 100.
        Mon Jun 10 15:44:22 2019 -> Limits: MaxRecHWP3 limit set to 16.
        Mon Jun 10 15:44:22 2019 -> Limits: PCREMatchLimit limit set to 10000.
        Mon Jun 10 15:44:22 2019 -> Limits: PCRERecMatchLimit limit set to 5000.
        Mon Jun 10 15:44:22 2019 -> Limits: PCREMaxFileSize limit set to 26214400.
        Mon Jun 10 15:44:22 2019 -> Archive support enabled.
        Mon Jun 10 15:44:22 2019 -> BlockMax heuristic detection disabled.
        Mon Jun 10 15:44:22 2019 -> Algorithmic detection enabled.
        Mon Jun 10 15:44:22 2019 -> Portable Executable support enabled.
        Mon Jun 10 15:44:22 2019 -> ELF support enabled.
        Mon Jun 10 15:44:22 2019 -> Mail files support enabled.
        Mon Jun 10 15:44:22 2019 -> OLE2 support enabled.
        Mon Jun 10 15:44:22 2019 -> PDF support enabled.
        Mon Jun 10 15:44:22 2019 -> SWF support enabled.
        Mon Jun 10 15:44:22 2019 -> HTML support enabled.
        Mon Jun 10 15:44:22 2019 -> XMLDOCS support enabled.
        Mon Jun 10 15:44:22 2019 -> HWP3 support enabled.
        Mon Jun 10 15:44:22 2019 -> Self checking every 3600 seconds.
        Mon Jun 10 16:44:22 2019 -> SelfCheck: Database status OK.
        Mon Jun 10 17:59:00 2019 -> SelfCheck: Database status OK.
        Mon Jun 10 19:00:13 2019 -> SelfCheck: Database status OK.
        Mon Jun 10 20:00:13 2019 -> SelfCheck: Database status OK.
        Mon Jun 10 21:00:13 2019 -> SelfCheck: Database status OK.
        Mon Jun 10 22:30:10 2019 -> SelfCheck: Database status OK.
        Mon Jun 10 23:30:10 2019 -> SelfCheck: Database status OK.
        
    • I think the real question is: are you able to connect to port 25 of other email servers? You can try the following command on your mail server.

      telnet mail.linuxbabe.com 25

      If telnet are trying to connect forever, then your ISP probably blocked port 25.

  • Yes, Its taking forever.

     Trying 74.207.252.70...
    Trying 2400:6180:0:d1::524:6001...
    telnet: Unable to connect to remote host: Network is unreachable
    

    How to fix this?
    Should i update new AWS security group?

    • As far as I know, AWS security group doesn’t block outbound connection by default. If the port 25 is blocked outbound by your ISP, you can set up SMTP relay to solve this problem.

      • I checked on https://ping.eu/port-chk/ and port 25 seems to be open.

    • Your ISP won’t block incoming connection to port 25 of your server. They are likely to block outgoing connection to port 25 of other email servers.

  • Okay, maybe I’ll try restarting the clamAV service once. By the way what is the command in ubuntu to restart service?

    • sudo systemctl restart clamav-daemon

      • So AWS has an email sending form that removes the outbound blockage. However, my emails are being sent to spam now. I have checked the domains section DNS status> the DNSBL is marked red also the autoconfig is marked red. Could this be the reason why my emails are being sent to spam? Any fix?

    • I recommend using mxtoolbox.com and dnsbl.info to check if your IP address is blacklisted. The current Modoboa installation includes the bad.psky.me DNSBL provider, which you should ignore.

      Autoconfig is used to help users to automatically configure mail accounts in mail clients (Mozilla thunderbird, Microsoft Outook, etc). It has nothing to do with email deliverability.

      The fact is even if you get a 10/10 score at mail-tester.com, your email can still be flagged as spam.

      If you send transactional emails, you shouldn’t worry too much, because your users will mark your email as not spam and your email will eventually be put in inbox. You just need to wait some time to build your reputation.

      If you send marketing emails (bulk emails), you need to follow these rules or practices.

      1. Make sure the recipient gave you permission to send email. Use double opt-in to verify subscriber’s email address.
      2. Don’t send cold emails to thousands of people who have never received emails from you before. Instead, you need to warm up your IP address. For example, send 500 emails on day 1, then send 1000 emails on day 2, send 2000 emails on day
      3. Include your contact information and your mailing address at the bottom of the email message.
      4. Personalize the email message as much as possible. For example, include the recipient’s name in the email.
      5. Conform to CAN-SPAM Act
      6. Avoid large attachments.
      7. Clean your email list. For example, delete email subscribers that haven’t opened your email in the last 30 days.
      8. Get approved as Return Path Certified Sender.

      I also recommend you to check out Gmail, Yahoo, Hotmail’s bulk email best practices.

  • Hi All,

    I tried to setup the modobia but getting bad request when i tried to login via web. Can anyone please help

  • Jonny Bekkevold
    1 week ago

    Hi,

    Thanks for a great guide! It works nicely, but I want to change where the data (e-mail content mainly) is stored (PostgreSQL DB location, I guess) – do anyone has any tips on how I do that?

  • Jonny Bekkevold
    1 week ago

    I found this: https://www.digitalocean.com/community/tutorials/how-to-move-a-postgresql-data-directory-to-a-new-location-on-ubuntu-16-04

    Kind of old information, but it seems to work ok (I’m using Ubuntu 18.04 LTS and postgreSQL 10).

  • aserrano
    7 days ago

    Hi !

    Thanks for this guide but I got an issue just after the installation. To log the first time, I have tihs message error (I translated it in English)

    The CSRF check failed. The request has been interrupted.
    
    You see this message because this site requires the presence of a CSRF cookie when sending forms. This cookie is necessary for security reasons, to ensure that the browser has not been hacked by an external contributor.
    
    If you have deactivated the sending of cookies by your browser, please reactivate them at least for this site or for requests of the same origin ("same-origin").
    

    And i actually don’t know what to do

    • aserrano
      7 days ago

      I find my issue, it was about SSL certificat. I fixed it with certbot

      BUT I have a new one

      Error : Connection to IMAP server failed: [Errno 111] Connection refused
      

      So It seems that the installation did wrong ? How to fix it ?

  • How can I add quota restriction on users?

    And what Self hosted email server would you recommend for a startup Webhosting company that also provides business emails:)

    Have looked into iredmail, modoboa, mail-in-a-box, mailcow.
    Any recommendations?

    • You can set quota when you create an email address in Modoboa admin panel.

      You mean what software can allow a web hosting company to provide business email for clients? Sorry, I don’t know. I don’t run a web hosting company. Maybe CPanel?

      iRedmail, Modoboa, Mail-in-a-box, mailcow are not meant for that purpose. They are for people/organizations to set up their own email server on machines where they have root access.

      • OK, i managed to change the qoutas. Thanks for that:)

        Basically, i just wanted to know what premade email hosting software you would recommend for a small webhosting business. I don’t have Cpanel, but since i have my own Server, i can install iRedmail, Modoboa, Mail-in-a-box or mailcow. Whichever one you recommend, i will use 🙂

      • And also, how can i update modoboa?

    • I only used iRedMail and Modoboa and I slightly prefer Modoboa because at least I can easily create alias in the admin panel without paying for a pro license.

    • I will write an article on how to upgrade Modoboa and notify you.

  • Hello:

    Thank you for this.

    If you have time, please do an article on how to Upgrade Modoboa as installed from this article. The Upgrade documentation on the Modoboa site is not written very well, and is confusing.

    Thanks!

  • Adavidoaiei Dumitru-Cornel
    3 days ago

    Doesn’t work on Ubuntu 19.04

    Package ripole is not available, but is referred to by another package.
    This may mean that the package is missing, has been obsoleted, or
    is only available from another source

    Package zoo is not available, but is referred to by another package.
    This may mean that the package is missing, has been obsoleted, or
    is only available from another source

    E: Package ‘ripole’ has no installation candidate
    E: Package ‘zoo’ has no installation candidate

    • Use Ubuntu LTS to run complex server software. Modoboa doesn’t support Ubuntu 19.04. In addition, you don’t want to upgrade Ubuntu every 9 months to break your mail server.

Leave a Comment

  • Comments with links are moderated by admin before published.
  • Your email address will not be published.
  • Use <pre> ... </pre> HTML tag to quote the output from your terminal/console.
  • Please use the community (https://community.linuxbabe.com) for questions unrelated to this article.
  • If my answer helped you, please consider supporting this site. Thanks :)