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

SMTP relay not allowing anything in

First of all the error:

554 554 5.7.1 : Relay access denied (state 14).

The above is the error I get when trying to send externally to an internal address. (for example from gmail to a company address)

I've configured all the domains we use as well as set a static host list and pointed it to our exchange server at 192.168.0.1.

Is there any setting that might cause this to occur?

I had this occur on me whilst doing a live test today (end of day when everyone has gone home, plugged in the astaro 220 got everything working but incoming email.. obviously moved it back to the old firewall)

I'll do some further tests at work tomorrow (obviously), but any suggestions on where I might be going wrong are more than welcome.


This thread was automatically locked due to age.
Parents

  • 554 554 5.7.1 : Relay access denied (state 14).


    ASG does not produce such messages. Are you sure all the incoming mail arrives on the ASG?

    What is the real domain used? Please do not obsfucate.
  • Mark, I'm confused: does email get rejected with a "554 5.7.1" message, or does it come "straight though"?

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

    Check that your reverse DNS record is correct.  As an experiment, what happes if you uncheck BATV?

    And, I still don't understand how you received an email from your gmail account if email from gmail is rejected...

    Cheers - Bob
     
    Sophos UTM Community Moderator
    Sophos Certified Architect - UTM
    Sophos Certified Engineer - XG
    Gold Solution Partner since 2005
    MediaSoft, Inc. USA
  • Looks like you have 3 entries for mx records. From the IP provided in your mail headers, the denying mta is at 194.217.242.9 (your second mx relay-1.mail.demon.net). This is the relay that is denying your mail not astaro.

    All your mail should be going to the first mx but its not so your astaro is not live on the net for some reason if that is your first mx.

    HTH[:D]
  • Mark,

    Check that your reverse DNS record is correct.  As an experiment, what happes if you uncheck BATV?

    And, I still don't understand how you received an email from your gmail account if email from gmail is rejected...

    Cheers - Bob


    I didn't receive any email from gmail, just the 554 gmail generated error.

    Apologies as I'm typing this up on my iPhone, so sorry for the short reply.

    As to other mx's if it was being rejected a that point then surely it wouldn't work with our current firewall?

    Also, I've had the thought that incoming emails come to 62.49.116.52 whilst the firewalls ip is 62.49.116.50, however we've got a netmask of 255.255.255.248 so it shouldn't matter. Right?
  • Billybob's got it right.  Your Astaro isn't receiving emails.  It's only telling the world that x.x.x.50 is available, so your emails are going to your second mx.

    Cheers - Bob
     
    Sophos UTM Community Moderator
    Sophos Certified Architect - UTM
    Sophos Certified Engineer - XG
    Gold Solution Partner since 2005
    MediaSoft, Inc. USA
  • I
    As to other mx's if it was being rejected a that point then surely it wouldn't work with our current firewall?
    255.255.255.248 so it shouldn't matter. Right?


    Its not as to other, IT IS your mx2 that is rejecting the mail according to the snippet you sent. You can bang your head against other things but that is the one that rejected the email that you provided. Maybe a configuration check on mx2 is in order?
  • Regarding the mx stuff, I've just gone over the domains and have added the demon and netbenefit mx addresses. I will come in to work early tomorrow morning and try again.

    I can only do these tests on our line when nobody is in.
  • Its not as to other, IT IS your mx2 that is rejecting the mail according to the snippet you sent. You can bang your head against other things but that is the one that rejected the email that you provided. Maybe a configuration check on mx2 is in order?


    Our second mx record is: 100 relay-1.mail.demon.net 194.217.242.207

    Immediately after our main: 10 mailgate.jadeprint.com 62.49.116.50

    The only thing I'm thinking of now is perhaps it timed out trying to connect to the primary mx, sent it to the secondary and because the secondary mx record address wasn't in astaro's relaying settings it was rejected?

    Looking at what I posted closer I think that occurred, even though the priority is higher for ours (62.49.116.50) it got delivered to demons mx at 194.217.242.9 which tried to deliver the mail, but because that address wasn't in astaro it got rejected.

    The culprit: "Remote-MTA: dns; [194.217.242.9]"


    Thanks for the help, I'd totally forgotten to take into account mx records. Hopefully when I try it tomorrow morning it should work.

    EDIT: The third mx record is 100 relay-2.mail.demon.net 194.217.242.9 (just adding this for posterity)
  • The IP of the MX should be available on the external interface of your firewall.
    Having an IP + netmask that covers that range won't help you. 

    You need to setup the MX IP as an additional IP address on the external interface.

    Try telnetting to the MX record IP on port 25 and see if you get an SMTP answer.
  • The IP of the MX should be available on the external interface of your firewall.
    Having an IP + netmask that covers that range won't help you. 

    You need to setup the MX IP as an additional IP address on the external interface.

    Try telnetting to the MX record IP on port 25 and see if you get an SMTP answer.


    Ah, I think I should elaborate. The firewalls external interface is 62.49.116.50/29. So since it's already running on 62.49.116.50 I shouldn't need to add an additional address correct?

    Curiously I did telnet into port 25 and here's the output:

    =~=~=~=~=~=~=~=~=~=~=~= PuTTY log 2008.10.15 16:41:55 =~=~=~=~=~=~=~=~=~=~=~=
    
    HELO test.com
    554 SMTP synchronization error


    There was a massive pause regardless of what I type and then the error.

    However, it might be giving that error because it wasn't connected to the real network with the actual email server on. Therefore it's trying to make a connection with the email server and cannot hence "SMTP synchronization error".

    This was done from a machine directly connected up to the firewall and telnet'd into it (to 62.49.116.50 from 192.168.0.2) from that on the lan port.

    When I connect the 220 to the network tomorrow i'll try the above test from my home machine and from the lan, see if it gives me anything different.
  • Looks like the primary mx is answering but its still not astaro

    Here are the telnet headers
    [billybob@Xena var]$ telnet  mailgate.jadeprint.com 25
    Trying 62.49.116.50...
    Connected to mailgate.jadeprint.com (62.49.116.50).
    Escape character is '^]'.
    220 SMTP ready.
    helo me
    250 OK
    mail from: me@jadeprint.com
    250 OK
    rcpt to: postmaster@jadeprint.com
    250 OK
    data
    354 Enter mail, end with "." on a line by itself
