2
  1. I have a VPS server (ubuntu)
  2. I have a Postfix mail server and Dovecot IMAP/POP3 server
  3. I have configured my postfix server for sending mails (I got 10/10 sending score) (DKIM correct, DMARC correct, SPF correct, PTR correct, MX correct, A reocrd)
  4. $mydestination in postfix configuration file is :
mydestination = $myhostname, mskillsa.com, mainserver.mskillsa.com, localhost.mskillsa.com, localhost, mail.mskillsa.com
  1. When I run this command in terminal (netstat -tnap | grep master) I get:
tcp        0      0 0.0.0.0:465             0.0.0.0:*               LISTEN      11420/master
tcp        0      0 0.0.0.0:25              0.0.0.0:*               LISTEN      11420/master
tcp6       0      0 :::465                  :::*                    LISTEN      11420/master
tcp6       0      0 :::25                   :::*                    LISTEN      11420/master
  1. When I run (dig MX mskillsa.com) I get:
; <<>> DiG 9.11.3-1ubuntu1.17-Ubuntu <<>> MX mskillsa.com
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 12484
;; flags: qr rd ra; QUERY: 1, ANSWER: 2, AUTHORITY: 0, ADDITIONAL: 1

;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 512
;; QUESTION SECTION:
;mskillsa.com.                  IN      MX

;; ANSWER SECTION:
mskillsa.com.           14400   IN      MX      10 mainserver.mskillsa.com.
mskillsa.com.           14400   IN      MX      10 mail.mskillsa.com.

;; Query time: 125 msec
;; SERVER: 31.220.105.10#53(31.220.105.10)
;; WHEN: Fri Aug 12 11:42:49 UTC 2022
;; MSG SIZE  rcvd: 89

  1. When I run (dig A mskillsa.com) I get:
; <<>> DiG 9.11.3-1ubuntu1.17-Ubuntu <<>> A mskillsa.com
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 53419
;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 1

;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 512
;; QUESTION SECTION:
;mskillsa.com.                  IN      A

;; ANSWER SECTION:
mskillsa.com.           14400   IN      A       (My IP address)

;; Query time: 25 msec
;; SERVER: 31.220.105.10#53(31.220.105.10)
;; WHEN: Fri Aug 12 11:44:23 UTC 2022
;; MSG SIZE  rcvd: 57
  1. I also get like (bounce or reject) mail from Gmail when I send to my server and It says:
This is the mail system at host mainserver.mskillsa.com.

I'm sorry to have to inform you that your message could not
be delivered to one or more recipients. It's attached below.

For further assistance, please send mail to postmaster.

If you do so, please include this problem report. You can
delete your own text from the attached returned message.

                   The mail system

<info@mskillsa.com>: unknown user: "info"
  1. I have usermin interface (port:20000)
  2. I have roundcube interface
  3. I have virtualmin/webmin manager
  4. I can send from them to any address but I can not receive
  5. My mail.log file is empty
  6. When I run (telnet 45.82.73.195 25) I get
Trying 45.82.73.195...
Connected to 45.82.73.195.
Escape character is '^]'.
  1. When I run (telnet 45.82.73.195 465) I get:
Trying 45.82.73.195...
Connected to 45.82.73.195.
Escape character is '^]'.

My postfix configuration:

alias_database = hash:/etc/aliases
alias_maps = hash:/etc/aliases
append_dot_mydomain = no
biff = no
compatibility_level = 2
inet_interfaces = all
inet_protocols = all
mailbox_command = procmail -a "$EXTENSION"
mailbox_size_limit = 0
milter_default_action = accept
mydestination = $myhostname, mskillsa.com, mainserver.mskillsa.com, localhost.mskillsa.com, localhost, mail.mskillsa.commyhostname = mainserver.mskillsa.com
mynetworks = 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128
myorigin = $myhostname
non_smtpd_milters = inet:localhost:8891
readme_directory = no
recipient_delimiter = +
smtp_tls_session_cache_database = btree:${data_directory}/smtp_scache
smtpd_banner = $myhostname ESMTP $mail_name (Ubuntu)
smtpd_milters = inet:localhost:8891
smtpd_relay_restrictions = permit_mynetworks permit_sasl_authenticated defer_unauth_destination
smtpd_sasl_path = private/auth
smtpd_sasl_type = dovecot
smtpd_tls_cert_file = /etc/ssl/certs/ssl-cert-snakeoil.pem
smtpd_tls_key_file = /etc/ssl/private/ssl-cert-snakeoil.key
smtpd_tls_session_cache_database = btree:${data_directory}/smtpd_scache
smtpd_use_tls = yes
virtual_gid_maps = static:2000
virtual_mailbox_base = /home/virtualmailboxes
virtual_mailbox_domains = mskillsa.com
virtual_mailbox_maps = hash:/etc/postfix/virtualmaps
virtual_minimum_uid = 500
virtual_uid_maps = static:2000

