Fedora 40
Sponsored Link

Mail Server : Add Mail User Accounts2024/05/16

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

[root@mail ~]#
useradd fedora

[root@mail ~]#
passwd fedora

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

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

# see received emails

[fedora@mail ~]$
mail

s-nail version v14.9.24.  Type `?' for help
/home/fedora/Maildir: 1 message 1 unread
>U  1 fedora@srv.world      2024-05-16 11:13   15/421   "Test Mail#1           "

# input a number you'd like to see an email
& 1
[-- Message  1 -- 15 lines, 421 bytes --]:
Date: Thu, 16 May 2024 11:13:04 +0900
To: fedora@localhost
Subject: Test Mail#1
Message-Id: <20240516021304.7AA2B89C49A@mail.srv.world>
From: fedora@srv.world

This is the first mail.

# to quit, input [q]
& q
Held 1 message in /home/fedora/Maildir
Matched Content