CentOS Stream 10
Sponsored Link

Mail Server : Add Mail User Accounts2025/02/05

 

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 ~]$
mail

s-nail version v14.9.24.  Type `?' for help
/home/cent/Maildir: 1 message 1 new
►N  1 cent@srv.world        2025-02-05 09:15   14/411   "Test Mail#1

# input a number you'd like to see an email
& 1
[-- Message  1 -- 14 lines, 411 bytes --]:
Date: Wed, 05 Feb 2025 09:15:13 +0900
To: cent@localhost
Subject: Test Mail#1
Message-Id: <20250205001513.BB025301B307@mail.srv.world>
From: cent@srv.world

This is the first mail.

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