How to add user to postfix? [closed]

I created and configured postfix with davecot, everything seems to work:

Dec 20 10:31:32 mailer dovecot: master: Warning: Killed with signal 15 (by pid=8470 uid=0 code=kill)
Dec 20 10:33:03 mailer dovecot: master: Dovecot v2.3.7.2 (3c910f64b) starting up for imap, pop3, imap, lmtp, pop3 (core dumps disabled)
Dec 20 10:36:26 mailer dovecot: master: Warning: SIGHUP received - reloading configuration
Dec 20 10:38:18 mailer postfix/postfix-script[8513]: stopping the Postfix mail system
Dec 20 10:38:18 mailer postfix/master[8282]: terminating on signal 15
Dec 20 10:38:24 mailer postfix/postfix-script[9155]: warning: symlink leaves directory: /etc/postfix/./makedefs.out
Dec 20 10:38:24 mailer postfix/postfix-script[9320]: starting the Postfix mail system
Dec 20 10:38:24 mailer postfix/master[9322]: daemon started -- version 3.4.13, configuration /etc/postfix
Dec 20 10:38:29 mailer dovecot: master: Warning: Killed with signal 15 (by pid=9328 uid=0 code=kill)
Dec 20 10:40:01 mailer dovecot: master: Dovecot v2.3.7.2 (3c910f64b) starting up for imap, pop3, lmtp, imap, lmtp, pop3 (core dumps disabled)

Configured mx record and record of the domain itself. Checked everything at https://mxtoolbox.com

How can you test sending and receiving emails?

How can a user be created?

Can I send a message to other servers, for example to gmail?

Postfix config:

# See /usr/share/postfix/main.cf.dist for a commented, more complete version


# Debian specific:  Specifying a file name will cause the first
# line of that file to be used as the name.  The Debian default
# is /etc/mailname.
#myorigin = /etc/mailname

smtpd_banner = $myhostname ESMTP $mail_name (Ubuntu)
biff = no

# appending .domain is the MUA's job.
append_dot_mydomain = no

# Uncomment the next line to generate "delayed mail" warnings
#delay_warning_time = 4h

readme_directory = no

# See http://www.postfix.org/COMPATIBILITY_README.html -- default to 2 on
# fresh installs.
compatibility_level = 2



# TLS parameters
smtpd_tls_cert_file=/etc/ssl/certs/certificate.crt
smtpd_tls_key_file=/etc/ssl/private/private.key
smtpd_tls_security_level=may

smtp_tls_CApath=/etc/ssl/certs
smtp_tls_security_level=may
smtp_tls_session_cache_database = btree:${data_directory}/smtp_scache


smtpd_relay_restrictions = permit_mynetworks permit_sasl_authenticated defer_unauth_destination
myhostname = mydomain.xyz
alias_maps = hash:/etc/aliases
alias_database = hash:/etc/aliases
myorigin = /etc/mailname
mydestination = mydomain.xyz, mailer.mydomain.xyz, localhost.mydomain.xyz, , localhost
relayhost =
#mynetworks = 127.0.0.0/8 10.0.0.0/8 172.0.0.0/8 [::]/128 [::ffff:127.0.0.0]/104 [::1]/128
mynetworks = 0.0.0.0/0 , 127.0.0.0/8
mailbox_command =
mailbox_size_limit = 0
recipient_delimiter = +
inet_interfaces = all
inet_protocols = ipv4
home_mailbox = Maildir/
virtual_alias_maps = hash:/etc/postfix/virtual
smtpd_use_tls = yes
mynetworks_style = subnet

There's two avenues, roughly, for creating email users:

  1. PAM integration where OS (Linux) users (users that can also log in to for example the desktop, with ssh, that have unique home directories and UID numbers etc.) use the same account/credentials for email as well. You may associated specific additional e-mail addresses in addition to "login@[hostname.]example.com" style email addresses.

  2. "Virtual Users" that only exist for the purpose of sending and receiving e-mail but that don't have OS accounts. See for example https://doc.dovecot.org/configuration_manual/howto/simple_virtual_install/