I have read all of the threads and can't figure out what is the problem. I can send emails. I can receive emails from my localhost and my other email names of the same domain, but I cannot receive emails from external emails like Gmail etc.
Everything is sent and authenticated, but nothing is received.
Here are the configs for Dovecot and Postfix:
sudo doveconf -n
# 2.3.14 (cee3cbc0d): /etc/dovecot/dovecot.conf
# Pigeonhole version 0.5.14 (1b5c82b2)
# OS: Linux 4.15.0-29-generic x86_64 Ubuntu 18.04.5 LTS
# Hostname: nameofthehost
auth_mechanisms = plain login
dict {
sqlquota = mysql:/etc/dovecot/dovecot-dict-sql.conf.ext
}
first_valid_uid = 5000
last_valid_uid = 5000
mail_gid = vmail
mail_location = mbox:~/mail:INBOX=/var/mail/%u
mail_plugins = quota
mail_privileged_group = vmail
mail_uid = vmail
managesieve_notify_capability = mailto
managesieve_sieve_capability = fileinto reject envelope encoded-character vacation subaddress comparator-i;ascii-numeric relational regex imap4flags copy include variables body enotify environment mailbox date index ihave duplicate mime foreverypart extracttext imapsieve vnd.dovecot.imapsieve
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 Spam {
auto = subscribe
special_use = \Junk
}
mailbox Trash {
special_use = \Trash
}
prefix =
}
passdb {
args = /etc/dovecot/dovecot-sql.conf.ext
driver = sql
}
plugin {
imapsieve_mailbox1_before = file:/var/mail/vmail/sieve/global/report-spam.sieve
imapsieve_mailbox1_causes = COPY
imapsieve_mailbox1_name = Spam
imapsieve_mailbox2_before = file:/var/mail/vmail/sieve/global/report-ham.sieve
imapsieve_mailbox2_causes = COPY
imapsieve_mailbox2_from = Spam
imapsieve_mailbox2_name = *
quota = dict:User quota::proxy::sqlquota
quota_exceeded_message = Quota exceeded, please contact your system administrator.
quota_grace = 10%%
quota_rule = *:storage=5GB
quota_rule2 = Trash:storage=+100M
quota_warning = storage=100%% quota-warning 100 %u
quota_warning2 = storage=95%% quota-warning 95 %u
quota_warning3 = storage=90%% quota-warning 90 %u
quota_warning4 = storage=85%% quota-warning 85 %u
sieve = file:/var/mail/vmail/sieve/%d/%n/scripts;active=/var/mail/vmail/sieve/%d/%n/active-script.sieve
sieve_before = /var/mail/vmail/sieve/global/spam-global.sieve
sieve_global_extensions = +vnd.dovecot.pipe
sieve_pipe_bin_dir = /usr/bin
sieve_plugins = sieve_imapsieve sieve_extprograms
}
protocols = " imap lmtp sieve pop3"
service auth-worker {
user = vmail
}
service auth {
unix_listener /var/spool/postfix/private/auth {
group = postfix
mode = 0666
user = postfix
}
unix_listener auth-userdb {
group = vmail
mode = 0600
user = vmail
}
}
service dict {
unix_listener dict {
group = vmail
mode = 0660
user = vmail
}
}
service lmtp {
unix_listener /var/spool/postfix/private/dovecot-lmtp {
group = postfix
mode = 0600
user = postfix
}
}
service managesieve-login {
inet_listener sieve {
port = 4190
}
}
service managesieve {
process_limit = 1024
}
service quota-warning {
executable = script /usr/local/bin/quota-warning.sh
unix_listener quota-warning {
group = vmail
mode = 0660
user = vmail
}
user = vmail
}
ssl_cert = </etc/letsencrypt/live/mydomain.com/fullchain.pem
ssl_cipher_list = EECDH+AES:EDH+AES+aRSA
ssl_dh = # hidden, use -P to show it
ssl_key = # hidden, use -P to show it
ssl_prefer_server_ciphers = yes
userdb {
args = /etc/dovecot/dovecot-sql.conf.ext
driver = sql
}
protocol lmtp {
mail_plugins = quota sieve
postmaster_address = [email protected]
}
protocol imap {
mail_plugins = quota imap_quota imap_sieve
}
postconf -n
alias_database = hash:/etc/aliases
alias_maps = hash:/etc/aliases
append_dot_mydomain = no
biff = no
broken_sasl_auth_clients = yes
compatibility_level = 2
inet_interfaces = all
inet_protocols = all
mailbox_size_limit = 0
milter_default_action = accept
milter_mail_macros = i {mail_addr} {client_addr} {client_name} {auth_authen}
milter_protocol = 6
mydestination = localhost.$mydomain, localhost, $mydomain
myhostname = nameofthehost
myorigin = /etc/mailname
non_smtpd_milters = inet:127.0.0.1:11332
readme_directory = no
recipient_delimiter = +
relayhost =
smtp_tls_note_starttls_offer = yes
smtp_tls_security_level = may
smtp_tls_session_cache_database = btree:${data_directory}/smtp_scache
smtpd_banner = $myhostname ESMTP $mail_name (Ubuntu)
smtpd_milters = inet:127.0.0.1:11332
smtpd_recipient_restrictions = permit_sasl_authenticated,permit_mynetworks,reject_unauth_destination
smtpd_relay_restrictions = permit_mynetworks permit_sasl_authenticated defer_unauth_destination
smtpd_sasl_auth_enable = yes
smtpd_sasl_local_domain =
smtpd_sasl_path = private/auth
smtpd_sasl_security_options = noanonymous
smtpd_sasl_type = dovecot
smtpd_tls_cert_file = /etc/letsencrypt/live/mydomain.com/fullchain.pem
smtpd_tls_key_file = /etc/letsencrypt/live/mydomain.com/privkey.pem
smtpd_tls_loglevel = 1
smtpd_tls_received_header = yes
smtpd_tls_security_level = may
smtpd_tls_session_cache_database = btree:${data_directory}/smtpd_scache
smtpd_use_tls = no
virtual_alias_maps = mysql:/etc/postfix/sql/mysql_virtual_alias_maps.cf, mysql:/etc/postfix/sql/mysql_virtual_alias_domain_maps.cf, mysql:/etc/postfix/sql/mysql_virtual_alias_domain_catchall_maps.cf
virtual_mailbox_domains = mysql:/etc/postfix/sql/mysql_virtual_domains_maps.cf
virtual_mailbox_maps = mysql:/etc/postfix/sql/mysql_virtual_mailbox_maps.cf, mysql:/etc/postfix/sql/mysql_virtual_alias_domain_mailbox_maps.cf
virtual_transport = lmtp:unix:private/dovecot-lmtp
How can I debug this? And how can I start receiving emails?
UPDATE:
When sending the mail from Gmail I am getting that it is delivered:
Message ID <CALJ3QLOrZD5GhaaaFiXO5xZp+=sjSa1+PF5w=DBgozHB5qEu3A@mail.gmail.com>
Created on: 18 May 2023 at 11:16 (Delivered after 0 seconds)
Here is the mail.log
file:
May 18 11:15:39 3b15 dovecot: imap-login: Login: user=<[email protected]>, method=PLAIN, rip=::1, lip=::1, mpid=4319, secured, session=<8kXxaPP7Yt4AAAAAAAAAAAAAAAAAAAAB>
May 18 11:15:39 3b15 dovecot: imap([email protected])<4319><8kXxaPP7Yt4AAAAAAAAAAAAAAAAAAAAB>: Logged out in=90 out=972 deleted=0 expunged=0 trashed=0 hdr_count=0 hdr_bytes=0 body_count=0 body_bytes=0
May 18 11:16:41 3b15 dovecot: imap-login: Login: user=<[email protected]>, method=PLAIN, rip=::1, lip=::1, mpid=4331, secured, session=<hkGZbPP7dN4AAAAAAAAAAAAAAAAAAAAB>
May 18 11:16:41 3b15 dovecot: imap([email protected])<4331><hkGZbPP7dN4AAAAAAAAAAAAAAAAAAAAB>: Logged out in=90 out=972 deleted=0 expunged=0 trashed=0 hdr_count=0 hdr_bytes=0 body_count=0 body_bytes=0
May 18 11:17:23 3b15 postfix/anvil[4241]: statistics: max connection rate 1/60s for (smtps:212.83.8.79) at May 18 11:14:03
May 18 11:17:23 3b15 postfix/anvil[4241]: statistics: max connection count 1 for (smtps:212.83.8.79) at May 18 11:14:03
May 18 11:17:23 3b15 postfix/anvil[4241]: statistics: max cache size 1 at May 18 11:14:03
May 18 11:17:39 3b15 dovecot: imap-login: Login: user=<[email protected]>, method=PLAIN, rip=::1, lip=::1, mpid=4402, secured, session=<OsMWcPP7it4AAAAAAAAAAAAAAAAAAAAB>
May 18 11:17:39 3b15 dovecot: imap([email protected])<4402><OsMWcPP7it4AAAAAAAAAAAAAAAAAAAAB>: Logged out in=90 out=972 deleted=0 expunged=0 trashed=0 hdr_count=0 hdr_bytes=0 body_count=0 body_bytes=0
May 18 11:18:01 3b15 postfix/pickup[4122]: 8D50342261: uid=33 from=<www-data>
May 18 11:18:01 3b15 postfix/cleanup[4411]: 8D50342261: message-id=<[email protected]>
May 18 11:18:01 3b15 postfix/qmgr[4123]: 8D50342261: from=<[email protected]>, size=745, nrcpt=1 (queue active)
May 18 11:18:01 3b15 postfix/smtp[4413]: 8D50342261: to=<[email protected]>, orig_to=<www-data>, relay=none, delay=0.09, delays=0.06/0.03/0.01/0, dsn=5.4.6, status=bounced (mail for som.time4vps.cloud loops back to myself)
May 18 11:18:01 3b15 postfix/cleanup[4411]: A04B742262: message-id=<[email protected]>
May 18 11:18:01 3b15 postfix/qmgr[4123]: A04B742262: from=<>, size=3524, nrcpt=1 (queue active)
May 18 11:18:01 3b15 postfix/bounce[4414]: 8D50342261: sender non-delivery notification: A04B742262
May 18 11:18:01 3b15 postfix/qmgr[4123]: 8D50342261: removed
May 18 11:18:01 3b15 postfix/smtp[4413]: A04B742262: to=<[email protected]>, relay=none, delay=0.01, delays=0.01/0/0/0, dsn=5.4.6, status=bounced (mail for som.time4vps.cloud loops back to myself)
May 18 11:18:01 3b15 postfix/qmgr[4123]: A04B742262: removed
I tried to change mydestination = localhost.$mydomain, localhost, mail.$mydomain, $mydomain
but still no luck.