Gentoo Archives: gentoo-user

From: Alex Schuster <wonko@×××××××××.org>
To: gentoo-user@l.g.o
Subject: Re: [gentoo-user] Setting up SMTP relay
Date: Sun, 23 Jan 2011 19:25:57
Message-Id: 4D3C8041.2070105@wonkology.org
In Reply to: Re: [gentoo-user] Setting up SMTP relay by kashani
1 kashani writes:
2
3 > On 1/22/2011 1:34 PM, Alex Schuster wrote:
4
5 > I handle it with Postfix. Dovecot is only imap and won't accept main
6 > directly.
7
8 Whoops.
9
10 > 1. install postfix with USE sasl or devecot-sasl, I don't believe it
11 > matters which. Add the following lines to the bottom of
12 > /etc/postfix/main.cf and fill in your hostname, domain, etc as needed.
13 >
14 > # local settings
15 > myhostname = host.domain.com
16 > mydomain = domain.com
17 > myorigin = $myhostname
18 > inet_interfaces = all
19 > mydestination = $myhostname, localhost.$mydomain, localhost
20 > mynetworks_style = subnet
21 > mynetworks = 127.0.0.0/8 10.19.20.0/24
22
23 I left most items commented out as they are the same as the default, I
24 only had to set mydomain, although dnsdomainname and hostname -d both
25 return wonkology.org.
26
27 > 2. run sudo newaliases
28 > Postfix bitches if the /etc/mail/aliases.db doesn't exist and will hang
29 > on start.
30 >
31 > 3. Verify postfix works, isn't complaining in the logs, etc.
32 > Make sure it's up and running. That you can telnet to port 25 from
33 > another machine and even send to a local user on your machine.
34
35 Looks good!
36
37 > 4. Add the user/pass stuff to the bottom of /etc/postfix/main.cf
38 >
39 > # relay host and credentials
40 > relayhost = [my.external.relayhost.com]
41 > smtp_sasl_auth_enable = yes
42 > smtp_sasl_password_maps = hash:/etc/postfix/sasl.passwd
43 > smtp_sasl_mechanism_filter = digest-md5
44 > smtp_sasl_security_options = noanonymous
45
46 I need TLS authentication, and found what I need in a howto:
47 smtp_sasl_tls_security_level = may
48 And I removed smtp_sasl_mechanism_filter.
49
50 > 5. Once you're this far it's time to test all the way through.
51 >
52 > make sure you can send from the localhost machine
53 > sendmail -v some@×××××××.com
54 > .
55 >
56 > Once you're sure that works test from another machine on the network.
57 > Ideally it should just work if you've done all the steps.
58
59 Relaying does not work yet, I get a "Relay access denied (in reply to
60 RCPT TO command)" error. But my initial goal is reached, I can send mail
61 to {root,wonko}@wonkology.org. That's all I wanted.
62
63 Many many thanks kashani! Your howto is much more than I expected, it is
64 much appreciated. I realize that postfix is not too complicated, so I
65 will play more with it when I have some spare time.
66
67 Wonko

Replies

Subject Author
Re: [gentoo-user] Setting up SMTP relay kashani <kashani-list@××××××××.net>
Re: [gentoo-user] Setting up SMTP relay Alex Schuster <wonko@×××××××××.org>