fix layout problems
[mirror/userdir-ldap-cgi.git] / html / doc-mail.wml
1 #use wml::db.d.o title="LDAP Gateway"
2
3 <dsatoc/>
4
5 <p>
6 The LDAP directory has a PGP secured mail gateway that
7 allows users to safely and conveniently effect changes to their entries. It
8 makes use of PGP signed input messages to positively identify the user and
9 to confirm the validity of the request. Furthermore it implements a replay
10 cache that prevents the gateway from accepting the same message more than
11 once.
12
13 <p>
14 There are three functions logically split into 3 separate email addresses
15 that are implemented by the gateway: <b>ping</b>, <b>new password</b> and
16 <b>changes</b>. The function to act on is the first argument to the program.
17
18 <p>
19 Error handling is currently done by generating a bounce message and passing
20 descriptive error text to the mailer. This can generate a somewhat hard to 
21 read error message, but it does have all the relevant information.
22
23 <h1>Ping</h1>
24 The ping command simply returns the users public record. It is useful for
25 testing the gateway and for the requester to get a basic dump of their
26 record. In future this address might 'freshen' the record to indicate the
27 user is alive. Any PGP signed message will produce a reply.
28
29 <h1>New Password</h1>
30 If a user looses their password they can request that a new one be generated 
31 for them. This is done by sending the phrase "Please change my Debian 
32 password" to chpasswd@db.debian.org. The phrase is required to prevent the 
33 daemon from triggering on arbitrary signed email. The best way to invoke this
34 feature is with 
35 <pre>echo "Please change my Debian password" | gpg --clearsign | mail chpasswd@db.debian.org</pre>
36 After validating the request the daemon will generate a new random password,
37 set it in the directory and respond with an encrypted message containing the
38 new password. The password can be changed using one of the other interface
39 methods.
40
41 <h1>Changes</h1>
42 An address (changes@db.debian.org) is provided for making almost arbitrary 
43 changes to the contents of the record. The daemon parses its input line by 
44 line and acts on each line in a command oriented manner. Anything, except for 
45 passwords, can be changed using this mechanism. Note however that because 
46 this is a mail gateway it does stringent checking on its input. The other 
47 tools allow fields to be set to virtually anything, the gateway requires 
48 specific field formats to be met.
49
50 <ul>
51 <li>A line of the form <tt>'field: value'</tt> will change the contents of 
52 the field to value. Some simple checks are performed on value to make sure 
53 that it is not set to nonsense. You can't set an empty string as
54 value, use <tt>del</tt> instead (see below). The values that can
55 be changed are: 
56 <b>c</b>, <b>l</b>, <b>facsimileTelephoneNumber</b>, <b>telephoneNumber</b>, 
57 <b>postalAddress</b>, <b>postalCode</b>,
58 <b>loginShell</b>, <b>emailForward</b>,
59 <b>jabberJID</b>, <b>ircNick</b>, <b>icqUin</b>,
60 <b>onVacation</b>, 
61 <b>labledURI</b>,
62 <b>birthDate</b> (YYYYMMDD),
63 <b>mailDisableMessage</b>,
64 <b>mailGreylisting</b> (TRUE|FALSE),
65 <b>mailCallout</b> (TRUE|FALSE),
66 <b>mailContentInspectionAction</b> (markup|blackhole|reject)
67 <b>mailDefaultOptions</b> (TRUE|FALSE),
68 <b>bATVToken</b>,
69 <b>VoIP</b>,
70 and <b>gender</b> (1|2|9|male|female|unspecified).
71
72 <li>A line of the form <tt>'del field'</tt> will completly remove all
73 occurrences of a field. Useful e.g. to unset your vacation status.
74 The fields that can be deleted are:
75 <b>c</b>, <b>l</b>, <b>facsimileTelephoneNumber</b>, <b>telephoneNumber</b>,
76 <b>postalAddress</b>, <b>postalCode</b>, <b>emailForward</b>,
77 <b>onVacation</b>, <b>labeledURI</b>, <b>latitude</b>, <b>longitude</b>, <b>dnsZoneEntry</b>,
78 <b>ircNick</b>, <b>jabberJID</b>, <b>icquin</b>,
79 <b>sshRSAAuthKey</b>,
80 <b>mailGreylisting</b>,
81 <b>mailCallout</b>,
82 <b>mailRBL</b>,
83 <b>mailRHSBL</b>,
84 <b>mailDisableMessage</b>,
85 <b>mailWhitelist</b>,
86 <b>mailContentInspectionAction</b>,
87 <b>mailDefaultOptions</b>,
88 <b>bATVToken</b>,
89 <b>birthDate</b>,
90 <b>jpegPhoto</b>, <b>VoIP</b>
91
92 <li>The daemon has a special parser to help changing latitude and longitude
93 values. It accepts several common formats for position information and
94 converts them to one of the standard forms. The permitted types are 
95 <pre>D = Degrees, M = Minutes, S = Seconds, x = n,s,e,w
96 +-DDD.DDDDD, +- DDDMM.MMMM, +-DDDMMSS.SSSS [standard forms]
97 DDxMM.MMMM, DD:MM.MMMM x, DD:MM:SS.SSS X)</pre>
98 and the request format is <tt>'Lat: xxx Long: xxx'</tt> where <tt>xxx</tt> 
99 is one of the permitted types. The resulting response will include how the 
100 input was parsed and the value in decimal degrees.
101
102 <li>
103 Part of the replicated dataset is a virtual .ssh/authorized_keys file for
104 each user. The change address is the simplest way to set the RSA key(s) you
105 intend to use. Simply place a key on a line by itself, the full SSH key
106 format specification is supported, see sshd(8). Probably the most common way
107 to use this function will be 
108 <pre>cat .ssh/id_rsa.pub | gpg --clearsign | mail changes@db.debian.org</pre>
109 which will set the authentication key to the identity you are using.
110
111 Multiple keys per user are supported, but they must all be sent at once.
112
113 Keys can be exported to a subset of machines by prepending
114 <b>allowed_hosts=$fqdn,$fqdn2</b> to the specific key. The allowed machines
115 must only be separated by a comma.
116
117 <i>Example:</i>
118 <pre>
119 # cat .ssh/debian-machines.pub
120 allowed_hosts=ravel.debian.org,gluck.debian.org ssh-rsa AAAAB3Nz..mOX/JQ== user@machine
121 ssh-rsa AAAAB3Nz..uD0khQ== user@machine
122 </pre>
123
124 <li>RBL, RHSBL, and whitelists can only be updated via the mail gateway.  Like
125 DNS and ssh keys, any list specified must be specified in its enterity.  The format is:
126 <b>listtype</b> <b>dns.domain.of.rbl/IP to whitelist</b> where listtype is one of mailRBL,
127 mailRHSBL, and mailWhitelist
128
129 <li>The only way to get a dnsZoneEntry record for a debian.net address is to
130 use the mail gateway. It will verify the request and prevent name collisions
131 automatically. Requests can take three forms: <tt>'foo in a 1.2.3.4'</tt>,
132 <tt>'foo in cname foo.bar.'</tt>, or <tt>'foo in mx 10 foo.bar.'</tt> (note
133 the trailing dot).
134 Note that you
135 cannot combine CNAME with any other record types. The precise form
136 is critical and must not be deviated from.
137 Like the SSH function above, multiple hosts are supported, but they must all
138 be sent at once. The debian.net zone is reloaded hourly.
139
140 <li>If the single word <b>show</b> appears on a line then a PGP encrypted version
141 of the entire record will be attached to the resulting email.
142 </ul>
143
144 After processing the requests the daemon will generate a report which contains
145 each input command and the action taken. If there are any parsing errors 
146 processing stops immediately, but valid changes up to that point are
147 processed. 
148
149 <h2>Notes</h2>
150 <p>
151 In this document PGP refers to any message or key that GnuPG is
152 able to generate or parse, specifically it includes both PGP2.x and OpenPGP
153 (aka GnuPG) keys. 
154 <p>
155 Due to the replay cache the clock on the computer that generates the
156 signatures has to be accurate to at least one day. If it is off by several
157 months or more then the daemon will outright reject all messages.
158 <p>
159 Examples are given using GnuPG, but PGP 2.x can also be used. The correct
160 options to generate a clear signed ascii armored message in 'filter' mode
161 are <tt>pgp -fast</tt> which does the same as <tt>gpg --clearsign</tt>
162 <p>
163 Debian.org machines rely on secured replication to transfer login data out
164 of the database. Replication is performed at 15 min intervals so it can take
165 a short while before any changes made take effect.
166 <p>
167 If the mail you're sending to the mail robot is too long for your MTA
168 and gets split please use a different mail origin or pass the mail to
169 the MTA on a debian.org machine, e.g. ravel:
170 <pre>cat .ssh/id_rsa.pub | gpg --clearsign | ssh ravel mail changes@db.debian.org</pre>