Dovecot configuration:

auth_mechanisms = plain login
disable_plaintext_auth = no
mail_location = maildir:~/Maildir
mail_privileged_group = mail
namespace inbox {
  inbox = yes
  location =
  mailbox Drafts {
    special_use = \Drafts
  }
  mailbox Junk {
    special_use = \Junk
  }
  mailbox Sent {
    special_use = \Sent
  }
  mailbox "Sent Messages" {
    special_use = \Sent
  }
  mailbox Trash {
    special_use = \Trash
  }
  prefix =
}
passdb {
  driver = pam
}
protocols = " imap pop3"
ssl_cert = </etc/dovecot/private/dovecot.pem
ssl_client_ca_dir = /etc/ssl/certs
ssl_key =  # hidden, use -P to show it
userdb {
  driver = passwd
}

local_name mskillsa.com {
  ssl_cert = </home/mskillsa/ssl.combined
  ssl_key =  # hidden, use -P to show it
}
local_name *.mskillsa.com {
  ssl_cert = </home/mskillsa/ssl.combined
  ssl_key =  # hidden, use -P to show it
}

Can you help me to fix the problem of receiving mails from external sources??

2
  • it would be nice if you posted your postfix and dovecot config so we can help you. Run "sudo postconf -n" and "sudo doveconf -n" and show us the results.
    – FatRabbit
    Aug 14 at 16:32
  • I shared them, You could see them above Aug 15 at 15:31

2 Answers 2

1

Your Dovecot is configured to use Maildirs (ie. mails for user info are stored in directory /home/info/Maildir, with special structure of subdirectories under that directory) - the line mail_location = maildir:~/Maildir in the config.

Postfix by default is configured to use mailboxes, ie. mail for user info is stored in file /var/mail/info.

I see you tried to configure your Postfix for virtual users (all the virtual_... parameters in your Postfix config), but this is probably unnecessary as your Dovecot config indicates you have real system users with Maildirs - do you? or do you actually have virtual users?

To make your Postfix configuration consistent with your Dovecot configuration, you have to remove all virtual_... lines and the following to your Postfix main.cf:

home_mailbox = Maildir/
mail_spool_directory = /home/

But if you are using virtual users and all the virtual_... parameters in your Postfix config are correct, you need to configure Dovecot for virtual users too.

3

Minor issue:

mskillsa.com.           14400   IN      MX      10 mainserver.mskillsa.com.
mskillsa.com.           14400   IN      MX      10 mail.mskillsa.com.

Two MX records pointing to the same server/IP-address is unnecessary. Remove one (for example the MX record with mail.mskillsa.com.)


The relevant error is:

<info@mskillsa.com>: unknown user: "info"

Which suggests that you didn't set up any mailboxes yet.

That e-mail address needs (depending on your setup) a local system user called "info" to created, or a mapping to different mailbox (an email alias if you will, where for example email for info@mskillsa.com gets delivered in the mailbox mfahd) or a virtual mail user needs to be created.

6
  • I have deleted one MX record (mainserver.mskillsa.com MX record) Aug 12 at 12:44
  • I have that email account as a user in my server info@mskillsa.com, You can see it mskillsa.com/images/users.png Aug 12 at 12:47
  • Do you think I need a further setup for that users? or I need to map it to another account Aug 12 at 12:48
  • I don't know how usermin integrates all that so I can't help you there
    – HBruijn
    Aug 12 at 13:59
  • I found that I receive mails from Gmail correctly and the mails are stored in this file /var/mail/info. I want to connect Usermin or roundcube with this file to show the recieved mails. Or any solution to get emails in mailbox of usermin as info@mskillsa.com Aug 12 at 14:04

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.