LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 05-08-2024, 09:31 AM   #1
devpaulius
LQ Newbie
 
Registered: Mar 2024
Location: Lithuania
Posts: 7

Rep: Reputation: 0
CentOS 7 Mail server error (User unknown in virtual alias table) Dovecot Postfix MySQL


postconf -n:
alias_database = hash:/etc/aliases
alias_maps = hash:/etc/aliases
append_dot_mydomain = no
biff = no
broken_sasl_auth_clients = yes
command_directory = /usr/sbin
config_directory = /etc/postfix
daemon_directory = /usr/libexec/postfix
data_directory = /var/lib/postfix
dovecot_destination_recipient_limit = 1
html_directory = no
inet_interfaces = all
inet_protocols = all
mail_owner = postfix
mailbox_command = /usr/lib/dovecot/deliver
mailq_path = /usr/bin/mailq.postfix
manpage_directory = /usr/share/man
message_size_limit = 3000720000
mua_client_restrictions = permit_sasl_authenticated, reject
mua_helo_restrictions = permit_mynetworks, reject_non_fqdn_hostname, reject_invalid_hostname, permit
mua_sender_restrictions = permit_sasl_authenticated, reject
mydestination = mail.domain.com
mydomain = domain.com
myhostname = mail.domain.com
myorigin = $mydomain
newaliases_path = /usr/bin/newaliases.postfix
queue_directory = /var/spool/postfix
readme_directory = /usr/share/doc/postfix-2.10.1/README_FILES
relayhost = smtp.domain.com
sample_directory = /usr/share/doc/postfix-2.10.1/samples
sendmail_path = /usr/sbin/sendmail.postfix
setgid_group = postdrop
smtp_tls_mandatory_protocols = !SSLv2, !SSLv3
smtpd_recipient_restrictions = permit_mynetworks, permit_auth_destination, permit_sasl_authenticated, reject
smtpd_restriction_classes = mua_sender_restrictions, mua_client_restrictions, mua_helo_restrictions
smtpd_sasl_auth_enable = yes
smtpd_sasl_authenticated_header = yes
smtpd_sasl_local_domain = $myhostname
smtpd_sasl_path = private/auth
smtpd_sasl_security_options = noanonymous
smtpd_sasl_type = dovecot
smtpd_tls_cert_file = /etc/letsencrypt/live/mail.domain.com/fullchain.pem
smtpd_tls_key_file = /etc/letsencrypt/live/mail.domain.com/privkey.pem
smtpd_tls_mandatory_protocols = !SSLv2, !SSLv3
smtpd_tls_session_cache_database = btree:${data_directory}/smtpd_scache
smtpd_use_tls = yes
transport_maps = *
unknown_local_recipient_reject_code = 550
virtual_alias_domains =
virtual_alias_maps = mysql:/etc/postfix/mysql_alias.cf
virtual_gid_maps = static:5000
virtual_mailbox_base = /home/vmail
virtual_mailbox_domains = mysql:/etc/postfix/mysql_domains.cf
virtual_mailbox_maps = mysql:/etc/postfix/mysql_users.cf
virtual_transport = dovecot
virtual_uid_maps = static:5000

doveconf -n:
# 2.2.36 (1f10bfa63): /etc/dovecot/dovecot.conf
# OS: Linux 3.10.0-1160.108.1.el7.x86_64 x86_64 CentOS Linux release 7.9.2009 (Core) xfs
# Hostname: mail.domain.com
auth_mechanisms = plain login
disable_plaintext_auth = no
first_valid_uid = 1000
listen = *
mail_location = maildir:/home/vmail/%d/%n
mbox_write_locks = fcntl
namespace inbox {
hidden = no
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 = INBOX.
separator = .
type = private
}
passdb {
args = /etc/dovecot/dovecot-sql.conf.ext
driver = sql
}
service auth-worker {
user = root
}
service auth {
unix_listener /var/spool/postfix/private/auth {
group = postfix
mode = 0666
user = postfix
}
unix_listener auth-master {
mode = 0600
user = vmail
}
user = root
}
service imap-login {
inet_listener imap {
port = 143
}
inet_listener imaps {
port = 993
ssl = yes
}
}
service lmtp {
unix_listener /var/spool/postfix/private/dovecot-lmtp {
group = postfix
mode = 0600
user = postfix
}
unix_listener lmtp {
mode = 0666
}
}
service pop3-login {
inet_listener pop3 {
port = 110
}
inet_listener pop3s {
port = 995
ssl = yes
}
}
ssl = no
ssl_cert = </etc/letsencrypt/live/mail.domain.com/fullchain.pem
ssl_key = # hidden, use -P to show it
userdb {
args = /etc/dovecot/dovecot-sql.conf.ext
driver = sql
}
userdb {
args = uid=vmail gid=vmail home=/home/vmail/%d/%n
driver = static
}
protocol lda {
auth_socket_path = /var/run/dovecot/auth-master
log_path = /home/vmail/dovecot-deliver.log
postmaster_address = postmaster@domain.com
}
protocol pop3 {
pop3_uidl_format = %08Xu%08Xv
}

