O'Reilly logo

Prefactoring by Ken Pugh

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

16.1. The Context

Spam mail needs no introduction. Everyone has probably received some that has leaked through spam filters. This chapter's case study looks at a program designed to check for and trap incoming spam. Many programs receive mail and many programs analyze mail for spam. So why create another one? This design shows some alternative ways of assigning responsibilities in a system. It demonstrates the guidelines in a different context.

16.1.1. The Environment

Several processes are involved in email delivery. The user agent (e.g., Outlook, Eudora, etc.) interacts with the user to create messages and to display received messages. The user agent sends outgoing messages to a mail server. The mail server (SendingMailServer) transmits the messages to the receiving mail server (ReceivingMailServer). The receiving server queues the received mail for a particular user. The user agent for the recipient picks up the received mail and displays it to the user. Figure 16-1 shows the email delivery process.

Figure 16-1. Process of delivering email

Mail also can be transmitted by programs that send messages to a list of people (e.g., Mailman). These programs, often called list servers, typically send the messages to a SendingMailServer for delivery.

A spamming program acts as a SendingMailServer. It contacts ReceivingMailServers to deliver the spam to the end user. It is not easy ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required