0

I have my Odoo application running on Ubuntu server 16.04LTS with nginx web server. I have also installed iredmail and I can access my email account using the domain_name/mail i.e. mgbcomputers.com/mail from where I can send email to another account on my local domain and others like gmail and yahoo.

However when I send an email from my yahoo or gmail to my roundcube email, I get the following error.

This message was created automatically by mail delivery software. A message that you sent could not be delivered to one or more of its recipients. This is a permanent error. The following address(es) failed: obabawale@mgbcomputers.com retry time not reached for any host after a long failure period. My A/Mx records are correct because i can access my website using the domain address.

Below is my nginx configuration file:

upstream backend-odoo{
    server 127.0.0.1:8069;
}

server {
    server_name mgbcomputers.com;
    listen 80;
    add_header Strict-Transport-Security max-age=2592000;
    rewrite ^/.*$ https://$host$request_uri? permanent;
}

server {

    listen 443 default;

    #ssl settings
    ssl on;
    ssl_certificate /etc/nginx/ssl/server.crt;
#    ssl_certificate /etc/ssl/certs/iRedMail.crt;
    ssl_certificate_key /etc/nginx/ssl/server.key;
    keepalive_timeout 60;

    root /var/www/html;   #added from iredmail file
    index index.php index.html; #added from the iredmail file

    # proxy header and settings
    proxy_set_header Host $host;
    proxy_set_header X-Real-IP $remote_addr;
    proxy_set_header X-Forward-For $proxy_add_x_forwarded_for;
    proxy_set_header X-Forwarded-Proto $scheme;
    proxy_redirect off;

    # odoo log files
    access_log /var/log/nginx/odoo-access.log;
    error_log /var/log/nginx/odoo-error.log;

    # increase proxy buffer size
    proxy_buffers 16 64k;
    proxy_buffer_size 128k;

    # force timeouts if the backend dies
    proxy_next_upstream error timeout invalid_header http_500
    http_502 http_503;

    # enable data compression
    gzip on;
    gzip_min_length 1100;
    gzip_buffers 4 32k;
    gzip_types text/plain application/x-javascript text/xml text/css;
    gzip_vary on;

    location / {
        proxy_pass http://backend-odoo;
    }

    location ~* /web/static/ {
        # cache static data
        proxy_cache_valid 200 60m;
        proxy_buffering on;
        expires 864000;
        proxy_pass http://backend-odoo;
    }

    location /longpolling { proxy_pass http://backend-odoo-im;}

    location /mail/ { root /var/vmail/vmail1; }   # Added by Lekan for iredmail

    # Web applications.  Added from iredmail file
    #include /etc/nginx/templates/adminer.tmpl;    #Added from iredmail file
    include /etc/nginx/templates/roundcube.tmpl;   #Added from iredmail file
    include /etc/nginx/templates/sogo.tmpl;    #Added from iredmail file
    include /etc/nginx/templates/iredadmin.tmpl;    #Added from iredmail file
    include /etc/nginx/templates/awstats.tmpl;    #Added from iredmail file

    # PHP applications. WARNING: php-catchall.tmpl should be loaded after
    # other php web applications.
    include /etc/nginx/templates/php-catchall.tmpl;   #Added from iredmail file

    include /etc/nginx/templates/misc.tmpl;   #Added from iredmail file
}

upstream backend-odoo-im { server 127.0.0.1:8072; }

What am I not getting here?

1 Answers1

0

If you can access your website, it means that your A record is correct but it does not guarantee that your MX record is also correct. You can try to validate your MX record on this site: https://mxtoolbox.com. I've checked your domain (mgbcomputers.com) on that site and it's valid with one blacklist record but I think it's also not a problem. My suggestion, you can try to disable your firewall (ufw) and it's better if you setup your mail server on another server which is specified only for mail service.

Luki B. Subekti
  • 822
  • 10
  • 9