SLES 15
Sponsored Link

Add Mail User Accounts2019/01/24

 
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

mail:~ #
zypper -n install mailx
# set environment variables to use Maildir

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

mail:~ #
useradd suse

mail:~ #
passwd suse

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

suse@mail:~>
mail suse@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

suse@mail:~>
mail

Heirloom mailx version 12.5 7/5/10.  Type ? for help.
"/home/suse/Maildir": 1 message 1 new
>N  1 suse@srv.world     Thu Jan 24 19:44   17/516   Test Mail#1

# input the number you'd like to see an email
& 1
Message  1:
From suse@srv.world Thu Jan 24 19:44:35 2019
X-Original-To: suse@localhost
Delivered-To: suse@localhost
Date: Thu, 24 Jan 2019 19:44:35 +0900
To: suse@localhost
Subject: Test Mail#1
User-Agent: Heirloom mailx 12.5 7/5/10
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
From: suse <suse@srv.world>

This is the first mail.

# to quit, input [q]
& q
Saved 1 message in mbox
Matched Content