I'm encountering an issue with my mail server configuration on CentOS 7. Specifically, I'm unable to send emails to remote mail servers such as Gmail or any other domain. Initially, I included transport_maps, but encountered a "user unknown" error. To address this, I added transport_maps = hash:/etc/postfix/transport, which resolved the issue with Gmail by specifying gmail.com smtp:[smtp.gmail.com]:587. However, this fix only applies to Gmail, and I still cannot send emails to other domains like user@domain.com, .org, or .net.

Locally, I can both send and receive emails without any problems. However, the issue persists when attempting to send emails remotely...
 
Old 05-08-2024, 01:19 PM   #2
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 26,710

Rep: Reputation: 7972Reputation: 7972Reputation: 7972Reputation: 7972Reputation: 7972Reputation: 7972Reputation: 7972Reputation: 7972Reputation: 7972Reputation: 7972Reputation: 7972
Quote:
Originally Posted by devpaulius View Post
postconf -n:
Code:
alias_database = hash:/etc/aliases
alias_maps = hash:/etc/aliases
append_dot_mydomain = no
biff = no
broken_sasl_auth_clients = yes
command_directory = /usr/sbin
config_directory = /etc/postfix
daemon_directory = /usr/libexec/postfix
data_directory = /var/lib/postfix
dovecot_destination_recipient_limit = 1
html_directory = no
inet_interfaces = all
inet_protocols = all
mail_owner = postfix
mailbox_command = /usr/lib/dovecot/deliver
mailq_path = /usr/bin/mailq.postfix
manpage_directory = /usr/share/man
message_size_limit = 3000720000
mua_client_restrictions = permit_sasl_authenticated, reject
mua_helo_restrictions = permit_mynetworks, reject_non_fqdn_hostname, reject_invalid_hostname, permit
mua_sender_restrictions = permit_sasl_authenticated, reject
mydestination = mail.domain.com
mydomain = domain.com
myhostname = mail.domain.com
myorigin = $mydomain
newaliases_path = /usr/bin/newaliases.postfix
queue_directory = /var/spool/postfix
readme_directory = /usr/share/doc/postfix-2.10.1/README_FILES
relayhost = smtp.domain.com
sample_directory = /usr/share/doc/postfix-2.10.1/samples
sendmail_path = /usr/sbin/sendmail.postfix
setgid_group = postdrop
smtp_tls_mandatory_protocols = !SSLv2, !SSLv3
smtpd_recipient_restrictions = permit_mynetworks, permit_auth_destination, permit_sasl_authenticated, reject
smtpd_restriction_classes = mua_sender_restrictions, mua_client_restrictions, mua_helo_restrictions
smtpd_sasl_auth_enable = yes
smtpd_sasl_authenticated_header = yes
smtpd_sasl_local_domain = $myhostname
smtpd_sasl_path = private/auth
smtpd_sasl_security_options = noanonymous
smtpd_sasl_type = dovecot
smtpd_tls_cert_file = /etc/letsencrypt/live/mail.domain.com/fullchain.pem
smtpd_tls_key_file = /etc/letsencrypt/live/mail.domain.com/privkey.pem
smtpd_tls_mandatory_protocols = !SSLv2, !SSLv3
smtpd_tls_session_cache_database = btree:${data_directory}/smtpd_scache
smtpd_use_tls = yes
transport_maps = *
unknown_local_recipient_reject_code = 550
virtual_alias_domains =
virtual_alias_maps = mysql:/etc/postfix/mysql_alias.cf
virtual_gid_maps = static:5000
virtual_mailbox_base = /home/vmail
virtual_mailbox_domains = mysql:/etc/postfix/mysql_domains.cf
virtual_mailbox_maps = mysql:/etc/postfix/mysql_users.cf
virtual_transport = dovecot
virtual_uid_maps = static:5000

