AlmaLinux 9
Sponsored Link

Mail Server : Add Mail User Accounts2023/03/03

 
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 [alma]

[root@mail ~]#
useradd alma

[root@mail ~]#
passwd alma

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

[alma@mail ~]$
mail alma@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: alma@localhost
Subject: Test Mail#1
Send this message [yes/no, empty: recompose]? yes

# see received emails

[alma@mail ~]$
mail

s-nail version v14.9.22.  Type `?' for help
/home/alma/Maildir: 1 message 1 new
►N  1 alma@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: alma@localhost
Subject: Test Mail#1
Message-Id: <20220318022333.B1738EA09@mail.srv.world>
From: alma@srv.world

This is the first mail.

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