• No results found

A Modular Architecture Using Open Source Components

N/A
N/A
Protected

Academic year: 2021

Share "A Modular Architecture Using Open Source Components"

Copied!
20
0
0

Loading.... (view fulltext now)

Full text

(1)

A Modular Email Architecture

Using Open Source Components

Presented to MVMRUG

April 22, 2005

Scott Courtney

(2)

Functional Goals

SMTP inbound and outbound mail

POP3 and IMAP4 mailbox delivery

Webmail

Spam blocking

Virus scanning and blocking

Multiple virtual domains

(3)

Architectural Goals of System

Centralized user authentication, profiles

Virtual user accounts (no shell accounts)

Modular deployment from server templates

Horizontally scaling

Near-instantaneous failover where practical

Centralized backup

Centralized logging

Deploy on low-cost Intel hardware or

(4)

Design Overview

● Arrows show direction of

service request, not necessarily data flow

● "SMTP in" is actually three

layers

● Webmail behaves like a

user client, conceptually "outside the box"

● DNS and LDAP connect to

everything (not all shown here)

● Admin and backup servers

omitted for clarity

SMTP in SMTP out LDAP mbox mbox mbox POP/IMAP proxy Clients (users) Webmail Bounces Inet DNS

(5)

Network Overview

Public

Internet

User (Client) Hosts

Modular Email

System

FW/Router

FW /

Router

(Details of network

architecture are not part of this presentation.)

(6)

SMTP Inbound -- Details

● Inbound connections

distributed by simple round-robin DNS

● Filters can go offline for

scheduled maintenance after letting queue drain

● Philosophy:

– Block before scan – Scan before route – No spam, virus

bounce

● Early or late lookup of

valid destination

Spam Filter

Virus

Filter mbox

mbox

mbox LDAP

(SMTP out)

(7)

Virus and Spam Removal

MTA Virus and/or Spam Scan

Method 1: Direct Daemon Method 2: amavisd-new

● SpamAssassin, ClamAV, or similar

tools listen on TCP ports

● May be on dedicated server separate

from MTA

● Simpler configuration and less points

of failure than with amavisd-new

● Scanning closely coupled to MTA

configuration

● amavisd-new listens on TCP port, runs

spam and/or virus scan from exec() call or API function call, or shells out

● amavisd-new may be on separate

server, but scanner(s) local to amavisd-new host

● Can change or add new scanners w/o

touching MTA configuration

MTA amavisd-new

Virus and/or

Spam Scan

(8)

SMTP Outbound -- Details

● All user-originated

messages pass through virus and spam filters

● Outbound servers have

local spam, virus filter

● Philosophy:

– Outbound <<

Inbound

– Nothing nasty out! – No spam, virus

bounce

– Decouple outbound

queuing Spam Filters Webmail SMTP out Clients Mail between local users

All mail from local users

Bounces for "user not found", "account disabled",

etc. (but not spam)

Mailbox Servers

(9)

POP3/IMAP4 Service

● Mailbox servers are just

POP3/IMAP4, nothing else

● Routing to mailbox host

based on LDAP attribute

● No direct connection to

mailbox servers from untrusted hosts

● POP/IMAP proxy looks up

mailbox location in LDAP, emulates (then passes through) authentication

● No user data whatsoever

on proxy server -- admin is trivially simple

SMTP in

LDAP

mbox mbox mbox POP/IMAP

proxies

Clients (users)

Webmail

(10)

Webmail Service

Webmail

Servers

Users

MySQL Server

(session data)

IMAP Proxy

Servers

● Webmail authentication is

through IMAP, not LDAP

● Sessions must be in MySQL,

not Apache or PHP or Horde native, so load balancing will work correctly

● MySQL server stores only

session data and [optionally] webmail user preferences.

● MySQL server can be

(11)

LDAP (My Diagrams

vs.

Reality)

My Diagrams

● One big LDAP server

● If LDAP goes down, the

world comes to a grinding halt

Reality

● One master LDAP

server

● Any other server that

needs LDAP lookups has its own replicant locally

● Master server down?

No user profile changes but things keep working for all that matters.

(12)

Software Selection: MTA

Selected:

Exim

http://exim.org/

Other Candidates

Sendmail

QMail

Why?