doveconf -n:
# 2.2.36 (1f10bfa63): /etc/dovecot/dovecot.conf
# OS: Linux 3.10.0-1160.108.1.el7.x86_64 x86_64 CentOS Linux release 7.9.2009 (Core) xfs
# Hostname: mail.domain.com
auth_mechanisms = plain login
disable_plaintext_auth = no
first_valid_uid = 1000
listen = *
mail_location = maildir:/home/vmail/%d/%n
mbox_write_locks = fcntl
namespace inbox {
  hidden = no
  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 = INBOX.
  separator = .
  type = private
}
passdb {
  args = /etc/dovecot/dovecot-sql.conf.ext
  driver = sql
}
service auth-worker {
  user = root
}
service auth {
  unix_listener /var/spool/postfix/private/auth {
    group = postfix
    mode = 0666
    user = postfix
  }
  unix_listener auth-master {
    mode = 0600
    user = vmail
  }
  user = root
}
service imap-login {
  inet_listener imap {
    port = 143
  }
  inet_listener imaps {
    port = 993
    ssl = yes
  }
}
service lmtp {
  unix_listener /var/spool/postfix/private/dovecot-lmtp {
    group = postfix
    mode = 0600
    user = postfix
  }
  unix_listener lmtp {
    mode = 0666
  }
}
service pop3-login {
  inet_listener pop3 {
    port = 110
  }
  inet_listener pop3s {
    port = 995
    ssl = yes
  }
}
ssl = no
ssl_cert = </etc/letsencrypt/live/mail.domain.com/fullchain.pem
ssl_key =  # hidden, use -P to show it
userdb {
  args = /etc/dovecot/dovecot-sql.conf.ext
  driver = sql
}
userdb {
  args = uid=vmail gid=vmail home=/home/vmail/%d/%n
  driver = static
}
protocol lda {
  auth_socket_path = /var/run/dovecot/auth-master
  log_path = /home/vmail/dovecot-deliver.log
  postmaster_address = postmaster@domain.com
}
protocol pop3 {
  pop3_uidl_format = %08Xu%08Xv
}
I'm encountering an issue with my mail server configuration on CentOS 7. Specifically, I'm unable to send emails to remote mail servers such as Gmail or any other domain. Initially, I included transport_maps, but encountered a "user unknown" error. To address this, I added transport_maps = hash:/etc/postfix/transport, which resolved the issue with Gmail by specifying gmail.com smtp:[smtp.gmail.com]:587. However, this fix only applies to Gmail, and I still cannot send emails to other domains like user@domain.com, .org, or .net. Locally, I can both send and receive emails without any problems. However, the issue persists when attempting to send emails remotely...
Right, because you haven't set a relay host up to send mail your system doesn't know what to do with. You have a relay at smtp.domain.com (assuming you sanitized that), which means it only knows about YOUR domain, and (thanks to the transport map) Gmail. You need a relay host that is outside your domain.
 
Old 05-09-2024, 12:51 AM   #3
devpaulius
LQ Newbie
 
Registered: Mar 2024
Location: Lithuania
Posts: 7

Original Poster
Rep: Reputation: 0
Question

Quote:
Originally Posted by TB0ne View Post
Right, because you haven't set a relay host up to send mail your system doesn't know what to do with. You have a relay at smtp.domain.com (assuming you sanitized that), which means it only knows about YOUR domain, and (thanks to the transport map) Gmail. You need a relay host that is outside your domain.
I recently removed the relayhost and transport_maps configurations because I aimed to send emails to any destination, including Yahoo, Gmail, and others. However, since their removal, I've encountered an error when attempting to send emails. The error message reads as follows:
May 9 08:44:26 mail postfix/pipe[17862]: AF62FF822: to=<auser@gmail.com>, relay=dovecot, delay=0.13, delays=0.06/0.02/0/0.05, dsn=5.1.1, status=bounced (user unknown)
It seems that the server is unable to deliver the email to the specified user (auser@gmail.com), resulting in a "user unknown" status.
 
Old 05-09-2024, 07:36 AM   #4
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 26,710

Rep: Reputation: 7972Reputation: 7972Reputation: 7972Reputation: 7972Reputation: 7972Reputation: 7972Reputation: 7972Reputation: 7972Reputation: 7972Reputation: 7972Reputation: 7972
Quote:
Originally Posted by devpaulius View Post
I recently removed the relayhost and transport_maps configurations because I aimed to send emails to any destination, including Yahoo, Gmail, and others. However, since their removal, I've encountered an error when attempting to send emails. The error message reads as follows:
Code:
May 9 08:44:26 mail postfix/pipe[17862]: AF62FF822: to=<auser@gmail.com>, relay=dovecot, delay=0.13, delays=0.06/0.02/0/0.05, dsn=5.1.1, status=bounced (user unknown)
It seems that the server is unable to deliver the email to the specified user (auser@gmail.com), resulting in a "user unknown" status.
Right...again, if you don't have a relay host set up, or your server is not the primary mail server for a company (that is, a domain registered, DNS, etc), then your mail has nowhere to go.

Is this your authoritative mail server, or just one that sends emails to other servers??? If so...set up a relay host. Whatever is processing the mail needs to know how to reach other domains. If this is for a business and is a new installation, you need to stop where you are and install something other than the very old CentOS 7.
 
Old 05-09-2024, 07:52 AM   #5
devpaulius
LQ Newbie
 
Registered: Mar 2024
Location: Lithuania
Posts: 7

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by TB0ne View Post
Right...again, if you don't have a relay host set up, or your server is not the primary mail server for a company (that is, a domain registered, DNS, etc), then your mail has nowhere to go.

Is this your authoritative mail server, or just one that sends emails to other servers??? If so...set up a relay host. Whatever is processing the mail needs to know how to reach other domains. If this is for a business and is a new installation, you need to stop where you are and install something other than the very old CentOS 7.
I am currently experiencing a problem with my mail server, which is essential for my business operations. Despite its age, I am optimistic that there is a solution. Previously, I encountered no issues while using the same operating system with DirectAdmin installed; sending and receiving emails was seamless.

