Gentoo Archives: gentoo-user

From: Alex Schuster <wonko@×××××××××.org>
To: gentoo-user@l.g.o
Subject: Re: [gentoo-user] Setting up SMTP relay
Date: Sat, 05 Feb 2011 14:40:43
Message-Id: 4D4D60BC.4050702@wonkology.org
In Reply to: Re: [gentoo-user] Setting up SMTP relay by Alex Schuster
1 I wrote:
2
3 In case someone else also wants to setup this, here's the final steps to
4 make relaying work.
5
6 > Relaying does not work yet, I get a "Relay access denied (in reply to
7 > RCPT TO command)" error. But my initial goal is reached, I can send mail
8 > to {root,wonko}@wonkology.org. That's all I wanted.
9 >
10 > Many many thanks kashani! Your howto is much more than I expected, it is
11 > much appreciated. I realize that postfix is not too complicated, so I
12 > will play more with it when I have some spare time.
13
14 Yesterday I had some. It took me a while to figure out what was wrong. I
15 read many howtos, but they all did not explain in detail how to
16 authenticate with another SMTP server, so postfix would act as a client.
17
18 It turned out that the error was simple: I had to change
19 smtp_sasl_tls_security_level = may
20 to
21 smtp_tls_security_level = may
22 . So, my relay config part of main.cf is this:
23
24 relayhost = [my.external.relay.host]
25 smtp_sasl_auth_enable = yes
26 smtp_sasl_password_maps = hash:/etc/postfix/saslpass
27 smtp_sasl_security_options = noanonymous
28 smtp_tls_security_level = may
29 smtp_tls_cert_file = /etc/ssl/postfix/weird.pem
30
31 And I had to create the (self-signed) certificate. It's done like this:
32 openssl req -x509 -nodes -days 3650 -newkey rsa:1024 -keyout
33 /etc/ssl/postfix/weird.pem
34
35 I was told I had to set my name to my hostname, not sure if this is true.
36
37 Done. My host now acts as SMPT server, accepting connections without
38 password from the LAN. Now I can enable mail sending for the other
39 Gentoo systems here in make.conf. And in ssmtp.conf, so things like cron
40 can send status mails to me.
41
42 Thanks again Kashani, without you help I would not have tried this.
43
44 Wonko