Re: SPF Record with Multiple Servers

Pandu Poluan <[email protected]> Thu, 25 Apr 2013 23:53:11 +0700
Newsgroups gmane.linux.gentoo.server
Message-ID <CAA2qdGW_-L_G784MTsYPBcnfxnXNbZ2NKeJCN6dS+OH_1m4-EQ@mail.gmail.com>
--089e01176d89ef423a04db3240d4
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

On Apr 25, 2013 11:31 PM, "Vin=C3=ADcius Ferr=C3=A3o" <[email protected]=
rj.br>
wrote:
>
> Hello Robert,
>
> The internal MTA has an Internet facing address since we have a plenty of
them we just use it.
>
> Ordinary users connect through this internal MTA to send/receive mail.
But everything that goes outside of the domain goes through the Postfix
server. So I'm just uncertain about this configuration. Since the message
originates in the internal MTA and the its relayed to the Postfix server...
>
> So I just need to know if the SPF record should include the internal MTA
too, since the postfix server is already in the SPF declaration.
>
> Thanks in advance,
>
> Sent from my iPhone
>
> On 25/04/2013, at 13:03, "Robert Bridge" <[email protected]> wrote:
>
>> Just the internet facing one, as I understand it. Nothing else should
ever see the internal MTA, and it may not even have a routable IP address!
>>
>>
>> On 25 April 2013 16:57, Vin=C3=ADcius Ferr=C3=A3o <[email protected]=
j.br>
wrote:
>>>
>>> Hello Halassy, thanks for your reply.
>>>
>>> I'm aware of the syntax, I just mistyped it.
>>>
>>> The main question still continues, should I put both MTAs or just the
Internet facing one?
>>>
>>> Thanks in advance,
>>>
>>> Sent from my iPhone
>>>
>>> On 25/04/2013, at 05:14, "Halassy Zolt=C3=A1n" <[email protected]> wr=
ote:
>>>
>>> > Hello!
>>> >
>>> > Using MX in SPF record is a simple way to describe trivial two-way
setups, that is, MX will also send the mails, not just receive them. If you
have a non-trivial setup, you can use, for example IP addresses, like ip6:
and ip4:. Add every address which from a mail could possibly leave your
organization, and that's it, do not use MX. BTW, the syntax is v=3Dspf1, no=
t
what you wrote.
>>> >
>>> > 2013-04-25 01:32 keltez=C3=A9ssel, Vin=C3=ADcius Ferr=C3=A3o =C3=ADrt=
a:
>>> >> I've a question about the SPF setup in my domain.
>>> >>
>>> >> We have two MTAs: an exchange server that does not use SMTP to relay
messages to the Internet and a Postfix Mail Gateway on the border to send
and receive messages to/from the internet.
>>> >>
>>> >> The clients connect on the Exchange Server to relay messages to the
external world. So an SMTP connection would start in the Exchange, then it
relays to the Postfix server and then to the Internet. On the other hand
when a message come from the Internet it first arrives in the Postfix
server and after the processing it's handled to the Exchange server.
>>> >>
>>> >> The question is: which SPF TXT string I should use?
>>> >>
>>> >> The Postfix server is my only MX. And I don't know if I should
include the Exchange Server name in the SPF rules.
>>> >>
>>> >> I was considering: vspf=3D1 mx -all
>>> >>
>>> >> But this does not include the Exchange, and I don't know if it's
right or not.
>>> >
>>> >
>>>
>>

Please do not top post; its frowned upon in this list.

Now to answer your last question: No need.

An SPF record should contain *only* the email server(s) that actually talks
to another domain's email server.

Since the Exchange server and the Postfix server are in the same domain,
and since *only* the Postfix server actually talks to mail servers of
*other* domains, you only need to specify the Postfix server in the SPF
record.