However, since removing DirectAdmin, I have encountered a new problem. Although I can still send emails without difficulty, I am unable to receive the content. I am confident that there is a resolution to this issue, and any assistance you can provide would be greatly appreciated.

I now require assistance in resolving the sending issue.

updated configuration

postconf -n:
alias_database = hash:/etc/aliases
alias_maps = hash:/etc/aliases
append_dot_mydomain = no
biff = no
broken_sasl_auth_clients = yes
command_directory = /usr/sbin
config_directory = /etc/postfix
daemon_directory = /usr/libexec/postfix
data_directory = /var/lib/postfix
dovecot_destination_recipient_limit = 1
html_directory = no
inet_interfaces = all
inet_protocols = all
mail_owner = postfix
mailbox_command = /usr/lib/dovecot/deliver
mailq_path = /usr/bin/mailq.postfix
manpage_directory = /usr/share/man
message_size_limit = 3000720000
mua_client_restrictions = permit_sasl_authenticated, reject
mua_helo_restrictions = permit_mynetworks, reject_non_fqdn_hostname, reject_invalid_hostname, permit
mua_sender_restrictions = permit_sasl_authenticated, reject
mydestination = mail.domain.com
mydomain = domain.com
myhostname = mail.domain.com
myorigin = $mydomain
newaliases_path = /usr/bin/newaliases.postfix
queue_directory = /var/spool/postfix
readme_directory = /usr/share/doc/postfix-2.10.1/README_FILES
relayhost = smtp.domain.com
sample_directory = /usr/share/doc/postfix-2.10.1/samples
sendmail_path = /usr/sbin/sendmail.postfix
setgid_group = postdrop
smtp_tls_mandatory_protocols = !SSLv2, !SSLv3
smtpd_recipient_restrictions = permit_mynetworks, permit_auth_destination, permit_sasl_authenticated, reject
smtpd_restriction_classes = mua_sender_restrictions, mua_client_restrictions, mua_helo_restrictions
smtpd_sasl_auth_enable = yes
smtpd_sasl_authenticated_header = yes
smtpd_sasl_local_domain = $myhostname
smtpd_sasl_path = private/auth
smtpd_sasl_security_options = noanonymous
smtpd_sasl_type = dovecot
smtpd_tls_cert_file = /etc/letsencrypt/live/mail.domain.com/fullchain.pem
smtpd_tls_key_file = /etc/letsencrypt/live/mail.domain.com/privkey.pem
smtpd_tls_mandatory_protocols = !SSLv2, !SSLv3
smtpd_tls_session_cache_database = btree:${data_directory}/smtpd_scache
smtpd_use_tls = yes
unknown_local_recipient_reject_code = 550
virtual_alias_domains =
virtual_alias_maps = mysql:/etc/postfix/mysql_alias.cf
virtual_gid_maps = static:5000
virtual_mailbox_base = /home/vmail
virtual_mailbox_domains = mysql:/etc/postfix/mysql_domains.cf
virtual_mailbox_maps = mysql:/etc/postfix/mysql_users.cf
virtual_transport = dovecot
virtual_uid_maps = static:5000

doveconf -n:
# 2.2.36 (1f10bfa63): /etc/dovecot/dovecot.conf
# OS: Linux 3.10.0-1160.108.1.el7.x86_64 x86_64 CentOS Linux release 7.9.2009 (Core) xfs
# Hostname: mail.domain.com
auth_mechanisms = plain login
disable_plaintext_auth = no
first_valid_uid = 1000
listen = *
mail_location = maildir:/home/vmail/%d/%n
mbox_write_locks = fcntl
namespace inbox {
hidden = no
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 = INBOX.
separator = .
type = private
}
passdb {
args = /etc/dovecot/dovecot-sql.conf.ext
driver = sql
}
service auth-worker {
user = root
}
service auth {
unix_listener /var/spool/postfix/private/auth {
group = postfix
mode = 0666
user = postfix
}
unix_listener auth-master {
mode = 0600
user = vmail
}
user = root
}
service imap-login {
inet_listener imap {
port = 143
}
inet_listener imaps {
port = 993
ssl = yes
}
}
service lmtp {
unix_listener /var/spool/postfix/private/dovecot-lmtp {
group = postfix
mode = 0600
user = postfix
}
unix_listener lmtp {
mode = 0666
}
}
service pop3-login {
inet_listener pop3 {
port = 110
}
inet_listener pop3s {
port = 995
ssl = yes
}
}
ssl = no
ssl_cert = </etc/letsencrypt/live/mail.domain.com/fullchain.pem
ssl_key = # hidden, use -P to show it
userdb {
args = /etc/dovecot/dovecot-sql.conf.ext
driver = sql
}
userdb {
args = uid=vmail gid=vmail home=/home/vmail/%d/%n
driver = static
}
protocol lda {
auth_socket_path = /var/run/dovecot/auth-master
log_path = /home/vmail/dovecot-deliver.log
postmaster_address = postmaster@domain.com
}
protocol pop3 {
pop3_uidl_format = %08Xu%08Xv
}

