Jump to content



Photo

Exchange SMTP rejecting mail from ubuntu vm root user

ubuntu exchange smtp

  • Please log in to reply
8 replies to this topic

#1 SirEvan

SirEvan

    Neowinian Senior

  • Joined: 17-April 03
  • Location: Santa Clara, CA
  • OS: Windows 8
  • Phone: HTC One (AT&T)

Posted 15 November 2012 - 18:41

I'm running exchange 2010 at home to learn more about AD and IT setups. I've set up an Ubuntu VM that sits in front of the exchange server, running Postfix/Spamassassin/Pyzor/Razor/DCC/CLAMAV/Mailscanner to weed out spam and viruses. While the setup works great at reducing nearly 100% of all spam, theres an issue with the vm sending messages to myself

Untitled.png

I've set up the receive connector in exchange to only allow access from the VM for SMTP, so that nothing else can directly access exchange. I have no issues receiving email from anywhere on the internet, but if I try to send email from the ubuntu vm (logs, etc), Exchange seems to bounce or reject the message, with the following showing in the logs:

<myemail@mydomain>: host 192.168.0.3[192.168.0.3] said: 501 5.1.7 Invalid address(in reply to MAIL FROM command)


If I look in the root mail account on ubuntu, i see the following:




Final-Recipient: rfc822; <myemail@mydomain.com>
Action: failed
Status: 5.1.7
Remote-MTA: dns; 192.168.0.3
Diagnostic-Code: smtp; 501 5.1.7 Invalid Address
.
.
.
.
To: myemail@mydomain.com
From: root
Subject: Logwatch for ubuntu (Linux)

I already enabled anonymous users to access the receiver connector, so why is exchange rejecting mail from the root user?


#2 sc302

sc302

    Neowinian Senior

  • Tech Issues Solved: 36
  • Joined: 12-July 05
  • Location: NJ, USA

Posted 15 November 2012 - 18:54

can you post some screen shots of your receive connector you setup?

#3 +BudMan

BudMan

    Neowinian Senior

  • Tech Issues Solved: 107
  • Joined: 04-July 02
  • Location: Schaumburg, IL
  • OS: Win7, Vista, 2k3, 2k8, XP, Linux, FreeBSD, OSX, etc. etc.

Posted 15 November 2012 - 20:46

why would exchange accept email from "root" That is not a valid email address, root@something.tld would be valid email address.

To: myemail@mydomain.com
From: root
Subject: Logwatch for ubuntu (Linux)"

#4 OP SirEvan

SirEvan

    Neowinian Senior

  • Joined: 17-April 03
  • Location: Santa Clara, CA
  • OS: Windows 8
  • Phone: HTC One (AT&T)

Posted 15 November 2012 - 22:30

why would exchange accept email from "root" That is not a valid email address, root@something.tld would be valid email address.

To: myemail@mydomain.com
From: root
Subject: Logwatch for ubuntu (Linux)"


that's what ubuntu is sending as. Shouldn't the "anonymous" access allow any sending party to access the SMTP server? I thought about that, since "root" is just a account name, and not a proper address, but I don't know how to change it.

Organization -> Hub Transport -> Send Connectors:
hubtrans1.png
hubtrans2.png
hubtrans3.png
hubtrans4.png

Server Configuration -> Hub Transport -> Receive Connectors:
rcv1.png
rcv2.png
rcv3.png
rcv4.png

#5 +BudMan

BudMan

    Neowinian Senior

  • Tech Issues Solved: 107
  • Joined: 04-July 02
  • Location: Schaumburg, IL
  • OS: Win7, Vista, 2k3, 2k8, XP, Linux, FreeBSD, OSX, etc. etc.

Posted 15 November 2012 - 22:42

quick google for forward root mail to external found this

http://serverfault.c...-external-email

#6 sc302

sc302

    Neowinian Senior

  • Tech Issues Solved: 36
  • Joined: 12-July 05
  • Location: NJ, USA

Posted 16 November 2012 - 13:01

I would agree with budman that the email address "root" is the problem. You would have to change it with the format of root@something.com. Budmans instructions should do that for you. The receive connector should work for you. The send connector is fine. in exchange 2007 they incorporated a block from unauthenticated sources to send mail outside of the domain.

In exchange powershell (there is no gui check box or setting you can make to enable this):
Get-ReceiveConnector "modelxposure.com" | Add-ADPermission -User "NT AUTHORITY\ANONYMOUS LOGON" -ExtendedRights "ms-Exch-SMTP-Accept-Any-Recipient"

#7 duddit2

duddit2

    Neowinian Senior

  • Tech Issues Solved: 1
  • Joined: 24-January 10
  • Location: Manchester UK
  • OS: Windows 8 Pro

Posted 16 November 2012 - 13:16

Looking at the initial diagram, your Linux box is 192.168.0.2, but on the receive connector on exchange you don't have that IP listed. Also for an internal machine to send to exchange direct (i.e. not through outlook so not AD secured) then you have to enable 'externally secured (For example with IPsec)' so that the connection will be permitted, as your box sending an email is acting as a client in this scenario and not a relay server.

See screenshot:

Attached Images

  • Untitled-1.jpg


#8 sc302

sc302

    Neowinian Senior

  • Tech Issues Solved: 36
  • Joined: 12-July 05
  • Location: NJ, USA

Posted 16 November 2012 - 13:31

you don't need to enable externally secured.

#9 duddit2

duddit2

    Neowinian Senior

  • Tech Issues Solved: 1
  • Joined: 24-January 10
  • Location: Manchester UK
  • OS: Windows 8 Pro

Posted 16 November 2012 - 13:38

Sorry ignore me, this is for relaying through the server, doh!

and this being in the rejection message confirms for me the format of the from address is to blame:

<myemail@mydomain>: host 192.168.0.3[192.168.0.3] said: 501 5.1.7 Invalid address(in reply to MAIL FROM command)