● Extremely configurable ● Sophisticated and

readable config syntax

● Config localized to one

file (manageability)

● Secure, fast, reliable ● Integrates smoothly

with external data sources

(13)

Software Selection: POP/IMAP

Selected:

Courier

http://www.courier-mta.org/imap/

Other Candidates

WU-imapd

(numerous others)

Why?

● Extremely configurable ● Modular authentication ● Widely supported

● Secure, fast, reliable ● Integrates smoothly

with external data sources

(14)

Software Selection: IMAP/POP Proxy

Selected:

Perdition

www.vergenet.net/linux/perdition

Other Candidates

None, really

Why?

● Does what is needed

(15)

Software Selection: Webmail

Selected:

Horde

www.horde.org

(Plus IMP and Turba plugins)

Other Candidates

Squirrel Mail

EMU Webmail

Courier Webmail

etc.

Why?

● Extremely configurable

● Modular design with other

"groupware" components available

– Addressbook/contacts – Calendar

● Mainstream and widely

supported

● Integrates smoothly with

(16)

Adding z/VM Linux to the Mix

Great on z/VM Linux

● Mailbox Servers +++

● POP/IMAP Proxy

Servers

● Webmail Servers ● MySQL Server(s) ● Master LDAP (?)

● Inbound SMTP route

(spin off from spam scan)

● Outbound SMTP -- but,

spin off virus/spam scan to Intel

Maybe Stay on Intel

● Virus Scanning

● Spam Scanning

● Outbound SMTP if you

keep virus/spam scan local to these hosts

Note that the servers that

don't make sense on z/VM Linux are also the servers that store no

(17)

Performance in the Real World

Configuration

● Intel P4-class hardware

~2.0 GHz

● Uniprocessor except

virus, spam scan and master LDAP

● 2 GB RAM per host ● 100 Mb Ethernet

● ~40K users

● > 30K inbound/hour not

counting deleted spam, virus

Performance

● Virus + spam >= 2X

actual inbound mail

● About 8K~10K users

per mbox

● 2 servers at each other

pipeline stage can

handle full load (3 used by choice to allow

scheduled outages)

● In production ~2 years

(18)

Remaining Challenges

Mailbox servers are "single point of failure" to

the specific users of a given server

– Using z/VM Linux largely eliminates this problem – Can use tools like "heartbeat" for hot failover

Spam and viruses are absolutely

rampant

on

the Internet -- even state-of-the-art filtering

isn't good enough yet

– Sender Policy Framework (SPF)

– CRM114, Bayesian filter -- good but complex

(19)

Conclusion

● System is horizontally and vertically scalable

● Platform-neutral, and most pieces work just fine on

z/VM Linux

All pieces work fine on z/VM Linux if you have a

small number of users

● Load balancing accomplished with simple

round-robin DNS and built-in replication features of OpenLDAP and MySQL

● Servers can go offline easily for scheduled

maintenance

(20)

Contact Information

Scott Courtney, Senior Engineer

Sine Nomine Associates

[email protected]

330.353.0403

References

Related documents

Ferris, Wayne Gray, Ronald Shadbegian, and Ann Wolverton, “Do Renewable Portfolio Standards Affect Manufacturing Activity Through Higher Electricity Prices?” Presented at IZA

Selecting Wireless &gt; Wireless Security will enable you to configure wireless security for your wireless network to protect your data from intruders. The Range Extender

When a user send an email, the email client will deliver the mail to the local SMTP server running on the Mail/File server. The SMTP server will then determine if the mail is

Stockholm Innovation &amp; Growth AB Karolinska Institutet Innovations AB Stockholm Universitet Innovation AB LEAD LiU Entrepreneurship and Development Stiftelsen

The following is a report relating to the first simulation practice project and pre- sents a re-analysis of data following an unexpected finding, and therefore focuses primarily

In table B.1 (appendix), we summarize the rest of our results comparing the proportion of consistent price changes among treatments, periods, and levels of

• Rizal left Barcelona in the fall of 1882 and established himself in Madrid, the capital of Spain LIFE IN MADRID.. • November 3, 1882- Rizal enrolled in the Universidad Central

Mail Architecture Client Person A Outgoing Server SMTP Client SMTP User Mail Boxes Inbound Server IMAP Internet SMTP POP3..