Reply
  • Looks like the primary mx is answering but its still not astaro

    Here are the telnet headers
    [billybob@Xena var]$ telnet  mailgate.jadeprint.com 25
    Trying 62.49.116.50...
    Connected to mailgate.jadeprint.com (62.49.116.50).
    Escape character is '^]'.
    220 SMTP ready.
    helo me
    250 OK
    mail from: me@jadeprint.com
    250 OK
    rcpt to: postmaster@jadeprint.com
    250 OK
    data
    354 Enter mail, end with "." on a line by itself
Children
  • Looks like the primary mx is answering but its still not astaro

    Here are the telnet headers
    [billybob@Xena var]$ telnet  mailgate.jadeprint.com 25
    Trying 62.49.116.50...
    Connected to mailgate.jadeprint.com (62.49.116.50).
    Escape character is '^]'.
    220 SMTP ready.
    helo me
    250 OK
    mail from: me@jadeprint.com
    250 OK
    rcpt to: postmaster@jadeprint.com
    250 OK
    data
    354 Enter mail, end with "." on a line by itself


    Um, yes. As I said I haven't connected up the astaro. The old firewall is still up and running. The astaro will be put in for roughly an hour early tomorrow morning as a test.

    So that's roughly 13 to 15 hours away.
  • There may be some capability that I ignore, but I don't believe the Astaro will work correctly if the IP is configured as '62.49.116.50/29'.  Others will please correct me if I'm wrong, but I believe you have to configure the interface as 62.49.116.50, then add 62.49.116.51-57 (each individually!) as 'Additional Addresses' on the External inteface.

    If you want to treat the 62.49.116.50/29 block as a single entity for packet filter rules or someother, you can create a 'Network Group' in 'Definitions >> Networks'.

    Markcasey, you sound knowledgeable, but I wonder if you aren't thinking in a Cisco command-line paradigm.

    Cheers - Bob
     
    Sophos UTM Community Moderator
    Sophos Certified Architect - UTM
    Sophos Certified Engineer - XG
    Gold Solution Partner since 2005
    MediaSoft, Inc. USA
  • It seemed to work fine, although when I connected in on telnet to port 25 from the lan to the firewall it got dropped out with "554 SMTP synchronization error" immediately. (I forgot to try and connect in remotely on telnet from my home machine)

    So I'm provisionally saying emails now work. (I only had it connected up for a short period before I had to quickly reconnect the current firewall, but some emails seemed to have come through ok)

    I've now got a fairly comprehensive configuration going, need to work on L2TP VPN for the iPhones next...
  • Hmm, I just had a more comprehensive test.

    Some emails worked, others however hit the relaying denied wall and weren't mentioned in the logs anywhere. Which is highly worrying.

    A company that tried sending emails to us were bounced back to themselves with a relay error message. (I've asked that these be forwarded to me)

    The firewall is currently on 7.302, does 7.303 fix this issue? I noticed in another post it makes a mention of the SMTP relay and 7.303?

    EDIT:

    Same error as before:

    "554 5.7.1 : Relay access denied" (obviously changed the email address to avoid spam harvesters)
  • Guys, i've just been examining the SMTP proxy log file and it gave this after just about everything:

    2008:10:16-08:52:42 (none) exim[6245]: [1\32] 2008-10-16 08:52:42 1KqNex-0001cj-2h H=service8.mimecast.com [123.123.123.123]:59341 F= temporarily rejected after DATA: Temporary local problem, please try again!

    Of special mention: temporarily rejected after DATA: Temporary local problem, please try again!. It's rejecting the mail as soon as it goes to DATA.

    I've compressed a few samples from the actual log itself from a user who complained about the 554 errors.

    See here.

    Are there any ideas from the Astaro folks why this might be happening?
  • Reading up this appears that it might be an issue with exim and clamav?

    Was this fixed in 7.303? (I'll be testing the firewall with 7.303 tomorrow morning)

    I'll also make sure to disable the anti-spam/virus features anyway since we use a package on the email server itself for that kind of thing. Hopefully it'll work fine then.
  • @markcasey: as long as you have non-working MX records specified in DNS, mail to your domain may sporadically fail no matter what you do on the ASG, because it arrives on machines that will REJECT all messages to jadeprint.com. 

    whizbang ~ # host -t mx jadeprint.com
    jadeprint.com mail is handled by 100 relay-1.mail.demon.net.
    jadeprint.com mail is handled by 100 relay-2.mail.demon.net.
    jadeprint.com mail is handled by 10 mailgate.jadeprint.com.

    If you do not know how to do this, please ask your ISP or domain service provider to REMOVE the relay-1.mail.demon.net and relay-2.mail.demon.net from your DNS configuration.

    NB: The "temporary" rejects in the ASG logs are related to greylisting (which is a feature). You can turn it off.
  • Mark, our policy for our clients is that they should use layers of anti-virus at the perimeter, at the server and on each workstation.  We prefer to have at least two different suppliers for those three layers.

    One of our clients receives about 50,000 emails a day.  95-97% of these are spam rejected before they enter their network.  Early in the SMTP transaction, before the email is accepted, 40% of the items are rejected by RBL and 40% by RDNS/HELO.  That means that 80% of spam is rejected with very little load on the Astaro.

    An additional 10% of the total is blackholed at SMTP time because the Content Filter has recognized it as 'Confirmed Spam'.  You probably already have things configured for your server-based anti-spam product, so it's probably easier for you to just leave the 'Spam action' set to 'Off' in the 'Spam filter' section of the 'Anti-Spam' tab.

    Cheers - Bob
     
    Sophos UTM Community Moderator
    Sophos Certified Architect - UTM
    Sophos Certified Engineer - XG
    Gold Solution Partner since 2005
    MediaSoft, Inc. USA
  • Mark, our policy for our clients is that they should use layers of anti-virus at the perimeter, at the server and on each workstation.  We prefer to have at least two different suppliers for those three layers.

    One of our clients receives about 50,000 emails a day.  95-97% of these are spam rejected before they enter their network.  Early in the SMTP transaction, before the email is accepted, 40% of the items are rejected by RBL and 40% by RDNS/HELO.  That means that 80% of spam is rejected with very little load on the Astaro.

    An additional 10% of the total is blackholed at SMTP time because the Content Filter has recognized it as 'Confirmed Spam'.  You probably already have things configured for your server-based anti-spam product, so it's probably easier for you to just leave the 'Spam action' set to 'Off' in the 'Spam filter' section of the 'Anti-Spam' tab.

    Cheers - Bob


    Disabling the anti-spam/virus on the firewall did the trick. The user didn't get the 554 error.

    Also, we use three anti-virus engines here. Two on the server side scanning engine and the third on the workstation clients, if any viruses get past the first two then the third picks it up.

    And frankly I've got it set-up to quarantine any emails with certain attachments anyway, for example exe, passworded zip files etc.

    We also use RBL's, Bayesian filtering etc too. (GFI MailEssentials)

    All I need to do now is get the firewall correctly allowing traffic to the web server and remote terminal services access to the servers for myself. Which is something for tomorrow morning.
  • The "554 5.7.1" rejects occurred at SMTP time, probably because the sender doesn't have their own DNS records configured correctly.  The Astaro was right to catch this.  I'm going to guess that you had already excepted email from TL Risk Solutions from RDNS checks in MailEssentials.

    However, it does make good sense that the quickest way to get started is turning off everything on the 'Anti-Spam' tab.  You could leave the Anti-Virus on.  You might also want to take advantage of advanced features like encryption.

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