% $Cambridge: hermes/doc/talks/2011-07-techlinks/talk.tex,v 1.1 2011/07/20 12:52:50 fanf2 Exp $

% This file is included by notes.tex and slides.tex

\usepackage[english,british]{babel}
\usepackage{pgf,pgfarrows,pgfshade}
\usepackage{calc} % for frame column width calculations
\usepackage{ulem} % for strikeout
\usepackage{url}

\newcommand\image[2][]{\mode<beamer>{\includegraphics[#1]{#2}}}

\newcommand\notes[1]{\mode<article>{#1}}

% args: title, body
\newcommand\slide[2]{
  \frame{\frametitle{#1}#2}
}

% args: (optional) image width, image name, title, body
\newcommand\slideT[4][10cm]{
  \slide{#3}{
    \centering\image[width=#1]{#2}

    #4

  }
}
\newcommand\slideB[4][10cm]{
  \slide{#3}{
    #4

    \centering\image[width=#1]{#2}
  }
}
\newcommand\slideBL[4][10cm]{
  \slide{#3}{
    #4

    \raggedright\image[width=#1]{#2}
  }
}
\newcommand\slideBR[4][10cm]{
  \slide{#3}{
    #4

    \raggedleft\image[width=#1]{#2}
  }
}
\newcommand\slideL[4][5cm]{
  \slide{#3}{
    \begin{columns}
    \column{#1}
      \image[width=#1]{#2}
    \column{10cm - #1}
      #4
    \end{columns}
  }
}
\newcommand\slideR[4][5cm]{
  \slide{#3}{
    \begin{columns}
    \column{10cm - #1}
      #4
    \column{#1}
      \image[width=#1]{#2}
    \end{columns}
  }
}

\DeclareUrlCommand\email{%
  \def\UrlLeft{<}%
  \def\UrlRight{>}%
  \urlstyle{tt}%
}

% first slide

\author[Tony~Finch]{
  Tony~Finch\\
  \email{fanf2@cam.ac.uk}
  \email{postmaster@cam.ac.uk}
}

\institute[Cambridge UCS]{%
  University of Cambridge\\
  Computing Service\\
  Mail Support%
}

\titlegraphic{%
  \raisebox{1pt}{%
    \includegraphics[height=20pt]{univ.jpg}%
  }%
  \hspace{6pt}%
  \includegraphics[height=22pt]{ucs.jpg}%
}

% title page

\title{
  Email routing in the University
}
\subtitle{
  \url{http://www-uxsup.csx.cam.ac.uk/~fanf2/}
}
\date{Wednesday 20 July 2011}

\begin{document}

\frame{\maketitle}

\notes{
  \begin{abstract}
    This talk is about the functions of ppswitch, our central email
    relay, and how it works with other email systems in the
    University.

    What special facilities can we provide? What does our peculiar
    terminology mean? What are the notable special cases that result
    from institutions doing their own thing? How do we help
    institutions with big changes in their email setups? What other
    weird things sometimes occur?
  \end{abstract}
}

\section{Introduction}

% http://www.geograph.org.uk/photo/1118361
\slideB{petty-cury.jpg}
        {Dealing with change}
{
  \begin{itemize}
  \item Reorganizations + renames
  \item Commissioning and decommissioning mail servers
  \end{itemize}
}

\notes{
  This talk is about ppswitch, in particular its SMTP delivery
  functions. PPswitch also runs the IMAP and POP proxies that make the
  many Hermes message store servers look like a single system to our
  users. I will not say more about that. PPswitch also has a lot of
  email security functions (anti-spam and anti-virus) but I will not
  say much about that because it isn't the focus of the talk.
  (Questions are welcome at the end.)

  Most of what I have to say is just for nerdy interest. Some of it may be
  useful to computer officers who need to change their email setups.

  Much of the complexity of our SMTP routing is due to the
  organizational complexity of the University. In particular we try to
  help make changes to an institution's email setup hapen smoothly.

  I originally gave this talk as a Computing Service staff seminar in
  March. I have had to change several of the lists and statistics to
  account for changes in the last four months...
}

% down to business

\section{External faces of ppswitch}

% http://hubpages.com/hub/Dog-Rescue-My-Story-Trudy
\slideR{dogs.jpg}
    {Service overview}
{
  \begin{pgfpicture}{0cm}{0cm}{5cm}{7cm}
    \pgfsetendarrow{\pgfarrowtriangle{4pt}}
    % bottom to top
    \pgfputat{\pgfxy(2,0)}{\pgfbox[center,center]{delivery}}
    \pgfxyline(1,2)(0,0.5)
    \pgfxyline(2,2)(2,0.5)
    \pgfxyline(3,2)(4,0.5)
    \pgfrect[stroke]{\pgfxy(0,2)}{\pgfxy(4,1)}
    \pgfputat{\pgfxy(2,2.5)}{\pgfbox[center,center]{routing + redirection}}
    \pgfxyline(0.5,4)(1,3)
    \pgfxyline(2.0,4)(2,3)
    \pgfxyline(3.5,4)(3,3)
    \pgfputat{\pgfxy(1,4.5)}{\pgfbox[right,top]{\tt ppsw.cam}}
    \pgfputat{\pgfxy(2,4.5)}{\pgfbox[center,top]{\tt mx.cam}}
    \pgfputat{\pgfxy(3,4.6)}{\pgfbox[left,top]{\tt smtp.hermes}}
    \pgfxyline(2,6)(2,5)
    \pgfputat{\pgfxy(2,6.5)}{\pgfbox[center,top]{\tt @cam.ac.uk}}
  \end{pgfpicture}
}

\notes{
  PPswitch has several service names which differ in the way that they
  decide which email to accept. After a message has been accepted, its
  routing and delivery is the same regardless of its origin.
}

% http://www.apartmenttherapy.com/la/reduce-junk-mail-in-your-mailbox-037220
\slideL[4.5cm]{junkmail.jpg}
    {What mail is accepted where}
{
  \begin{itemize}
  \item\texttt{mx.cam.ac.uk}
    \begin{itemize}
    \item From any non-spammer
    \item To local addresses
    \item Anti-spam content analysis
    \item Anti-virus
    \end{itemize}
  \item\texttt{smtp.hermes.cam.ac.uk}
    \begin{itemize}
    \item From Hermes users
    \item To anywhere
    \item Rate limits + anti-virus
    \end{itemize}
  \item\texttt{ppsw.cam.ac.uk}
    \begin{itemize}
    \item From CUDN computers
    \item To anywhere
    \item Rate limits + anti-virus
    \end{itemize}
  \end{itemize}
}

\notes{
  \texttt{mx.cam.ac.uk} is our main outward face, where most of the
  anti-spam action happens. We will only accept mail to addresses at
  the 377 local mail domains that we support.

  \texttt{smtp.hermes.cam.ac.uk} accepts mail from anywhere to
  anywhere, but you have to be an authenticated Hermes user.

  \texttt{ppsw.cam.ac.uk} is for general outgoing email from computers
  on the University data network, mainly other mail servers within the
  University, or transactional mail from web servers, or documents
  from printer/scanner machines, etc. usw.

  We have advice on how to choose your SMTP server on the web at
  \url{http://www.cam.ac.uk/cs/email/sending.html}.

  We have some anti-spam checks for outgoing email, mainly to protect
  against the consequences of a compromised web server or a user's
  email account credentials being stolen. Both are fortunately not too
  frequent.
}

% http://www.mike2.com/2010/09/14/macbook-cat/
\slideB[8cm]{worried.jpg}
  {Local restrictions}
{
  \begin{itemize}
  \item Port 25 blocked
  \item No mail to A or AAAA records under \texttt{cam.ac.uk}
  \end{itemize}

  \mode<beamer>{~}
}

\notes{
  When Cambridge joined the Internet the Computing Service took a very
  conservative attitude to some of the loose practices that were
  common then. In particular we kept strict control over the DNS and
  email, so only authorized servers would work. The idea was to ensure
  that the servers were run well, there weren't dangling NS and MX
  records in the DNS.

  Back then this was often seen as unreasonable control-freakery but
  in the last ten years it has saved us a fair amount of work since
  sensible anti-spam measures were already in place.

  One thing we are still unusually strict about is that we will not
  deliver mail to arbitrary hosts within \texttt{cam.ac.uk}. A
  Cambridge mail domain must have an MX record. This has the advantage
  of stopping undeliverable junk from half-configured servers clogging
  up the queue on ppswitch. On the other hand we need a facility to
  relax this rule in a controlled manner, about which more later.
}

%

\section{DNS}

% http://www.vhinkle.com/china/inventions.html
\slide{Numbers of domains}{
  \begin{columns}
    \column{6cm}
      \begin{description}
      \item[4] \textit{UCS test}
      \item[3] \textit{independent}
      \item[7] secondary MX
      \item[74] special routes
      \item[8] long-form
      \item[1] obsolete
      \item[252] managed mail domains
      \item[15] https domains
      \item[22] internal redirects
      \item[386] \textit{total}
      \end{description}
      \begin{description}
      \item[43] \texttt{\itshape\textsf{non-}cam.ac.uk}
      \end{description}
    \column{6cm}
      \image[width=5cm]{abacus.jpg}
  \end{columns}
}

\notes{

  This is a break-down of the University domains that we know about.
  The numbers were collected when I gave this talk to CS staff in March.

  Almost all Cambridge mail domains have an MX record pointing at
  \texttt{mx.cam.ac.uk}. The top two italic lines count University
  domains that ppswitch has nothing to do with.

  I have classified the domains according to how we route and deliver
  mail for them, and the rest of the talk is basically going to follow
  this list and hopefully find some interesting things to say about it.

}

% http://brianschen.com/index.php?showimage=207
\slideR[4.25cm]{matches.jpg}
  {Unusual MX records}
{
  \begin{itemize}
  \item\texttt{ccdc.cam.ac.uk}
  \item\texttt{cup.cam.ac.uk}
  \item\texttt{\itshape cambridge.org}
  \item\texttt{\itshape econ-1m.econ.cam.ac.uk}
  \item\texttt{eng.cam.ac.uk}
  \item\texttt{\itshape ebulletin.foundation.cam}
  \item\texttt{\itshape jesus.cam.ac.uk}
  \item\texttt{\itshape his.path.cam.ac.uk}
  \item\texttt{\itshape mrc-bsu.cam.ac.uk}
  \item\texttt{mrc-cbu.cam.ac.uk}
  \item\texttt{srl.cam.ac.uk}
  \item\texttt{\itshape lib-cat.trin.cam.ac.uk}
  \item\texttt{\itshape cambridge-assessment.org}
  \end{itemize}
}

\notes{
  The number of domains that aren't handled by \texttt{mx.cam.ac.uk}
  is small enough to list on one slide (apart from the UCS test
  domains!). The italic domains in the list above do not use us at
  all; the others just use us as a backup MX, for which we will accept
  email if their main servers are temporarily unavailable. There are
  two domains for which we are willing to relay email but which do not
  list us in the DNS, so there are five not seven domains in upright
  type.

  The \texttt{ebulletin} server is separate because we were concerned
  by the possible backlash from very large alumni mailshots.

  The Trinity library catalogue server is run by external consultants.

  Cambridge Assessment is the most notable department that doesn't
  even use us for secondary MX service. I didn't count their domains
  on the previous slide, except for \texttt{ucles.cam.ac.uk} for which
  we do handle email but which they don't use.

  We route email to these domains using their MX records, just like
  non-University domains.
}

%

\section{Whole domain configuration}

% http://www.premiumfunerals.com/living.html
\slideT[5cm]{sorting-office.jpg}
  {Special Routes}
{
  \begin{equation*}
    \begin{array}{lll}
      \texttt{@admin.cam.ac.uk}   & \rightarrow & \texttt{mailgate.admin.cam.ac.uk} \\
      \texttt{@cl.cam.ac.uk}      & \rightarrow & \texttt{mta.cl.cam.ac.uk}         \\
      \texttt{@tex.ac.uk}         & \rightarrow & \texttt{mta.cl.cam.ac.uk}         \\
      \texttt{@emma.cam.ac.uk}    & \rightarrow & \texttt{mail.emma.cam.ac.uk}      \\
      \texttt{@lists.cam.ac.uk}   & \rightarrow & \texttt{lists.cam.ac.uk}          \\
      \texttt{@medschl.cam.ac.uk} & \rightarrow & \texttt{me-mail.medlan.cam.ac.uk} \\
      \texttt{@srcf.ucam.org}     & \rightarrow & \texttt{mx.srcf.societies.cam.ac.uk}
    \end{array}
  \end{equation*}
}

\notes{
  First a fairly simple case.

  There are 74 special routes of which 14 are non-\texttt{cam.ac.uk}
  domains, of which the above is a small selection.

  A ``special route'' is a mail domain whose mail should all be
  delivered to a system separate from ppswitch. It is ``special''
  because it does not folow standard MX-based routing. Instead we have
  a table listing each domain and the name of the host the mail should
  be delivered to.

  From ppswitch's point of view there is nothing unusual about
  \texttt{lists.cam.ac.uk}.
}

% http://www.nydailynews.com/topics/Heart+Attacks/photos
\slideL{men.jpg}
  {Long-form domains}
{
  \begin{itemize}
  \item darwin.cam.ac.uk \\ dar.cam.ac.uk
  \item interfaith.cam.ac.uk \\ cip.cam.ac.uk
  \item math.cam.ac.uk \\ maths.cam.ac.uk
  \item murrayedwards.cam.ac.uk \\ newhall.cam.ac.uk
  \item queens.cam.ac.uk \\ quns.cam.ac.uk
  \item varsity.co.uk \\ varsity.cam.ac.uk
  \item woolfinstitute.cam.ac.uk \\ woolf.cam.ac.uk
  \item group.caret.cam.ac.uk \\ camtools.cam.ac.uk
  \end{itemize}
}

\notes{
  There are a couple of other setups we have for dealing with a domain
  as a whole.

  Back in the old days of JANET there was Grey Book email instead of
  SMTP and there was the NRS instead of the DNS, and every name had a
  long form and a short form. We ditched the long form as quickly as
  we could, but some institutions were left with rather ugly domain
  names. So we have brought back a limited version of long form
  aliases.

  This facility redirects any address at a long form domain to the
  same address at the corresponding short form domain. It's actually
  pretty general-purpose - in fact sometimes the short form is longer
  than the long form, as in the cases of maths/math and Varsity.

  As well as permanent redirections, we also use this feature to help
  out with departmental renames. A recent example was cont-ed/ice.
  We set the new domain to run in parallel with the old domain for
  several months while the department gets everyone to move over.

  Most of the target domains are managed mail domains, but we can also
  do long-form redirecttions before delivering via a special route, as
  is the case for Darwin.

  In addition to this list, we also have about seven special routes for
  long-form aliases which are handled by the institution's mail server.
}

% http://new.carfreecity.us/TheProblem/tabid/217/Default.aspx
\slideB[8cm]{car.jpg}
  {Obsolete domains}
{
  \begin{columns}
    \column{8cm}
      \begin{itemize}
      \item cont-ed.cam.ac.uk
      \end{itemize}
    \mode<beamer>{~}
  \end{columns}
}

\notes{
  Finally, when a domain has been decommissioned we put it into
  ``friendly bounce'' mode for a few months, just in case there are
  still a few correspondents who haven't heard about the name change.

  This table is usually pretty empty. At the moment there is just one
  entry from the Institute of Continuing Education rename.
}

%

\section{Managed mail domains}

% http://rocket9.net/
\slideR{pinball.jpg}
  {Managed mail domains}
{
  \begin{itemize}
  \item Unix-style \texttt{aliases} file
  \item Edited using \texttt{ssh} to Hermes menu system
  \item Uses RCS for locking
  \item Converted to \texttt{cdb} for \\ mail routing on ppswitch
  \item Live copy updated hourly
  \item Managers can get an audit of broken addresses
  \end{itemize}
}

\notes{

  The vast majority, 252 of our mail domains are ``managed mail
  domains'', of which 22 are non-\texttt{cam.ac.uk}. The more common
  terminology for the same thing is a ``virtual domain''.

  The user interface is now about 15 years old and rather shows its age.

  We use RCS to stop more than one domain manager trying to edit a
  domain at the same time. The fact that it keeps a history of changes
  is very rarely useful.

  If a domain manager kills their \texttt{ssh} session and leaves the
  aliases file locked, the same person can log back in and unlock it
  by just saying ``yes'' to the scary questions. If the person owning
  the lock isn't available then we have to unlock it for them.

  The validity checks in the user interface are not especially strong,
  but domain managers can ask for a very thorough batch-mode check of
  their domain, and the results will be mailed to them after the next
  update.

  We use \texttt{cdb}, which is a very simple read-only database, for
  fast lookups on the live systems.

}

% http://scrapetv.com/News/News%20Pages/Science/pages-2/NASA-to-launch-bouncy-castles-slip-n-slide-into-near-orbit-Scrape-TV-The-World-on-your-side.html
\slideBR[4.7cm]{castle.jpg}
  {Managed mail domains}
{
\tt
f.a.n.finch:fanf2@ucs.cam.ac.uk \\
tony.finch:fanf2@ucs.cam.ac.uk \\
fanf2:fanf2@cam.ac.uk \\
mail-support:msupport@hermes.cam.ac.uk
msupport:fanf2@hermes,dpc22@hermes
~\\
}

\notes{

  The above examples come from the \texttt{@ucs.cam.ac.uk} managed
  mail domain.

  An aliases file just lists the local parts (before the \texttt{@}) of
  the email addresses in the domain and the corresponding destinaton
  addresses.

  Managed mail domains are designed to support friendly names for
  individuals, group role addresses, or any other kind of redirect.

  There are no restrictions on the destination address, so they can
  accommodate external collaborators etc.

}

% http://blog.tomw.net.au/2007/09/controlling-real-robot-from-second-life.html
\slideL{robot.jpg}
  {HTTPS Managed mail domains}
{
  \begin{itemize}
  \item Automated management
  \item Our update job fetches aliases file from manager's web server instead of from Hermes menu system
  \item Live copy updated hourly
  \item Managers get monthly broken address audit
  \end{itemize}
}

\notes{

  This feature is for those who don't like driving the menu system
  manually. Apart from the update procedure they are exactly the same
  as normal managed mail domains.

  We currently have 15 https domains of which 6 are non-\texttt{cam.ac.uk}

}

% http://www.corbisimages.com/Enlargement/GL001481.html
\slideB[8cm]{cam.jpg}
  {Addresses at \texttt{cam.ac.uk}}
{
  \begin{columns}
    \column{8cm}
      \begin{itemize}
      \item 44645 aliases
      \item 43114 go to Hermes
      \item 12 special cases
      \end{itemize}
    \mode<beamer>{~}
  \end{columns}
}

\notes{

  The main \texttt{@cam} domain is in fact just a slightly weird
  managed mail domain. (The numbers are currently at their largest,
  just before the undergraduate account bulk cancellation.)

  Users can control where their \texttt{@cam} address redirects to
  using a web form on \url{https://jackdaw.cam.ac.uk/cammail}.

  Most of the aliases are fetched from Jackdaw hourly. There is an
  additional list of special case aliases, which is managed using the
  menu system like other managed mail domains.

  Note that the Hermes account management job is run daily. When
  accounts are cancelled, the users' \texttt{@cam} email addresses
  stop working almost immediately, but their Hermes account continues
  to work until the next morning.

}

% http://camphalfblood.wikia.com/wiki/Hermes
\slideL{hermes.jpg}
  {Addresses at \texttt{hermes.cam.ac.uk}}
{
  \begin{itemize}
  \item 44680 accounts
  \item 33 special case aliases
  \item 8 live servers
  \item 8 hot spares
  \item 6 TB storage each
  \end{itemize}
}

\notes{

  Delivery to the Hermes message store servers is handled directly by
  ppswitch using special case code. There is a table listing which
  user is on which server.

}

% http://www.teleread.com/chris-meadows/cydia-the-iphone-get-out-of-jail-free-card/
\slideBR[6cm]{get-out-of-jail-free.jpg}
  {Internal redirects}
{
  \begin{itemize}
  \item For all the awkward cases
  \item Extend managed mail domain
  \item RT servers are common
  \item Also used for migrations
  \end{itemize}
}

\notes{

  When I was discussin our local restrictions I mentioned that we have
  a facility to relax the restrictions in a controlled manner. That is
  the ``internal redirect'' table.

  In the past we had an ``escape route'' table which did a similar
  job, but it allowed hostnames to appear in mail domains of messages
  between ppswitch and the destination mail server.

  Internal redirects avoid that problem, which also makes them better
  for supporting gradual migrations from managed mail domains to
  institution mail servers.

}

% http://www.mimosaspirit.com/index.php?cPath=77
\slideB[6cm]{runes.jpg}
  {Internal redirects}
{
  \begin{itemize}
  \item \texttt{atj20:atj20@ucs-exchange.internal-redirect}
  \item \texttt{atj20@ucs.cam.ac.uk} $\rightarrow$ \texttt{atj20@ucs.cam.ac.uk}
  \item But delivered to an alternate destination
  \end{itemize}
  \mode<beamer>{~}
}

\notes{

  To use an internal redirect you put an alias in your managed mail
  domain that delivers to an address with a special domain name.

  This doesn't change the address that the mail is delivered to, but
  instead changes the destination server.

  This allows you to move addresses one-by-one from a managed mail
  domain to a server, so you can redirect just a few to support a
  ticketing system, or you can gradually migrate from a managed mail
  domain to your own server without any sudden cutovers or nasty
  surprises.

  When all users have been migrated we do some final checks to make
  sure everything is ready before replacing the managed mail domain
  with a special route. Because the recipient email addresses on the
  mail from ppswitch to the server are the same, a managed mail domain
  full of internal redirects works just like a special route, so the
  cutover has no visible effect.

  Recent migrations include Careers, the Hutchison MRC, Continuing
  Education, and Plant Sciences.

}

% http://africansafaris.co.ke/kenyasafaris.html
\slideB[7cm]{migration.jpg}
  {Migration}
{
  \begin{columns}
    \column{7cm}
      \begin{itemize}
      \item ``disabled'' managed mail domains
      \end{itemize}
    \mode<beamer>{~}
  \end{columns}
}

\notes{

  When migrating in the other direction we again make it a gradual
  process. The department moves their users from their own server to
  Hermes leaving behind a redirect on their server. When all users
  have been migrated they should be left with no mail configuration
  other than an aliases file.

  We create a managed mail domain in ``disabled mode'' so that the
  domain managers can edit it using the Hermes menu system wihtout
  having any effect on mail routing.

  When they have populated their managed mail domain we can enable it
  so it takes over from the old mail server.

}

\section{End}

% http://backseatcuddler.com/2008/12/20/arnold-hints-at-terminator-salvation-cameo/
\slideT[5cm]{terminator.jpg}
  {This talk has been terminated}
{}

\end{document}

% eof
