Mail Accounts

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 operating system user accounts, you only need to add an operating system user as follows.

# install mail client
[[email protected] ~]# dnf install sendmail -y

# set environment variables to use Maildir
[[email protected] ~]# echo 'export MAIL=$HOME/Maildir' >> /etc/profile.d/mail.sh

# add a user [future]
[[email protected] ~]# useradd future
[[email protected] ~]# passwd future

[2] Send a mail.

[[email protected] ~]# vi mail.txt

Subject: First Mail!
This line and after is the body of the email.

[[email protected] ~]# sendmail [email protected] < mail.txt

[3] Login as a user added in [1] and try to read an email.

# see received mails
[[email protected] ~]# ls Maildir/new
1633099380.Vfc01Ia1d39M773130.futurelinux.org

# read incoming mail
[[email protected] ~]$ cat Maildir/new/1633099380.Vfc01Ia1d39M773130.futurelinux.org
Return-Path:
X-Original-To: [email protected]
Delivered-To: [email protected]
Received: by mail.futurelinux.org (Postfix, from userid 0)
    id B6D896016B; Fri,  1 Oct 2021 10:43:00 -0400 (EDT)
Subject: First Mail!
Message-Id: <[email protected]>
Date: Fri,  1 Oct 2021 10:43:00 -0400 (EDT)
From: root

This line and after is the body of the email.