CentOS Stream 9
Sponsored Link

Mail Server : Add Mail User Accounts2022/03/18

Add Mail User Accounts to use Mail Service.
This example is for the case you use OS user accounts.
Configure basic Postfix settings, and basic Dovecot settings first.
[1] To use OS user accounts, that's only adding OS user like follows.
# install mail client program

[root@mail ~]#
dnf -y install s-nail
# set environment variables to use Maildir

[root@mail ~]#
echo 'export MAIL=$HOME/Maildir' >> /etc/profile.d/mail.sh
# add a user [cent]

[root@mail ~]#
useradd cent

[root@mail ~]#
passwd cent

[2] Login as a user added in [1] and try to send an email.
# send to myself [mail (username)@(hostname)]

[cent@mail ~]$
mail cent@localhost

# input subject
Subject: Test Mail#1
# input messages
This is the first mail.

# to finish messages, push Ctrl + D key
(Preliminary) Envelope contains:
To: cent@localhost
Subject: Test Mail#1
Send this message [yes/no, empty: recompose]? yes

# see received emails

[cent@mail ~]$

s-nail version v14.9.22.  Type `?' for help
/home/cent/Maildir: 1 message 1 new
►N  1 cent@srv.world        2022-03-18 19:23   14/405   "Test Mail#1"

# input a number you'd like to see an email
& 1
[-- Message  1 -- 14 lines, 405 bytes --]:
Date: Fri, 18 Mar 2022 19:23:33 +0900
To: cent@localhost
Subject: Test Mail#1
Message-Id: <20220318022333.B1738EA09@mail.srv.world>
From: cent@srv.world

This is the first mail.

# to quit, input [q]
& q
Matched Content