the error:
May 9 15:51:12 mail postfix/pipe[23859]: B91C2D611: to=<usera@gmail.com>, relay=dovecot, delay=0.12, delays=0.07/0.02/0/0.04, dsn=5.1.1, status=bounced (user unknown)

Last edited by devpaulius; 05-09-2024 at 07:53 AM. Reason: added error
 
Old 05-09-2024, 08:33 AM   #6
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 26,710

Rep: Reputation: 7972Reputation: 7972Reputation: 7972Reputation: 7972Reputation: 7972Reputation: 7972Reputation: 7972Reputation: 7972Reputation: 7972Reputation: 7972Reputation: 7972
Quote:
Originally Posted by devpaulius View Post
I am currently experiencing a problem with my mail server, which is essential for my business operations. Despite its age, I am optimistic that there is a solution. Previously, I encountered no issues while using the same operating system with DirectAdmin installed; sending and receiving emails was seamless.

However, since removing DirectAdmin, I have encountered a new problem. Although I can still send emails without difficulty, I am unable to receive the content. I am confident that there is a resolution to this issue, and any assistance you can provide would be greatly appreciated. I now require assistance in resolving the sending issue. updated configuration
Code:
postconf -n:
alias_database = hash:/etc/aliases
alias_maps = hash:/etc/aliases
append_dot_mydomain = no
biff = no
broken_sasl_auth_clients = yes
command_directory = /usr/sbin
config_directory = /etc/postfix
daemon_directory = /usr/libexec/postfix
data_directory = /var/lib/postfix
dovecot_destination_recipient_limit = 1
html_directory = no
inet_interfaces = all
inet_protocols = all
mail_owner = postfix
mailbox_command = /usr/lib/dovecot/deliver
mailq_path = /usr/bin/mailq.postfix
manpage_directory = /usr/share/man
message_size_limit = 3000720000
mua_client_restrictions = permit_sasl_authenticated, reject
mua_helo_restrictions = permit_mynetworks, reject_non_fqdn_hostname, reject_invalid_hostname, permit
mua_sender_restrictions = permit_sasl_authenticated, reject
mydestination = mail.domain.com
mydomain = domain.com
myhostname = mail.domain.com
myorigin = $mydomain
newaliases_path = /usr/bin/newaliases.postfix
queue_directory = /var/spool/postfix
readme_directory = /usr/share/doc/postfix-2.10.1/README_FILES
relayhost = smtp.domain.com
sample_directory = /usr/share/doc/postfix-2.10.1/samples
sendmail_path = /usr/sbin/sendmail.postfix
setgid_group = postdrop
smtp_tls_mandatory_protocols = !SSLv2, !SSLv3
smtpd_recipient_restrictions = permit_mynetworks, permit_auth_destination, permit_sasl_authenticated, reject
smtpd_restriction_classes = mua_sender_restrictions, mua_client_restrictions, mua_helo_restrictions
smtpd_sasl_auth_enable = yes
smtpd_sasl_authenticated_header = yes
smtpd_sasl_local_domain = $myhostname
smtpd_sasl_path = private/auth
smtpd_sasl_security_options = noanonymous
smtpd_sasl_type = dovecot
smtpd_tls_cert_file = /etc/letsencrypt/live/mail.domain.com/fullchain.pem
smtpd_tls_key_file = /etc/letsencrypt/live/mail.domain.com/privkey.pem
smtpd_tls_mandatory_protocols = !SSLv2, !SSLv3
smtpd_tls_session_cache_database = btree:${data_directory}/smtpd_scache
smtpd_use_tls = yes
unknown_local_recipient_reject_code = 550
virtual_alias_domains =
virtual_alias_maps = mysql:/etc/postfix/mysql_alias.cf
virtual_gid_maps = static:5000
virtual_mailbox_base = /home/vmail
virtual_mailbox_domains = mysql:/etc/postfix/mysql_domains.cf
virtual_mailbox_maps = mysql:/etc/postfix/mysql_users.cf
virtual_transport = dovecot
virtual_uid_maps = static:5000

