removed
[ikiwiki.git] / docs / handbook / handbook-outgoing-only.mdwn
1 \r
2 \r
3 ## 20.8 Setting up to send only \r
4 \r
5 ***Contributed by Bill Moran. ***\r
6 \r
7 There are many instances where you may only want to send mail through a relay. Some examples are:\r
8 \r
9
10 * Your computer is a desktop machine, but you want to use programs from the command line that send mail. To do so, you should use your ISP's mail relay.\r
11
12 * The computer is a server that does not handle mail locally, but needs to pass off all mail to a relay for processing.\r
13 \r
14 Just about any MTA is capable of filling this particular niche. Unfortunately, it can be very difficult to properly configure a full-featured MTA just to handle offloading mail. Programs such as  **sendmail**  and  **postfix**  are largely overkill for this use.\r
15 \r
16 Additionally, if you are using a typical Internet access service, your agreement may forbid you from running a ***mail server***.\r
17 \r
18 The easiest way to fulfill those needs is to install the [`mail/ssmtp`](http://pkgsrc.se/mail/ssmtp) port. Execute the following commands as `root`:\r
19 \r
20     \r
21     # cd /usr/ports/mail/ssmtp\r
22     # make install replace clean\r
23 \r
24 \r
25 Once installed, [`mail/ssmtp`](http://pkgsrc.se/mail/ssmtp) can be configured with a four-line file located at `/usr/local/etc/ssmtp/ssmtp.conf`:\r
26 \r
27     \r
28     root=yourrealemail@example.com\r
29     mailhub=mail.example.com\r
30     rewriteDomain=example.com\r
31     hostname=_HOSTNAME_\r
32 \r
33 \r
34 Make sure you use your real email address for `root`. Enter your ISP's outgoing mail relay in place of `mail.example.com` (some ISPs call this the ***outgoing mail server*** or ***SMTP server***).\r
35 \r
36 Make sure you disable  **sendmail**  by setting `sendmail_enable="NONE"` in `/etc/rc.conf`.\r
37 \r
38 [`mail/ssmtp`](http://pkgsrc.se/mail/ssmtp) has some other options available. See the example configuration file in `/usr/local/etc/ssmtp` or the manual page of  **ssmtp**  for some examples and more information.\r
39 \r
40 Setting up  **ssmtp**  in this manner will allow any software on your computer that needs to send mail to function properly, while not violating your ISP's usage policy or allowing your computer to be hijacked for spamming.\r
41 \r
42 \r
43 \r
44 CategoryHandbook\r
45 CategoryHandbook-email\r