The situation gets complicated, though if you (1) re-relay your email
(e.g., through your ISP's mail relay), or (2) use Gmail to act as an "on
behalf of" mail server, or (3) both.

Just for an example, here's the SPF Record for my previous office:

"v=3Dspf1 ip4:174.120.70.145 ip4:174.120.70.155 ip4:49.128.177.72 a mx
ip4:49.128.177.71 a:rockefeller.post.co.id a:carnegie.post.co.id include:_
spf.google.com -all"

The set of IP addresses are the ISP's mail relay servers; the a: fields are
the IP addresses of our cloud servers, and some of us use Gmail as a
stand-in for corporate email when we're outside the office.

Rgds,
--

--089e01176d89ef423a04db3240d4
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

<p><br>
On Apr 25, 2013 11:31 PM, &quot;Vin=C3=ADcius Ferr=C3=A3o&quot; &lt;<a href=
=3D"mailto:[email protected]">[email protected]</a>&gt; wro=
te:<br>
&gt;<br>
&gt; Hello Robert,<br>
&gt;<br>
&gt; The internal MTA has an Internet facing address since we have a plenty=
 of them we just use it.<br>
&gt;<br>
&gt; Ordinary users connect through this internal MTA to send/receive mail.=
 But everything that goes outside of the domain goes through the Postfix se=
rver. So I&#39;m just uncertain about this configuration. Since the message=
 originates in the internal MTA and the its relayed to the Postfix server..=
.<br>

&gt;<br>
&gt; So I just need to know if the SPF record should include the internal M=
TA too, since the postfix server is already in the SPF declaration.<br>
&gt;<br>
&gt; Thanks in advance,<br>
&gt;<br>
&gt; Sent from my iPhone<br>
&gt;<br>
&gt; On 25/04/2013, at 13:03, &quot;Robert Bridge&quot; &lt;<a href=3D"mail=
to:[email protected]">[email protected]</a>&gt; wrote:<br>
&gt;<br>
&gt;&gt; Just the internet facing one, as I understand it. Nothing else sho=
uld ever see the internal MTA, and it may not even have a routable IP addre=
ss!<br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt; On 25 April 2013 16:57, Vin=C3=ADcius Ferr=C3=A3o &lt;<a href=3D"m=
ailto:[email protected]">[email protected]</a>&gt; wrote:<b=
r>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; Hello Halassy, thanks for your reply.<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; I&#39;m aware of the syntax, I just mistyped it.<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; The main question still continues, should I put both MTAs or j=
ust the Internet facing one?<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; Thanks in advance,<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; Sent from my iPhone<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; On 25/04/2013, at 05:14, &quot;Halassy Zolt=C3=A1n&quot; &lt;<=
a href=3D"mailto:[email protected]">[email protected]</a>&gt; wrote:<br=
>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; &gt; Hello!<br>
&gt;&gt;&gt; &gt;<br>
&gt;&gt;&gt; &gt; Using MX in SPF record is a simple way to describe trivia=
l two-way setups, that is, MX will also send the mails, not just receive th=
em. If you have a non-trivial setup, you can use, for example IP addresses,=
 like ip6: and ip4:. Add every address which from a mail could possibly lea=
ve your organization, and that&#39;s it, do not use MX. BTW, the syntax is =
v=3Dspf1, not what you wrote.<br>

&gt;&gt;&gt; &gt;<br>
&gt;&gt;&gt; &gt; 2013-04-25 01:32 keltez=C3=A9ssel, Vin=C3=ADcius Ferr=C3=
=A3o =C3=ADrta:<br>
&gt;&gt;&gt; &gt;&gt; I&#39;ve a question about the SPF setup in my domain.=
<br>
&gt;&gt;&gt; &gt;&gt;<br>
&gt;&gt;&gt; &gt;&gt; We have two MTAs: an exchange server that does not us=
e SMTP to relay messages to the Internet and a Postfix Mail Gateway on the =
border to send and receive messages to/from the internet.<br>
&gt;&gt;&gt; &gt;&gt;<br>
&gt;&gt;&gt; &gt;&gt; The clients connect on the Exchange Server to relay m=
essages to the external world. So an SMTP connection would start in the Exc=
hange, then it relays to the Postfix server and then to the Internet. On th=
e other hand when a message come from the Internet it first arrives in the =
Postfix server and after the processing it&#39;s handled to the Exchange se=
rver.<br>

&gt;&gt;&gt; &gt;&gt;<br>
&gt;&gt;&gt; &gt;&gt; The question is: which SPF TXT string I should use?<b=
r>
&gt;&gt;&gt; &gt;&gt;<br>
&gt;&gt;&gt; &gt;&gt; The Postfix server is my only MX. And I don&#39;t kno=
w if I should include the Exchange Server name in the SPF rules.<br>
&gt;&gt;&gt; &gt;&gt;<br>
&gt;&gt;&gt; &gt;&gt; I was considering: vspf=3D1 mx -all<br>
&gt;&gt;&gt; &gt;&gt;<br>
&gt;&gt;&gt; &gt;&gt; But this does not include the Exchange, and I don&#39=
;t know if it&#39;s right or not.<br>
&gt;&gt;&gt; &gt;<br>
&gt;&gt;&gt; &gt;<br>
&gt;&gt;&gt;<br>
&gt;&gt;</p>
<p>Please do not top post; its frowned upon in this list.</p>
<p>Now to answer your last question: No need.</p>
<p>An SPF record should contain *only* the email server(s) that actually ta=
lks to another domain&#39;s email server.</p>
<p>Since the Exchange server and the Postfix server are in the same domain,=
 and since *only* the Postfix server actually talks to mail servers of *oth=
er* domains, you only need to specify the Postfix server in the SPF record.=
</p>

<p>The situation gets complicated, though if you (1) re-relay your email (e=
.g., through your ISP&#39;s mail relay), or (2) use Gmail to act as an &quo=
t;on behalf of&quot; mail server, or (3) both.</p>
<p>Just for an example, here&#39;s the SPF Record for my previous office:</=
p>
<p>&quot;v=3Dspf1 ip4:174.120.70.145 ip4:174.120.70.155 ip4:49.128.177.72 a=
 mx ip4:49.128.177.71 a:<a href=3D"http://rockefeller.post.co.id">rockefell=
er.post.co.id</a> a:<a href=3D"http://carnegie.post.co.id">carnegie.post.co=
.id</a> include:_<a href=3D"http://spf.google.com">spf.google.com</a> -all&=
quot;</p>

<p>The set of IP addresses are the ISP&#39;s mail relay servers; the a: fie=
lds are the IP addresses of our cloud servers, and some of us use Gmail as =
a stand-in for corporate email when we&#39;re outside the office.</p>
<p>Rgds,<br>
--<br>
</p>

--089e01176d89ef423a04db3240d4--