doveconf -n:
# 2.2.36 (1f10bfa63): /etc/dovecot/dovecot.conf
# OS: Linux 3.10.0-1160.108.1.el7.x86_64 x86_64 CentOS Linux release 7.9.2009 (Core) xfs
# Hostname: mail.domain.com
auth_mechanisms = plain login
disable_plaintext_auth = no
first_valid_uid = 1000
listen = *
mail_location = maildir:/home/vmail/%d/%n
mbox_write_locks = fcntl
namespace inbox {
  hidden = no
  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 = INBOX.
  separator = .
  type = private
}
passdb {
  args = /etc/dovecot/dovecot-sql.conf.ext
  driver = sql
}
service auth-worker {
  user = root
}
service auth {
  unix_listener /var/spool/postfix/private/auth {
    group = postfix
    mode = 0666
    user = postfix
  }
  unix_listener auth-master {
    mode = 0600
    user = vmail
  }
  user = root
}
service imap-login {
  inet_listener imap {
    port = 143
  }
  inet_listener imaps {
    port = 993
    ssl = yes
  }
}
service lmtp {
  unix_listener /var/spool/postfix/private/dovecot-lmtp {
    group = postfix
    mode = 0600
    user = postfix
  }
  unix_listener lmtp {
    mode = 0666
  }
}
service pop3-login {
  inet_listener pop3 {
    port = 110
  }
  inet_listener pop3s {
    port = 995
    ssl = yes
  }
}
ssl = no
ssl_cert = </etc/letsencrypt/live/mail.domain.com/fullchain.pem
ssl_key =  # hidden, use -P to show it
userdb {
  args = /etc/dovecot/dovecot-sql.conf.ext
  driver = sql
}
userdb {
  args = uid=vmail gid=vmail home=/home/vmail/%d/%n
  driver = static
}
protocol lda {
  auth_socket_path = /var/run/dovecot/auth-master
  log_path = /home/vmail/dovecot-deliver.log
  postmaster_address = postmaster@domain.com
}
protocol pop3 {
  pop3_uidl_format = %08Xu%08Xv
}

the error:
May  9 15:51:12 mail postfix/pipe[23859]: B91C2D611: to=<usera@gmail.com>, relay=dovecot, delay=0.12, delays=0.07/0.02/0/0.04, dsn=5.1.1, status=bounced (user unknown)
Stop posting huge chunks of things like this without putting it in CODE tags; it makes your posts very difficult to read. And if it's 'essential to your business operation', why are you running an old system??

Your initial post said you couldn't send emails...now you're saying you CAN send emails, but can't receive them. Which is it??? Posting your configuration helps only so much, but you haven't describe the environment you're in, what other servers/firewalls/networks are in place, what you send mail through upstream, tell us if you've configured your server to be the primary server (along with DNS, MX records, etc., etc....all the things a real email server needs), or give details.

And if things WERE working and you removed something and now they're not...you have successfully identified the problem. WHY did you remove it, and why haven't you reinstalled it??
 
Old 05-11-2024, 05:43 AM   #7
devpaulius
LQ Newbie
 
Registered: Mar 2024
Location: Lithuania
Posts: 7

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by TB0ne View Post
Stop posting huge chunks of things like this without putting it in CODE tags; it makes your posts very difficult to read. And if it's 'essential to your business operation', why are you running an old system??

Your initial post said you couldn't send emails...now you're saying you CAN send emails, but can't receive them. Which is it??? Posting your configuration helps only so much, but you haven't describe the environment you're in, what other servers/firewalls/networks are in place, what you send mail through upstream, tell us if you've configured your server to be the primary server (along with DNS, MX records, etc., etc....all the things a real email server needs), or give details.

And if things WERE working and you removed something and now they're not...you have successfully identified the problem. WHY did you remove it, and why haven't you reinstalled it??
Sorry, my bad i can't send and i can receive. I use old system because it's my choice please understand that. Okay thanks i will do with code tags another post. I reinstalled because it was previous configuration good for sending but bad for receiving now it's vice versa.
okay here's DNS
Code:
@                                   3600        IN      MX      10      mail.domain.com.
domain.com.                        3600        IN      TXT     "v=spf1 ip4:IPV4 include:mail.domain.com -all"
_dmarc.domain.com.                 3600        IN      TXT     "v=DMARC1; p=quarantine; rua=mailto:postmaster@domain.com; ruf=mailto:abuse@domain.com; fo=1"
I have opened all ports which needed for mail server. Here's ports:

Code:
    SMTP: 25, 587, 465
    POP3: 110, 995
    IMAP: 143, 993
    LMTP: 24
Logs:

Code:
May 11 13:35:55 mail postfix/submission/smtpd[10103]: warning: hostname IPV4.DOMAIN.COM does not resolve to address IPV4: Name or service not known

