Doc fixes
[mirror/userdir-ldap.git] / web / forward.wml
1 #use wml::debian::template title="Email Forwarding"
2 <p>
3 Emails to @debian.org addresses now go through a LDAP distributed email system. 
4 This system uses the forwarding field in the LDAP directory to route mail 
5 without passing it through a users .forward file on a single host.
6 Multiple machines participate in the forwarding to provide redudancy.
7
8 <p>
9 Each forwarders inspects the LDAP database
10 to see if foo@debian.org has forwarding set to an address, if so the <i>envelope
11 to address</i> is rewritten and the message redirected to the new address.
12 Otherwise the message is relayed to master.debian.org for processing by the
13 users .forward files. If email forwarding is setup then .forward files are
14 <b>NOT</b> considered. Extension addresses (foo-lists) are always routed
15 directly to master for processing.
16
17 <p>
18 All machines also use the forwarding attribute as a default destination for
19 email. If the user has a home directory and no .forward file the mail is
20 forwarded rather than delivered to /var/spool/mail. This makes sure cron
21 reports, bug responses and other unexpected emails are not misplaced.
22
23 <p>
24 If you set the forwarding address to be a specific Debian machine and do 
25 not create a forward file then that machine will spool the mail to 
26 /var/spool/mail instead of creating a mail loop.
27
28 <p>
29 The email forwarding can be easially reconfigured using GnuPG:
30 <pre>
31 echo "emailforward: foo@bar.com" | gpg --clearsign | mail change@db.debian.org
32 </pre>
33 or by visiting <a href="https://db.debian.org/login.html">db.debian.org</a>
34
35 <p>
36 You can test the email routing by using the command <tt>/usr/sbin/exim -bt
37 foo@debian.org</tt>
38
39 <h2>procmail</h2>
40 If you use procmail for your main mailbox, PLEASE, erase your .forward
41 file and put a .procmailrc in its place instead. This feature has been
42 supported on debian.org machines for a good while now, and will continue to be
43 supported.
44
45 <p>
46 The correct way to invoke procmail for extension addresses is "|/usr/bin/procmail [options]"
47 Ignore the IFS=".." stuff in the procmail man page.
48
49 <h2>MailBox formats</h2>
50 Email can be saved to mailboxes or maildirs by using the correct lines in a
51 .forward file:
52 <p>
53 Mailbox format files "/debian/home/foo/Mbox"
54 <br>Maildir format files "/debian/home/foo/MDir/"
55
56 <p>
57 To deliver to /var/spool/mail/foo use a construct like '|/usr/bin/procmail
58 -m /dev/null'. Putting the mailbox path will not work. You must use
59 absolute paths for mailboxes, qmail-like ./ paths are not supported by
60 Exim.
61
62 <p>
63 Also, 'Exim Filter' files are deliberately turned off.
64
65 <h2>Delivey Environment</h2>
66 Some environment variables are set per-message (not quoted! Careful!)
67 It is important to note that the environment variables dealing with
68 addressing apply to the ENVELOPE address are are totally completely
69 unrelated to the actual contents of the message:
70 <p>
71 'Standard' Env Variables:
72 <ol>
73 <li>EXTENSION (the 'foo' in .forward-foo)
74 <li>LOGNAME,USER (your user name)
75 <li>SENDER (envelope originator of message)
76 </ol>
77
78 <p>
79 'Qmail' Env Variables:
80 <ol>
81 <li>EXT == EXTENSION
82 <li>LOCAL = (the entire bit before the @)
83 <li>RECIPIENT = (the entire envelope to)
84 </ol>
85
86 <p>
87 Such that, <i>$RECIPIENT = $LOCAL-$EXTENSION@&lt;something&gt;</i>.
88