This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Can't get authenticated relay to work

Setup:

Two email domains, using profile mode.  Each domain has a seperate external IP.
Exchange domain has all clients internal, so no external relaying is needed, works fine.  SMTP proxy is on.

The MDaemon domain, however, has all external clients.  I want the Astaro SMTP proxy to be used for antivirus/antispam.  So if I turn it on I need authenticated relay so the external clients can send out.

However, I've been completely unable to get authenticated relay to work.  If I understand, all I should have to do is:

1.  Create user accounts with local authentication (obviously these should match the MDaemon account information, but shouldn't be needed).
2.  Add those user accounts to the "authenticated relay" option in the SMTP options, and make sure the checkbox is checked.
2.  Setup the email client (in this case Outlook) with the user/pass that matches the account created on the Astaro.
3.  Turn on the SMTP proxy for the desired domain.

Every time I try this however, any attempt to send out email comes back with a "relaying denied" error.  I've tried this for both the exchange and the MDaemon domains - neither seems to work.

Are there any additional steps I am missing?  Are there any recommended troubleshooting tips?   I need to have the Astaro antispam/antivirus running on both domains.


This thread was automatically locked due to age.
  • Jtv, I don't think you want to use Astaro authenticated relay for this, but we already discussed that last month: https://community.sophos.com/products/unified-threat-management/astaroorg/f/56/t/48927.

    If you find a better solution than the "classic" DNAT approach used with Outlook and Exchange, please document it here.

    Cheers - Bob
     
    Sophos UTM Community Moderator
    Sophos Certified Architect - UTM
    Sophos Certified Engineer - XG
    Gold Solution Partner since 2005
    MediaSoft, Inc. USA
  • Jtv, I don't think you want to use Astaro authenticated relay for this, but we already discussed that last month: http://www.astaro.org/astaro-gateway-products/mail-security-smtp-pop3-antispam-antivirus/32813-relaying-authentication-qs.html.

    If you find a better solution than the "classic" DNAT approach used with Outlook and Exchange, please document it here.

    Cheers - Bob


    Exchange isn't really involved in this.   And yes, we discussed this last month, but, with all due respect, we seemed to be talking past each other.  Your suggested solution was exactly what I was already doing, and that configuration skips the smtp proxy (maybe it shouldn't, but it does).  I would love help, if you can answer these questions:

    1.  For my MDaemon server (which is not exchange based), is there anyway to get the Astaro to scan emails coming in from outside our network and allow outside clients to authenticate?  DNATing automatically skips the proxy, and by doing so that means it does not do antivirus/antispam scanning, correct?

    2.  Is there any reason I wouldn't want to allow authenticated relay?

    3.  Based on my description in the first email, why wouldn't authenticated relay work?
  • No disrespect taken, and I hope you feel the same way.  I still think this is easier than you suspect...

    1.a. If the MDaemon server is capable of receiving SMTP emails, then create an SMTP Profile for the domain(s) on it, and configure the Profile just as you would with an Exchange server.  That is, 'Static host' in the 'Routing' section and add the MDaemon server to 'Host-based relay' on the 'Relaying' tab of 'SMTP'.  Again, 'Transparent mode' must not be enabled, and the MDaemon server must be configured to use the IP of "Internal (Address)" as a smart host.

    1.b. The emails sent by outside clients will be scanned when they are relayed from MDaemon by the Astaro; they shouldn't be scanned on the way in.  In order to do this, a DNAT is needed.  I bet MDaemon can be configured to have clients connect on "SMTP SSL" (port 465); in which case, your DNAT would look like: 'Any -> SMTP SSL -> External (Address) : DNAT to {MDaemon server IP}'.  If the clients are using Outlook, they simply configure to send on port 465, probably selecting SSL (MDaemon docs should supply the details).

    2. As you are experiencing, it's really difficult to allow authenticated relay for external clients - in essence, you have to create and manage individual accounts on the Astaro that duplicate accounts already managed on the Daemon server.  In fact, the emails sent by an authenticated user would never go through your MDaemon server - or is that what you want?

    Once you understand what the Astaro is doing, I think you'll be amazed that you were trying to make this so complicated.  Then again, maybe there's something unique about MDaemon that I don't suspect!

    Cheers - Bob
     
    Sophos UTM Community Moderator
    Sophos Certified Architect - UTM
    Sophos Certified Engineer - XG
    Gold Solution Partner since 2005
    MediaSoft, Inc. USA
  • No disrespect taken, and I hope you feel the same way.  I still think this is easier than you suspect...

    1.a. If the MDaemon server is capable of receiving SMTP emails, then create an SMTP Profile for the domain(s) on it, and configure the Profile just as you would with an Exchange server.  That is, 'Static host' in the 'Routing' section and add the MDaemon server to 'Host-based relay' on the 'Relaying' tab of 'SMTP'.  Again, 'Transparent mode' must not be enabled, and the MDaemon server must be configured to use the IP of "Internal (Address)" as a smart host.

    1.b. The emails sent by outside clients will be scanned when they are relayed from MDaemon by the Astaro; they shouldn't be scanned on the way in.  In order to do this, a DNAT is needed.  I bet MDaemon can be configured to have clients connect on "SMTP SSL" (port 465); in which case, your DNAT would look like: 'Any -> SMTP SSL -> External (Address) : DNAT to {MDaemon server IP}'.  If the clients are using Outlook, they simply configure to send on port 465, probably selecting SSL (MDaemon docs should supply the details).

    2. As you are experiencing, it's really difficult to allow authenticated relay for external clients - in essence, you have to create and manage individual accounts on the Astaro that duplicate accounts already managed on the Daemon server.  In fact, the emails sent by an authenticated user would never go through your MDaemon server - or is that what you want?

    Once you understand what the Astaro is doing, I think you'll be amazed that you were trying to make this so complicated.  Then again, maybe there's something unique about MDaemon that I don't suspect!

    Cheers - Bob


    For #1, that's already done.  Messages being sent out from MDaemon are being scanned.  Which is a good start.

    1b.  Is SSL required to have the Astaro scan?  Because there is DNAT configured, but not SSL:

    Any -> SMTP -> External address (which is a unique, seperate IP for MDaemon)[:D]NAT to Internal Address of mail server.  

    My understanding (and from what I'm seeing from the lack of logs) is that this is bypassing the Astaro completely for incoming mails.  Users are still getting loads of spam which the Astaro isn't catching.  This is where I've been stuck.

    2.  I do know it's a real hassle to have to create duplicate accounts, but I was willing to do it to fix the lack of incoming smtp scanning.  But I can't even get a successful authenticated relay.  Which was why I was posting.

    Thinking about it, I'd even be happy to just get the POP proxy enabled, as it would accomplish much the same function (ie weeding out spam/threats as the user collected their mail), but even that doesn't seem to work - the clients time out when trying to connect when I enable it.
  • Any -> SMTP -> External address (which is a unique, seperate IP for MDaemon) : NAT to Internal Address of mail server.

    My understanding (and from what I'm seeing from the lack of logs) is that this is bypassing the Astaro completely for incoming mails. Users are still getting loads of spam which the Astaro isn't catching. This is where I've been stuck.

    Exactly.  Unlike MDaemon and Exchange, Astaro can't differentiate between a client and a server - that's why the DNAT for the client connections must come in either on a different public IP or via a different port.  The easiest thing for you to do now is to just change the FQDN in the MX record for the MDaemon domain(s) to point to the primary IP on the External interface - in a few hours, all of the inbound emails will go through the Astaro proxy.

    The POP3 proxy wouldn't help you.  It is a client proxy and works only with servers reachable on the interface with the default gateway - your External interface.

    Cheers - Bob
     
    Sophos UTM Community Moderator
    Sophos Certified Architect - UTM
    Sophos Certified Engineer - XG
    Gold Solution Partner since 2005
    MediaSoft, Inc. USA
  • Exactly.  Unlike MDaemon and Exchange, Astaro can't differentiate between a client and a server - that's why the DNAT for the client connections must come in either on a different public IP or via a different port.  The easiest thing for you to do now is to just change the FQDN in the MX record for the MDaemon domain(s) to point to the primary IP on the External interface - in a few hours, all of the inbound emails will go through the Astaro proxy.

    The POP3 proxy wouldn't help you.  It is a client proxy and works only with servers reachable on the interface with the default gateway - your External interface.

    Cheers - Bob


    So you're basically saying have ALL mail come in to the same external IP (ie for both the Exchange and MDaemon), and just have the Astaro route via static host lists?  That makes sense, but I'll have to check our internal config to make sure that changing the DNS entries won't gum anything up.  

    I guess what was confusing me is on the one hand you confirmed that DNAT-ing skips the proxy, but then one of your recommended solution was to create a DNAT on a different port - which seems like it would still skip the proxy.  Why would setting a DNAT on SMTP SSL trigger the Astaro to scan?
  • Yes, all the servers wanting to send emails to either of your servers connect to the same external IP where the traffic is handled by the SMTP Proxy using a separate profile for the MDaemon server.

    Why would setting a DNAT on SMTP SSL trigger the Astaro to scan?

    It doesn't; the DNAT just captures port 465 instead of port 25 (SMPT) so the port-25 traffic can reach the Proxy.

    The trick is to create a separate path for your clients to connect to the MDaemon server, and that is with a DNAT of traffic on either a different port or a different IP address (or both).

    The clients probably already have their Outlook configured with something like mail.MDaemonDomain.com in 'Outgoing mail server (SMTP)', and that probably points to an 'Additional Address' on the External interface.  You probably already have a DNAT for the clients to connect to the MDaemon server.

    My suggestion is to leave them like that, and just change the MX record for MDaemonDomain.com.  If your MX record for your Exchange domain is mail.ExchangeDomain.com, then I think you can just use mail.ExchangeDomain.com in the MX record for MDaemonDomain.com.

    If you don't have one already, you'll need for your ISP to create an RDNS ptr record that ties your external IP to MDaemonDomain.com just like it already does for your ExchangeDomain.com.

    Again, this will seem simple when you have it done. [;)]

    Cheers - Bob
     
    Sophos UTM Community Moderator
    Sophos Certified Architect - UTM
    Sophos Certified Engineer - XG
    Gold Solution Partner since 2005
    MediaSoft, Inc. USA