Open main menu

CDOT Wiki β

Changes

OPS335 Lab 4c

79 bytes added, 21:21, 4 March 2016
no edit summary
[[Image:Email-servers.png]]
Last week we've set up Postfix on VM2. Postfix is an MTA, a.k.a. an SMTP server. Last week we've set it up for sending email (it was mostly the default setup) and this . This week we'll set it up to receive a Postfix instance for receiving emailon VM3.
We'll start with the same Postfix service on the same machine, we'll add an LDA (dovecot-lda) and test to make sure it works.
Finally we'll set up an IMAP server (Dovecot) so you can read your email from an MUA such as Thunderbird or a Webmail (we'll set up webmail in the Apache lab).
== MX Record ==
If you haven't already done it - set up an MX record in your DNS server to make vm2vm3.yoursenecaid.org the server responsible for receiving emails for anyuser@yoursenecaid.org(vm3 will be used for receiving, vm2 for sending only).
== MTA for Receiving Email ==
The default job of an SMTP server is to forward the message recieved to another email server. That's what we've set up in the previous lab: your postfix receives an email from your client (Thunderbird) and forwards it to the destination server. The other thing an SMTP server can be configured to do is receive email. It still uses SMTP but instead of forwarding it to another SMTP server it will forward it to the Local Delivery Agent (LDA).
With postfix this is done by setting the '''mydestination''' configuration variable to include '''$mydomain''' (this is assuming you've set up '''mydomain''' , '''myorigin''' , and '''myorigininet_interfaces''' the same way as in the previous lab).
Edit your /etc/postfix/main.cf file and scroll down to (or search for) '''mydestination'''. Set it up to look like this:
Finally, edit /etc/dovecot/conf.d/10-mail.conf and set where you want your mail delivered:
<pre>./conf.d/10-mail.conf:mail_location = maildir:~/Maildir</pre>
Don't forget to restart your postfix service. dovecot-lda is just a program invoked by Postfix, it doesn't have an associated service.
=== Test ===
If all worked so far - you should be able to send email to any regular user on vm2 vm3 using the email address yourusername@yoursenecaid.org using Thunderbirdon vm2.
We still haven't set up IMAP (for reading email) but we can test that the message is being delivered. Send an email to yourself (from yourself) and check the contents of /home/yourusername/Maildir/new/ - there should be a file there with the contents of your email.
If there isn't one - check the log file /var/log/maillog to see what went wrong.