Email: postfix-exercise2.txt

File postfix-exercise2.txt, 3.1 KB (added by regnauld, 9 years ago)

Postfix Lab 2: remote mail

Line 
1REMOTE MAIL CONFIGURATION
2-------------------------
3
41. 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 -d 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 "phil":
17
18    # cd /usr/local/etc/postfix/
19    # postconf -e mydestination='$myhostname, localhost.$mydomain, localhost, phil.ws3.conference.sanog.org'
20
21    (of course, use your own domain here, NOT phil!)
22
23    * View the contents of main.cf, and make sure that the new configuration
24      for "mydestination" is there:
25
26    # tail main.cf
27    ...
28    mydestination = $myhostname, localhost.$mydomain, localhost, phil.ws3.conference.sanog.org
29
30    * Tell postfix to reload the configuration
31
32    # postfix reload
33
342. Send an email to the user "sanog" at your domain:
35
36    # echo "test to my new domain" | mail sanog@phil.ws3.conference.sanog.org
37
38    # tail /var/log/maillog
39
40    * As "sanog":
41
42    $ mutt
43
44    * Check that the mail has arrived in your mailbox
45
463. Reconfigure your DNS so that you have an MX for your domain.
47
48    * If your domain is called "YOURDOMAIN" (YOURDOMAIN.ws3.conference.sanog.org),
49      and your PC/WS is "ws15", then, add the following to your
50      /etc/namedb/master/YOURDOMAIN.ws3.conference.sanog.org,
51
52      (for example, after the NS records)
53
54        ...
55        NS      ws15.ws3.conference.sanog.org.
56        NS      ws16.ws3.conference.sanog.org.
57
58        MX  10  ws15.ws3.conference.sanog.org.      ; <<<- MX for mail
59        ...
60
61    * MAKE SURE that you are pointing to YOUR ws and not someone else's!
62
63    * REMEMBER THE SERIAL!
64
65    * Reload your zone (rndc reload ...)
66
674. Use dig to verify that you have configured the DNS correctly:
68
69    # dig @wsXX MX YOURDOMAIN.ws3.conference.sanog.org
70
71    (where XX is your own WS, but also the slaves of your zone!)
72
73    * Is your MX published ?
74    * Do your slaves have the MX as well ?
75
765. 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 main.cf
80
81   myorigin = YOURDOMAIN.$mydomain
82
83   ... $mydomain is always "ws3.conference.sanog.org" (if your hostname
84   is set correctly)
85
86   * Now reload postfix
87
88   # postfix reload
89
906. Send mail to others
91
92        # echo "hello from here" | mail -s "hello from YOURDOMAIN" sanog@THEIRDOMAIN.ws3.conference.sanog.org
93        (THEIRDOMAIN = someone else's domain in the room)
94
95        * Check that they receive your mail AND that the email they see from you is:
96
97        sanog@YOURDOMAIN.ws3.conference.sanog.org
98       
996. Now, ask others to send mail to "sanog@YOURDOMAIN.ws3.conference.sanog.org"
100
101    # echo "hello from there" | mail -s "hello from THEIRDOMAIN" sanog@YOURDOMAIN.ws3.conference.sanog.org
102
1037. Check that you are receiving the mail in your sanog account:
104
105    $ mutt
106
1078. Try and send mail to sanog@YOURDOMAIN.ws3.conference.sanog.org from the
108   rest of the world (GMAIL, Hotmail, ...)