1,760
edits
Changes
→Investigation 3: mail queues (on postfix)
= Investigation 3: mail queues (on postfix) =
== Perform the following steps as root on your VM2 ==
* Run the following command and record the ouitput:
<pre>
postconf queue_directory
</pre>
* Enter the command "mailq" and "mailq -Ac" and record the outputs.
* The output of the above command indicates the directory used by Postfix to store outgoing messages that need to be transferred later. Does regular user has access to this directory? Record the name of the directory and its permission settings.
* By default, Postfix deliver incoming email messages directly to local user's mail box. Postfix can also configured to call other programs (mailers) to perform local delivery. To find out the name of the local delivery agent(s) that may be called by Postfix, try the following command:
<pre>
postconf mailbox_command
</pre>
* According to the output from the command, what is the name of the local delivery agent?
* Configure your VM2 /etc/resolv.conf to have the nameserver point to your VM3 (i.e. you caching name server) and make sure that you can resolve your VM3's FDQN (i.e. co-nfs.mydomain.ops) to IP address. Issue the following command and record the output:
<pre>
/usr/sbin/sendmail -bv student@co-nfs.mydomain.ops
</pre>
* Is the above email address deliverable by your Postfix server?
* If your Postfix server can handle the above email address, issue the following command and record the output:
<pre>
/usr/sbin/sendmail -v student@co-nfs.mydomain.op < /tmp/test.mesg
</pre>
* Issue the command "mailq -Ac" and "mailq" and record the entire output for future reference.
* What is the queue IP for the queued message?
* Note: You should get something similar to the following:
<pre>
[instructor@pri-dns ~]$ mailq
-Queue ID- --Size-- ----Arrival Time---- -Sender/Recipient-------
B75BF20A6D85 294 Tue Mar 9 00:23:11 instructor@pri-dns.gbecker.ops
(connect to co-nfs.gbecker.ops[192.168.2.3]:25: No route to host)
rchan@co-nfs.gbecker.ops
-- 0 Kbytes in 1 Request.
</pre>
* Run the following command with the Queue ID shown above (your Queue ID will not be the same as what is shown here) to find out the location of the outgoing message in the queue directory:
<pre>
cd /var/spool/postfix
find ./ -name B75BF20A6D85 -print
</pre>
* You should get something similar:
<pre>
[instructor@pri-dns postfix]$ pwd
/var/spool/postfix
[instructor@pri-dns postfix]$ sudo find ./ -name B75BF20A6D85
./defer/B/B75BF20A6D85
./deferred/B/B75BF20A6D85
</pre>
* If you got something similar to the above, investigate the information stored in those files (in this case, they are "./defer/B/B75BF20A6D85" and "./deferred/B/B75BF20A6D85". Record your findings for future reference.
* Issue the command /usr/sbin/sendmail -bp and compare the output to the command mailq.
* Remove both "./defer/B/B75BF20A6D85" "./deferred/B/B75BF20A6D85" and run the mailq command again.
= Completing the Lab =