The mail server is set up so that we can host multiple domain names with one server. This is called Virtual Hosting. Mailman uses the same set up. Basically, the virtusertable is how we host multiple domain names with one mail server. Mail comes in, goes through /etc/mail/virtusertable and then through /etc/mail/aliases.

To set up an alias on moog, both /etc/mail/virtusertable and /etc/mail/aliases must be edited and commands need to be run.

  1. As root on moog, edit /etc/mail/virtusertable and add a section for the new alias. For example:
    joyuen@e3s-center.org joyuen_e3s
    joyuen@e3s_center.org joyuen_e3s
    joyuen@e3scenter.org joyuen_e3s
    
  2. Edit /etc/mail/aliases:
    joyuen_e3s:                  joyuen@eecs.berkeley.edu
    
    (See also How do I create a group mailing list on a non-workgroup site?)
    Hint: Try setting up the list with yourself as the recipient and then testing from a non-eecs gmail account. For example:
    joyuen_e3s:                  marys@eecs.berkeley.edu
    
    This makes it easier to test out the email alias below.
  3. Follow the instructions at the top of the /etc/mail/virtusertable:
    cd /etc/mail
    make
    newaliases
    /usr/bin/pkill -HUP -x -u 0 sendmail
    
    Note that we have to run make so that /etc/mail/virtusertable is combined with other files. See Adjusting sendmail for backscatter
  4. To check the alias, we connect to the sendmail port and use the expn command to expand the email alias.
    The syntax is expn emailaddress@host. The alias should be expanded.
    The sendmail port is port 25.
    Use telnet to connect to port 25:
    [root@moog ~]# telnet localhost 25
    Trying ::1...
    telnet: connect to address ::1: Connection refused
    Trying 127.0.0.1...
    Connected to localhost.
    Escape character is '^]'.
    220 moog.eecs.berkeley.edu ESMTP Sendmail 8.14.4/8.14.4; Wed, 4 Sep 2013 23:55:09 -0700
    expn e3sprograms@e3s-center.org
    250 2.1.5 <lkmarlor@berkeley.edu>
    quit
    221 2.0.0 moog.eecs.berkeley.edu closing connection
    Connection closed by foreign host.
    
    If the above does not work, edit /etc/mail/sendmail.cf, find the line that says:
    O PrivacyOptions=authwarnings,novrfy,noexpn,restrictqrun
    
    remove noexpn, run
    /usr/bin/pkill -HUP -x -u 0 sendmail
    
    and retry the telnet command.
    Important: When you are done, edit sendmail.cf and add noexpn back and rerun /usr/bin/pkill -HUP -x -u 0 sendmail
  5. The try sending joyuen@e3s-center.org email from a non-UCB gmail account because email sent to yourself is not delivered. See Email to mailing lists is not received by the sender.
  6. If you set up the alias to point to your account:
    1. Change /etc/mail/aliases to point to the proper people,
    2. Run newaliases
    3. Verify that the alias works using telnet.
    4. Send email to the alias asking that they let you know if they received the email

Note that for @truststc.org aliases, virtusertable should use @trust.eecs.berkeley.edu. I'm not sure why, but this was probably because trust.eecs was a cname in DNS instead of a MX and A record. Or, trust was not included in the sendmail.cw file.
For example:

reu-info@trust.eecs.berkeley.edu                %1_trust
securit-info@trust.eecs.berkeley.edu            %1_trust
wise-info@trust.eecs.berkeley.edu               %1_trust