Ubuntu 20.04
Sponsored Link

Mail Server : Add Mail User Accounts2020/05/19

 
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

root@mail:~#
apt -y install mailutils
# set environment variables to use Maildir

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

root@mail:~#
adduser ubuntu

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

ubuntu@mail:~$
mail ubuntu@localhost

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

# to finish messages, push [Ctrl + D] key

# see received emails

ubuntu@mail:~$
mail

"/home/ubuntu/Maildir/": 1 message 1 new
>N   1 ubuntu                               13/442   Test Mail#1

# input the number you'd like to see an email
? 1
Return-Path: <ubuntu@mail.srv.world>
X-Original-To: ubuntu@localhost
Delivered-To: ubuntu@localhost
Received: by mail.srv.world (Postfix, from userid 1000)
        id 7A845403D2; Mon, 18 May 2020 20:35:41 -0600 (CST)
To: <ubuntu@localhost>
Subject: Test Mail#1
X-Mailer: mail (GNU Mailutils 3.7)
Message-Id: <20200519023541.7A845403D2@mail.srv.world>
Date: Mon, 18 May 2020 20:35:41 -0600 (CST)
From: ubuntu <ubuntu@mail.srv.world>

This is the first mail.

# to quit, input [q]
? q
Saved 1 message in /home/ubuntu/mbox
Held 0 messages in /home/ubuntu/Maildir/
Matched Content