Difference between revisions of "OPS335 Lab 4c"
(→Receiving Email) |
(→MTA and LDA for Receiving Email) |
||
Line 15: | Line 15: | ||
If you haven't already done it - set up an MX record in your DNS server to make vm2.yoursenecaid.org the server responsible for receiving emails for anyuser@yoursenecaid.org | If you haven't already done it - set up an MX record in your DNS server to make vm2.yoursenecaid.org the server responsible for receiving emails for anyuser@yoursenecaid.org | ||
− | == MTA and LDA for | + | == MTA for Receiving Email == |
+ | |||
+ | == Assigning Responsibility == | ||
+ | |||
+ | 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''' and '''myorigin''' 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: | ||
+ | |||
+ | <pre>mydestination = $mydomain, $myhostname, localhost.$mydomain, localhost</pre> | ||
+ | |||
+ | Now even though your machine's name is vm2.yoursenecaid.org - your postfix will also receive emails for yoursenecaid.org | ||
+ | |||
+ | == LDA == | ||
Postfix is capable of performing the function of an LDA but it has limited configurability, and is generally not used for that purpose. Currently the most popular LDA is LMTP but we'll use dovecot-lda because it's also pretty popular and we'll later be setting up Dovecot as an IMAP server. Using the two as a pair will increase the performance of your IMAP server. | Postfix is capable of performing the function of an LDA but it has limited configurability, and is generally not used for that purpose. Currently the most popular LDA is LMTP but we'll use dovecot-lda because it's also pretty popular and we'll later be setting up Dovecot as an IMAP server. Using the two as a pair will increase the performance of your IMAP server. |
Revision as of 18:10, 4 March 2016
Contents
Receiving Email
This is the same diagram from last week:
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 week we'll set it up to receive email.
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 vm2.yoursenecaid.org the server responsible for receiving emails for anyuser@yoursenecaid.org
MTA for Receiving Email
Assigning Responsibility
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 and myorigin 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:
mydestination = $mydomain, $myhostname, localhost.$mydomain, localhost
Now even though your machine's name is vm2.yoursenecaid.org - your postfix will also receive emails for yoursenecaid.org
LDA
Postfix is capable of performing the function of an LDA but it has limited configurability, and is generally not used for that purpose. Currently the most popular LDA is LMTP but we'll use dovecot-lda because it's also pretty popular and we'll later be setting up Dovecot as an IMAP server. Using the two as a pair will increase the performance of your IMAP server.
Edit your /etc/postfix/main.cf file and scroll down to (or search for) mailbox_command. Add the following line:
mailbox_command = /usr/libexec/dovecot/dovecot-lda -f "$SENDER" -a "$RECIPIENT"
Don't replace any variables, those are set automatically by Postfix when it runs the LDA. If you're interested - you can read about dovecot-lda here and here but it's not required reading.
If you look - you'll see that dovecot-lda doesn't exist yet. Install the dovecot package - that will come with dovecot-lda.
Don't forget to restart your postfix service.