Rocky_Linux_8
Sponsored Link

Mail Server : Add Mail User Accounts2021/07/30

 
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 mailx
# set environment variables to use Maildir

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

[root@mail ~]#
useradd rocky

[root@mail ~]#
passwd rocky

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

[rocky@mail ~]$
mail rocky@localhost

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

# to finish messages, input period(.) and Enter
.
EOT
# see received emails

[rocky@mail ~]$
mail

Heirloom Mail version 12.5 7/5/10.  Type ? for help.
"/home/rocky/Maildir": 1 message 1 new
>N  1 rocky@srv.world       Thu Jul 29 21:41  17/520   "Test Mail#1"

# input a number you'd like to see an email
& 1
Message  1:
From rocky@srv.world Thu Jul 29 21:41:10 2021
Return-Path: <rocky@srv.world>
X-Original-To: rocky@localhost
Delivered-To: rocky@localhost
Date: Thu, 29 Jul 2021 21:41:10 -0500
To: rocky@localhost
Subject: Test Mail#1
User-Agent: Heirloom mailx 12.5 7/5/10
Content-Type: text/plain; charset=us-ascii
From: rocky@srv.world
Status: R

This is the first mail.

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