1 | REMOTE MAIL CONFIGURATION |
---|
2 | ------------------------- |
---|
3 | |
---|
4 | 1. Let's configure our postfix to accept mail for our newly created domain! |
---|
5 | |
---|
6 | * First, find out what domains postfix is already configured |
---|
7 | to accept: |
---|
8 | |
---|
9 | # postconf -n mydestination |
---|
10 | |
---|
11 | You should see: |
---|
12 | |
---|
13 | mydestination = $myhostname, localhost.$mydomain, localhost |
---|
14 | |
---|
15 | * Let's add our domain -- the one we created in the DNS delegation exercises |
---|
16 | For example, if your domain is "MYNAME.ws.nsrc.org": |
---|
17 | |
---|
18 | # cd /etc/postfix/ |
---|
19 | # postconf -e mydestination='$myhostname, localhost.$mydomain, localhost, MYNAME.ws.nsrc.org' |
---|
20 | |
---|
21 | (of course, use your own domain here, NOT MYNAME!) |
---|
22 | |
---|
23 | * View the contents of main.cf, and make sure that the new configuration |
---|
24 | for "mydestination" is there: |
---|
25 | |
---|
26 | # grep mydestination main.cf |
---|
27 | ... |
---|
28 | mydestination = $myhostname, localhost.$mydomain, localhost, MYNAME.ws.nsrc.org |
---|
29 | |
---|
30 | * Tell postfix to reload the configuration |
---|
31 | |
---|
32 | # postfix reload |
---|
33 | |
---|
34 | 2. Send an email to the user "sysadm" at your domain: |
---|
35 | |
---|
36 | # su - sysadm |
---|
37 | $ echo "test to my new domain" | mutt -s "test to MYNAME" sysadm@MYNAME.ws.nsrc.org |
---|
38 | |
---|
39 | $ tail /var/log/maillog |
---|
40 | |
---|
41 | $ mutt |
---|
42 | |
---|
43 | * Check that the mail has arrived in your mailbox! Remember the 'h' |
---|
44 | command. |
---|
45 | |
---|
46 | 3. Reconfigure your DNS so that you have an MX for your domain. |
---|
47 | |
---|
48 | * If your domain is called "MYNAME" (MNAME.ws.nsrc.org), |
---|
49 | and your PC is "pcX", then, add the following to your |
---|
50 | /etc/bind/db.MYNAME.ws.nsrc.org |
---|
51 | |
---|
52 | (for example, after the NS records) |
---|
53 | |
---|
54 | ... |
---|
55 | NS pcX.ws.nsrc.org. |
---|
56 | NS pcY.ws.nsrc.org. |
---|
57 | |
---|
58 | MX 10 pcX.ws.nsrc.org. |
---|
59 | ... |
---|
60 | |
---|
61 | * MAKE SURE that you are pointing to YOUR ws and not someone else's! |
---|
62 | |
---|
63 | * REMEMBER THE SERIAL NUMBER! |
---|
64 | |
---|
65 | * Reload your zone (rndc reload ...) |
---|
66 | |
---|
67 | 4. Use dig to verify that you have configured the DNS correctly: |
---|
68 | |
---|
69 | # dig @pcX MX MYNAME.ws.nsrc.org |
---|
70 | |
---|
71 | (where X is your own PC, but also the slaves of your zone!) |
---|
72 | |
---|
73 | * Is your MX published ? |
---|
74 | * Do your slaves have the MX as well ? |
---|
75 | |
---|
76 | 5. You still need to tell Postfix to use your new domain name as its |
---|
77 | Origin -- meaning, what the mails coming out will have after @: |
---|
78 | |
---|
79 | * edit /etc/postfix/main.cf, find the line: |
---|
80 | |
---|
81 | myorigin = /etc/mailname |
---|
82 | |
---|
83 | So the name if stored in the file /etc/mailname. |
---|
84 | |
---|
85 | Change the contents of /etc/mailname, and put in: |
---|
86 | |
---|
87 | MYNAME.ws.nsrc.org |
---|
88 | |
---|
89 | * Now reload postfix |
---|
90 | |
---|
91 | # postfix reload |
---|
92 | |
---|
93 | 6. Send mail to others |
---|
94 | |
---|
95 | # echo "hello from here" | mail -s "hello from MYNAME" sysadm@OTHERNAME.ws.nsrc.org |
---|
96 | (OTHERNAME = someone else's domain in the room) |
---|
97 | |
---|
98 | * Check that they receive your mail AND that the email they see from you is: |
---|
99 | |
---|
100 | sysadm@MYNAME.ws.nsrc.org |
---|
101 | |
---|
102 | 7. Now, ask others to send mail to "sysadm@MYNAME.ws.nsrc.org" |
---|
103 | |
---|
104 | # echo "hello from there" | mail -s "hello from OTHERNAME" sysadm@MYNAME.ws.nsrc.org |
---|
105 | |
---|
106 | 8. Check that you are receiving the mail in your sysadm account: |
---|
107 | |
---|
108 | $ mutt |
---|
109 | |
---|
110 | We probably don't have a connection to the Internet, but if we did, we could |
---|
111 | send mail FROM "gmail.com" or somewhere else, and send mail TO our new |
---|
112 | domain. |
---|