May 11 13:36:57 mail postfix/submission/smtpd[10103]: warning: hostname IPV4.DOMAIN.COM does not resolve to address IPV4: Name or service not known
May 11 13:36:57 mail postfix/submission/smtpd[10103]: connect from unknown[IPV4]
May 11 13:36:58 mail postfix/submission/smtpd[10383]: connect from mail.domain.com[SERVER_IPV4]
May 11 13:36:58 mail postfix/submission/smtpd[10383]: 25FBCF943: client=mail.domain.com[SERVER_IPV4], sasl_method=LOGIN, sasl_username=userb@domain.com
May 11 13:36:58 mail postfix/cleanup[10386]: 25FBCF943: message-id=<8817cd30513637e5165fb9184e000b3a@domain.com>
May 11 13:36:58 mail postfix/qmgr[18103]: 25FBCF943: from=<userb@domain.com>, size=648, nrcpt=1 (queue active)
May 11 13:36:58 mail postfix/submission/smtpd[10383]: disconnect from mail.domain.com[SERVER_IPV4]
May 11 13:36:58 mail dovecot: imap-login: Login: user=<userb@domain.com>, method=LOGIN, rip=SERVER_IPV4, lip=SERVER_IPV4, mpid=10391, secured, session=<+BdTOysYJKJY3pZg>
May 11 13:36:58 mail postfix/pipe[10388]: 25FBCF943: to=<usera@gmail.com>, relay=dovecot, delay=0.13, delays=0.07/0.01/0/0.05, dsn=5.1.1, status=bounced (user unknown)
May 11 13:36:58 mail postfix/cleanup[10386]: 43F8FF947: message-id=<20240511103658.43F8FF947@mail.domain.com>
May 11 13:36:58 mail postfix/bounce[10392]: 25FBCF943: sender non-delivery notification: 43F8FF947
May 11 13:36:58 mail postfix/qmgr[18103]: 43F8FF947: from=<>, size=2396, nrcpt=1 (queue active)
May 11 13:36:58 mail postfix/qmgr[18103]: 25FBCF943: removed
May 11 13:36:58 mail dovecot: imap(userb@domain.com): Logged out in=509 out=692
May 11 13:36:58 mail postfix/pipe[10388]: 43F8FF947: to=<userb@domain.com>, relay=dovecot, delay=0.07, delays=0.02/0/0/0.05, dsn=2.0.0, status=sent (delivered via dovecot service)
May 11 13:36:58 mail postfix/qmgr[18103]: 43F8FF947: removed
OS: CentOS 7
 
Old 05-11-2024, 09:54 AM   #8
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 26,710

Rep: Reputation: 7972Reputation: 7972Reputation: 7972Reputation: 7972Reputation: 7972Reputation: 7972Reputation: 7972Reputation: 7972Reputation: 7972Reputation: 7972Reputation: 7972
Quote:
Originally Posted by devpaulius View Post
Sorry, my bad i can't send and i can receive. I use old system because it's my choice please understand that.
And you need to understand that running an old system leaves you vulnerable to security problems, and the inability to update things. There is NO REASON to, especially since Linux is free.
Quote:
Okay thanks i will do with code tags another post. I reinstalled because it was previous configuration good for sending but bad for receiving now it's vice versa.
So we're back to saying you can't send but can receive.
Quote:
okay here's DNS
Code:
@                                   3600        IN      MX      10      mail.domain.com.
domain.com.                        3600        IN      TXT     "v=spf1 ip4:IPV4 include:mail.domain.com -all"
_dmarc.domain.com.                 3600        IN      TXT     "v=DMARC1; p=quarantine; rua=mailto:postmaster@domain.com; ruf=mailto:abuse@domain.com; fo=1"
I have opened all ports which needed for mail server. Here's ports:
Code:
    SMTP: 25, 587, 465
    POP3: 110, 995
    IMAP: 143, 993
    LMTP: 24
Not sure why you posted that, since we have no way of knowing if it's correct or not; you were asked specifically if this server was set up on the Internet, and if you've configured it to be a mail server, with a registered domain and done ALL the other many pieces you need to make a mail server function. It would seem like you have not, which is why you can't send mail. You don't have an authoritative mail server to handle unknown addresses. This:
Quote:
Logs:
Code:
May 11 13:35:55 mail postfix/submission/smtpd[10103]: warning: hostname IPV4.DOMAIN.COM does not resolve to address IPV4: Name or service not known
May 11 13:36:57 mail postfix/submission/smtpd[10103]: warning: hostname IPV4.DOMAIN.COM does not resolve to address IPV4: Name or service not known
May 11 13:36:57 mail postfix/submission/smtpd[10103]: connect from unknown[IPV4]
May 11 13:36:58 mail postfix/submission/smtpd[10383]: connect from mail.domain.com[SERVER_IPV4]
May 11 13:36:58 mail postfix/submission/smtpd[10383]: 25FBCF943: client=mail.domain.com[SERVER_IPV4], sasl_method=LOGIN, sasl_username=userb@domain.com
May 11 13:36:58 mail postfix/cleanup[10386]: 25FBCF943: message-id=<8817cd30513637e5165fb9184e000b3a@domain.com>
May 11 13:36:58 mail postfix/qmgr[18103]: 25FBCF943: from=<userb@domain.com>, size=648, nrcpt=1 (queue active)
May 11 13:36:58 mail postfix/submission/smtpd[10383]: disconnect from mail.domain.com[SERVER_IPV4]
May 11 13:36:58 mail dovecot: imap-login: Login: user=<userb@domain.com>, method=LOGIN, rip=SERVER_IPV4, lip=SERVER_IPV4, mpid=10391, secured, session=<+BdTOysYJKJY3pZg>
May 11 13:36:58 mail postfix/pipe[10388]: 25FBCF943: to=<usera@gmail.com>, relay=dovecot, delay=0.13, delays=0.07/0.01/0/0.05, dsn=5.1.1, status=bounced (user unknown)
May 11 13:36:58 mail postfix/cleanup[10386]: 43F8FF947: message-id=<20240511103658.43F8FF947@mail.domain.com>
May 11 13:36:58 mail postfix/bounce[10392]: 25FBCF943: sender non-delivery notification: 43F8FF947
May 11 13:36:58 mail postfix/qmgr[18103]: 43F8FF947: from=<>, size=2396, nrcpt=1 (queue active)
May 11 13:36:58 mail postfix/qmgr[18103]: 25FBCF943: removed
May 11 13:36:58 mail dovecot: imap(userb@domain.com): Logged out in=509 out=692
May 11 13:36:58 mail postfix/pipe[10388]: 43F8FF947: to=<userb@domain.com>, relay=dovecot, delay=0.07, delays=0.02/0/0/0.05, dsn=2.0.0, status=sent (delivered via dovecot service)
May 11 13:36:58 mail postfix/qmgr[18103]: 43F8FF947: removed
...says you're trying to relay things, but don't have a relay server set up...it has nowhere to go. So either that "dovecot" server you have isn't running to handle things, or you need to (AGAIN) find a relay host to shovel your mail through.
 
