Go to the content


 Go back to Planet Debian
Full screen Suggest an article

François Marier: Test mail server on Ubuntu and Debian

November 13, 2017 11:11 , by Planet Debian - 0no comments yet | No one following this article yet.
Viewed 16 times

I wanted to setup a mail service on a staging server that would send all outgoing emails to a local mailbox. This avoids sending emails out to real users when running the staging server using production data.

First, install the postfix mail server:

apt install postfix

and choose the "Local only" mail server configuration type.

Then change the following in /etc/postfix/main.cf:

default_transport = error


default_transport = local:root

and restart postfix:

systemctl restart postfix.service

Once that's done, you can find all of the emails in /var/mail/root.

So you can install mutt:

apt install mutt

and then view the mailbox like this:

mutt -f /var/mail/root

Source: http://feeding.cloud.geek.nz/posts/test-mail-server-ubuntu-debian/

0no comments yet

Post a comment

The fields are mandatory.

If you are a registered user, you can login and be automatically recognized.