37.10. Reading Users' Email

As the introduction explains, Sendmail stores messages received by users in files in the /var/mail or /var/spool/mail directory. These are read and emptied by the POP3 server, command-line mail clients like pine or elm, or web-based mail clients like Usermin. This Webmin module, however, can also act as a simple mail client, allowing you—the system administrator—to read any user's email.

This feature is useful for deleting large messages in user mailboxes that would otherwise take a long time to download over a dialup POP3 connection. It also allows you to read email for system users such as root without needing to telnet in or run a separate mail client. More controversially, you can even invade people's privacy on a multi-user system by reading their personal email—assuming they have not downloaded and deleted it via POP3 yet.

The following steps show you how to check the contents of a user's mailbox:

1.
On the module's main page, click on the User Mailboxes icon. A page listing all of the users on your system and the sizes of their mailboxes will be displayed, unless you have more than 200 users. In that case, a small form for entering a username will appear instead.

2.
To view an actual message, click on the sender's name in the From column. A page showing the important headers, body text, and attachments will appear. Click on an attachment icon to view it, assuming that the data type is supported by your browser or some external program.

To remove just this email from the user's mailbox, click the Delete button at the bottom of the page. This can take quite some time if the mailbox is extremely large (over 10 MB) or contains lots of messages, as Webmin needs to rewrite the entire mail file.

Click on the name of a user to bring up a list of messages in his mailbox, an example of which is shown in Figure 37.4. By default, the most recent messages are shown first, even though they are actually at the end of the mail file.

Figure 37.4. The contents of a user's mailbox.


If the mailbox contains more than 20 emails, only the first 20 will be displayed. To page though the rest, use the left and right arrow buttons located above the list.

3.
To delete multiple messages, first select them using the checkboxes and Select all and Invert selection links on the mail list page. Then, click the Delete button above or below the list. Once again, this can take awhile for large mailboxes.

4.
To search the user's mailbox for messages matching some criteria, use the Find messages where form below the list. The following types of search can be selected from the menu:

From: matches, Subject: matches, To: matches, or Cc: matches Finds messages in which the From, Subject, To, or Cc field contains the text entered into the adjacent text box. The comparison is case insensitive, but regular expression characters cannot be used.

Date: matches Finds messages in which the sending date header contains the entered text. This header will not be converted to local format, so whatever you enter must match the date format used by the sender.

Body matches Finds messages whose body contains the entered text. The body includes all attachments in their unencoded form, not just the text that is shown when you read an email.

Size is greater than Finds messages whose total size is greater than the number of bytes entered into the adjacent field.

For each of the above search types, an inverse type is also available, such as From: doesn't match or Size is less than. After choosing your search type and entering the text to match, hit the Search button. A page listing all matching messages will be displayed, from which you can view the contents of emails or select some or all to delete, just like in the normal mail list.

The mail reading section of the module actually allows you to compose new messages and reply to or forward existing ones. In fact, it can be used as a full-featured email client, although it is not the best program for the job. The default From address for sent messages is determined from the mailbox user's name and the system hostname, but this can be changed on the module access control page on a per Webmin-user basis. It is even possible to create Webmin users who can use this module to read only their own mailbox and send email from only their address. You should really use a program like Usermin, however, if you want to give the same mail-reading web interface to a large number of users on your system.

By default, the module assumes that the mail for each user will be stored in a file with the user's name in the /var/mail or /var/spool/mail directory. It is possible to configure Sendmail to use a different file path instead, such as the mbox file in each user's home directory. If this is the case on your system, you will need to reconfigure the module, as explained in Section 37.15 “Configuring the Sendmail Configuration Module”. Otherwise, all the mailboxes will show up empty because Webmin is looking in the wrong place for them.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.144.38.24