I recently started configuring addresses on my postfix server and stumbled into an issue with my colleagues.
So assume i have an alias testing@bar.ru
which forwards mail to somedude@gmail.com and vitali.r@foo.net
In case we send to the same domain, the alias is, everything works perfectly well and email is delievered, but lets dig deeper into otherdomain issue as email immediately bounces back with this error:
<vitali.r@foo.net> (expanded from <alias@somedomain.com>): host
mx.foo.net[144.76.75.247] said: 550 You must be authenticated (in
reply to RCPT TO command)
Fortunately, owners of this otherdomain are my colleagues, so I addressed this question to them first. We did some digging and figured it out, that email is not just simply sent from vitali.r@foo.net, but rather is sent impersonating some one else.
To get a better understanding in this issue, I advise you to take a look at the headers of delivered email to somedude@gmail.com, that is rejected by foo.net server.
Delivered-To: somedude@gmail.com
Received: by 10.140.108.54 with SMTP id i51csp86667qgf;
Thu, 24 Apr 2014 04:54:02 -0700 (PDT)
X-Received: by 10.14.246.1 with SMTP id p1mr2029071eer.20.1398340441786;
Thu, 24 Apr 2014 04:54:01 -0700 (PDT)
Return-Path: <vitali.r@foo.net>
Received: from bar.ru (bar.ru. [47.175.193.55])
by mx.google.com with ESMTPS id p8si7998323eew.276.2014.04.24.04.54.01
for <somedude@gmail.com>
(version=TLSv1 cipher=RC4-SHA bits=128/128);
Thu, 24 Apr 2014 04:54:01 -0700 (PDT)
Received-SPF: fail (google.com: domain of vitali.r@foo.net does not designate 47.175.193.55 as permitted sender) client-ip=47.175.193.55;
Authentication-Results: mx.google.com;
spf=hardfail (google.com: domain of vitali.r@foo.net does not designate 47.175.193.55 as permitted sender) smtp.mail=vitali.r@foo.net;
dkim=pass header.i=@foo.net
Received: from mx.foo.net (mx.foo.net [144.76.75.247])
by bar.ru (Postfix) with ESMTPS id BC4E9BC0031
for <testing@bar.ru>; Thu, 24 Apr 2014 15:54:00 +0400 (MSK)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=foo.net; s=default;
h=Content-Transfer-Encoding:Content-Type:Subject:To:MIME-Version:From:Date:Message-ID; bh=Sr6qzI6M/AdTYgu33PjdinGA745C3GUCsXevUC1TgDI=;
b=DpO1qnFhn+Srhuuj+2bzi4bUOoMOAr4tSRqK/sbz0gt5Ogp+RK9BJQTpix5oPoebo7M7MYIV+zHlzTdJnpPa0FSa4WTewvYxOE81CX/+k/VLQdK1SPcbdPSRACzKsS3Jq7QE9XKK1maW8s0syGbToGT/KNXHkeBKtP6QhIrUs3Y4=;
Envelope-to: testing@bar.ru
Delivery-date: Thu, 24 Apr 2014 13:54:00 +0200
Message-ID: <5358FB52.8040508@foo.net>
Date: Thu, 24 Apr 2014 14:53:54 +0300
From: Vitali R <vitali.r@foo.net>
User-Agent: Mozilla/5.0 (X11; Linux i686; rv:16.0) Gecko/20121028 Thunderbird/16.0.2
MIME-Version: 1.0
To: testing@bar.ru
Subject: hello world this is alias test
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
testest
Image for better understanding:
So the interesting part is this line
Received-SPF: fail (google.com: domain of vitali.r@foo.net does not designate 47.175.193.55 as permitted sender) client-ip=47.175.193.55;
And he will be correct, 11.111.111.11 indeed does not designate to otherdomain.com, as 47.175.193.55 is the IP of server, through which the email was sent (via alias).
So simply speaking, server impersonates itself that email is sent from vitali.r@foo.net, while in reality it was sent from bar.ru and my colleague server rejects a letter because of that.
I understand this may seem confusing but see at this way. You can send a letter to pretty much any server, telling server that you sent it from an email, that you clearly do not has access to. This is pretty much what happens with alias issue here.
How would you react to this kind of issue and do you think that rejecting email is appropriate here?