In this project you will build and use a SOHO Mail server. Your mail service will include SMTP service with the postfix MTA, and POP3/ IMAP service with the Dovecot MAA. (Web mail access will be added in the next (and last) project.) Your email service will use the Maildir mail storage system rather than the more traditional mbox format.
Actually Dovecot supports
Maildir++ format, an extension that adds sub-folders and mail
quota.
Most systems (MUAs and MDAs) that claim
they support Maildir
actually mean they support
Maildir++
.
(Note while the author of the format spells it with a lowercase
m
most of the world uses Maildir
or Maildir++
.)
A proper mail service (as with most services) generally requires a static IP setup and additional DNS records. However you would need to learn more about networking to do this properly, so we will save this for another project.
(Mail service configuration continues in a CTS-2311 (Unix/Linux Security) course project to add full functionality, including virus and spam scanning and authentication, and in CTS-2333 (Unix/LInux Networking) to add static IP and network support.)
Note!
Fedora may not have correct SELinux policy rules for
Dovecot or other servers.
It is strongly suggested you make sure SELinux is run
in permissive mode for this project.
One way to always boot up in permissive mode is to edit
the file /etc/selinux/config and follow the
comments to change the mode.
Install, configure, and test a mail service suitable for SOHO use. Unlike some previous projects the steps will not include specific commands to run. At this point you are expected to be able to locate relevant commands and documentation using the skills you have learned. (But don't panic! The resources section includes a copy of email lecture notes you can use, and the Internet resources for email setup are very good.)
Perform the following tasks and answer the following questions
(optional steps appear
in italics in a gray box and
start with the phrase (optional)
):
alternatives command to switch all shared
commands to your chosen MTA (if set to, say,
sendmail).
If there was no alternatives
system (or some equivalent) what would you do if you need to switch
MTAs (or another subsystem that uses conflicting
pathnames)?
alternatives command and the Postfix
MTA.
(You can install other software as needed later.)
Be sure to install the alternatives system first.
What packages are needed?
How did you determine this?
/etc/postfix/main.cf to accept
email from other hosts (or at least the others in our
class network).
Use the system default mailbox (an mbox)
for now.
Check the syntax, and then start (or reload) the
MTA and test the result.
What changes did you make (show
diff output comparing the original and
modified file(s))?
How do you check the email service?
mutt to send and read email to your non-root account
on your host, from your host.
Then try to send and read email to your non-root account on your
host, from a different host.
(You should ask a fellow student or your instructor to send you
the email.)
Examine the log files for any problems.
What extra steps, if any did you need
to perform?
What log entries were generated, and in which log files?
aliases file,
there may be several on the system!
Read the Postfix configuration file to see which file gets
used.)
What email-related aliases should always be
present?
Why is it important to set root as an alias to
a real person on a server?
Maildirformat to
~/Maildir/.
Now reload the mail server and test the changes.
Send email to some user and check their home directory (and the
log files) to verify this works (the new mail files and folders
were created).
What changes did you make? pine, but there is a patch if you have the
source).
Configure the mutt MUA to use
Maildirs.
(Sample configurations for MUAs can be found in
the lecture notes found on-line in the email resources.)
Make sure you can send and receive emails with mutt.
What changes did you make to your
MUA configuration?
mailx (formally known as
nail) replacement package for mail.
(Personally I have set a shell alias for mail to mailx).
Now configure mailx MUA to use Maildirs
and test the result.
Finally, repeat for any other MUAs you use including
GUI
MUAs.
Report any changes made.telnet localhost pop3 (or imap).
mutt and alpine can read email
from IMAP if you change
the (incoming) mailbox to this URL
(instead of the normal pathname):
imap://userName@localhost/INBOX.
You can set this as the default by exportingthe
MAIL environment variable in a login script.
Now test by sending some mail to your account from your
MUA, and try reading it using the MUA
configured for IMAP.
Examine the log files to make sure there were no problems.
syslogfacilities for logging, and that you have configured
syslogto save email related log messages in the proper log file(s). What changes (if any) did you make for this?
enforcing. Use
getenforce command ot see, and setenforce 0
command to set to Permissive. To make the change permanent, edit the file
/etc/selinux/config;
the comments in there explain what to change. NetworkManager service and are
using the network service, as explained in class.
Use chkconfig to ensure the correct service only will run at
boot time. named or nscd (hopefully you're
not running both at once!). alternatives --config mta to make sure you are
really using Postfix and not Sendmail. rcs, or at least
make a backup copy of the original.
(I use cp foo foo-orig.)
Then you can use diff foo-orig foo
to see what you changed, and that can be copied into your system journal. A copy of your journal pages and the answers to the questions asked above. You can send as email to (preferred). If email is a problem for some reason (!), you may turn in a hard-copy. In this case the pages should be readable, dated, and stapled together. Your name should appear on the first page.
Don't turn in your whole journal, you will need to add to it every day in class! It is common in fact to keep the journal as a text file on the system (with a paper backup of course).
Please see your syllabus for more information about submitting projects.