Old 05-11-2024, 11:41 AM   #9
devpaulius
LQ Newbie
 
Registered: Mar 2024
Location: Lithuania
Posts: 7

Original Poster
Rep: Reputation: 0
Exclamation

Quote:
Originally Posted by TB0ne View Post
And you need to understand that running an old system leaves you vulnerable to security problems, and the inability to update things. There is NO REASON to, especially since Linux is free.
I don't want to update CentOS, and now I'm searching in this forum to find out how to solve the problem.

Quote:
Originally Posted by TB0ne View Post
So we're back to saying you can't send but can receive.

Not sure why you posted that, since we have no way of knowing if it's correct or not; you were asked specifically if this server was set up on the Internet, and if you've configured it to be a mail server, with a registered domain and done ALL the other many pieces you need to make a mail server function. It would seem like you have not, which is why you can't send mail. You don't have an authoritative mail server to handle unknown addresses. This:

...says you're trying to relay things, but don't have a relay server set up...it has nowhere to go. So either that "dovecot" server you have isn't running to handle things, or you need to (AGAIN) find a relay host to shovel your mail through.
Yes, it's quite amusing. It could either be a case of miscommunication or perhaps you're overlooking the configuration and attributing the entire issue to the operating system simply because it's outdated.
 
Old 05-13-2024, 05:56 PM   #10
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 26,710

Rep: Reputation: 7972Reputation: 7972Reputation: 7972Reputation: 7972Reputation: 7972Reputation: 7972Reputation: 7972Reputation: 7972Reputation: 7972Reputation: 7972Reputation: 7972
Quote:
Originally Posted by devpaulius View Post
I don't want to update CentOS, and now I'm searching in this forum to find out how to solve the problem. Yes, it's quite amusing. It could either be a case of miscommunication or perhaps you're overlooking the configuration and attributing the entire issue to the operating system simply because it's outdated.
No, it's because you're not paying attention to what's getting told to you. Not amusing in any way to keep repeating things...the fact that you can use a transport map to send to Gmail indicates things are working, but you DO NOT have a full mail server set up. That is *AGAIN* to do with MX records, DNS setup, domain registration on the Internet, and all the other pieces that go along with a mail server. You *STILL* don't tell us if this has ever worked, what the setup is, if you've done the domain registration, etc., nor if you try to set up a relay host further upstream (or have one to use). Nothing about your environment at all; you just keep repeating it doesn't work, and posting your config.

AGAIN: this is very involved, and using an old system is NOT A GOOD IDEA, because if your server is on the Internet using an old OS that can't be patched, and you're seriously going to run an email server which is VERY exposed, bad things will happen. Good luck

https://www.linuxbabe.com/redhat/run...ix-smtp-server
 
  


Reply

Tags
centos 7, mail, mailserver, postfix, server



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
CentOS 7 Mail server error (User unknown in virtual alias table) Dovecot Postfix MySQL devpaulius Linux - Server 3 03-23-2024 09:40 AM
Postfix: error using LDAP as backend with error User unknown in virtual alias table ludomania007 Linux - Server 4 07-15-2021 08:07 AM
[POSTFIX] User Unknown in Virtual Alias Table Error - Unable to Forward Mail to Gmail DevAndy Linux - Server 4 01-01-2014 06:28 PM
Recipient address rejected: User unknown in virtual alias table Phiggy Linux - Server 6 11-08-2009 05:34 PM
qmail stats:Recipient address rejected: User unknown in virtual alias table/Giving up Niceman2005 Linux - Software 0 08-19-2007 08:13 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 05:40 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration