[nos-bbs] smtp gateway control

Bob Tenty bobtenty at gmail.com
Wed Dec 7 02:05:16 EST 2011


What we agree on is that it should be nice if an extra option is available 
with the "smtp gateway" command to choose for old or new behaviour.

Everybody happy. 

73,

Bob VE3TOK




On 06/12/2011 7:11 PM, Michael Fox - N6MEF wrote:
> As I said, we have a network of JNOS systems with a gateway for mail to
> others. The gateway uses Postfix. But it doesn’t make sense to send
> everything to a gateway, when JNOS can talk directly to JNOS with a
> single hop.
>
> *From:*nos-bbs-bounces at tapr.org [mailto:nos-bbs-bounces at tapr.org] *On
> Behalf Of *Wm Lewis
> *Sent:* Tuesday, December 06, 2011 2:47 PM
> *To:* nos-bbs at tapr.org
> *Subject:* Re: [nos-bbs] smtp gateway control
>
> Bob:
>
> This is also the way I have my station setup.
>
> My Linux uses POSTFIX as the MTA and all mail "for" and "from" my JNOS
> first gets routed there.
>
> POSTFIX can do a great job of all my filtering needs, plus POSTFIX can
> be configured to work with many other filter sources, such as blacklists.
>
> Plus, outgoing mail from jnos gets dumped into POSTFIX, then POSTFIX
> sends it on using current RFC standards so places like HOTMAIL wont
> reject it based on non-complient RFC's.
>
> But..... I don't believe Michaels (LINUX) box even uses an MTA. I (think
> ??) Michaels jnos only uses jnos as the MTA and nothing else.
>
> I could be wrong about that setup, but Michael will have to clarify that.
>
> Bill
> KG6BAJ
>
>>  Date: Tue, 6 Dec 2011 08:44:57 -0500
>>  From: bobtenty at gmail.com <mailto:bobtenty at gmail.com>
>>  To: nos-bbs at tapr.org <mailto:nos-bbs at tapr.org>
>>  Subject: Re: [nos-bbs] smtp gateway control
>>
>>  Because the smtp server in jnos is not up to the standards anymore.
>>  jnos isn't always talking to another jnos (or tnos) over an amprnet
> connection.
>>  Some people receive all their mail in linux and process it there or
> whatever
>>  mail server they are using.
>>
>>  The behaviour I'm after is the same behaviour if your define a (smart)
> smtp gateway (relay)
>>  in postfix or exim, etc.
>>
>>  Bob VE3TOK
>>
>>
>>
>>  On 06/12/2011 3:37 AM, Michael Fox - N6MEF wrote:
>>  > Why would you "always" want it to use the gateway when it's faster
> and more
>>  > efficient to send directly (when possible)? It puts an extra store and
>>  > forward hop in the path for every message and creates a single point of
>>  > failure.
>>  >
>>  > Regardless, if you still prefer that, then the syntax below would still
>>  > work. The default behavior if a gateway is configured and there are no
>>  > "smtp direct" commands configured should be so send everything to the
>>  > gateway.
>>  >
>>  > M
>>  >
>>  > -----Original Message-----
>>  >
>>  >
>>  > I also don't like the behaviour of jnos with the "smtp gateway x.x.x.x"
>>  > setting.
>>  > (I hate it)
>>  > It should always deliver to the smtp gateway without fuss and at the
> first
>>  > try.
>>  >
>>  >
>>  >
>>  > 73,
>>  >
>>  > Bob VE3TOK
>>  >
>>  >
>>  >
>>  >
>>  >
>>  >
>>  > On 06/12/2011 12:34 AM, Michael Fox - N6MEF wrote:
>>  >> We've configured an e-mail gateway to allow packet users to send to
>>  >> Internet email addresses. But JNOS has no way to control when the
>>  >> gateway is used. We really need a way to control when the smtp gateway
>>  >> is used (and not used).
>>  >>
>>  >> Background:
>>  >>
>>  >> JNOS can talk SMTP just fine with other JNOS systems. But it evidently
>>  >> does not adhere to the current protocol very well which makes it
>>  >> problematic when talking with non-JNOS SMTP mailers. For example, I
>>  >> get this message in the log ever time JNOS connects to a current SMTP
>>  > mailer:
>>  >>
>>  >> Dec 5 20:58:31 cpk postfix/smtpd[10138]: improper command pipelining
>>  >> after HELO from w6xsc-4.ampr.org[44.4.50.4]
>>  >>
>>  >> Another problem with the JNOS SMTP server is a complete lack of
>>  >> security mechanisms, such as checks, filters, etc. which are part of
>>  >> any typical internet mail gateway. This isn't a complaint, just a fact.
>>  >>
>>  >> Scenario:
>>  >>
>>  >> I'd like to allow JNOS to talk directly to any machine in my
>>  >> domain.txt, and any machine with either a 44.x address or an ampr.org
>>  > domain name.
>>  >> Anything else should go to the smtp gateway for handling.
>>  >>
>>  >> Problem:
>>  >>
>>  >> The "smtp gateway" command is described in the manual as:
>>  >>
>>  >> Displays or sets the host to be used as a "smart" mail relay. Any mail
>>  >> sent to a host not in the domain.txt file or not found via a
>>  >> nameserver query, will instead be sent to the gateway for forwarding.
>>  >>
>>  >> The problem with this is that JNOS does a DNS query for any mail
>>  >> destination that is not in domain.txt. We can turn off MX queries
>>  >> (with smtp usemx no) but JNOS still performs an A record query. When
>>  >> it receives the answer, it attempts to connect directly to the remote
>>  > host.
>>  >> With "smtp usemx yes" it will attempt to connect directly to the MX
>>  >> for the remote host. So there's no way to control when JNOS uses the
>>  >> smtp gateway. In fact, as long as DNS is configured, and you're
>>  >> sending to a proper internet email address, JNOS will NEVER use the
>>  >> gateway since it will always get an answer from the nameserver. That's
>>  > just not right.
>>  >>
>>  >> Workaround:
>>  >>
>>  >> I currently have iptables set to disallow SMTP connections on the
>>  >> JNOS-to-Linux tunnel that are from JNOS to anything other than the
>>  >> SMTP gateway. This means that JNOS will try over and over, but will be
>>  >> unsuccessful in contacting the remote host. It will then try to send
>>  >> to the gateway.
>>  >>
>>  >> However, this workaround has a problem. Since it relies on a
>>  >> connection failure, it can end up being used unintentionally, such as
>>  >> when the remote system is another JNOS system. If that remote system
>>  >> is down temporarily, JNOS tries and fails to connect, so it ships it
>>  >> to the gateway. The gateway then tries to deliver it via the internet
>>  >> (out to the internet, back in via the UCSD gateway, etc.) which is not
>>  >> allowed on many JNOS systems.
>>  >>
>>  >> Solution:
>>  >>
>>  >> What we really need is a way to tell JNOS when and when not to use the
>>  >> "smtp gateway". I think the easiest approach would be to define when
>>  >> JNOS should attempt a direct connect and then let the SMTP gateway
>>  >> handle anything else. It seems that the best approach would be to
>>  >> allow either IP address or domain name nomenclature. Here's one
> example:
>>  >>
>>  >> smtp direct local # host is in domain.txt
>>  >>
>>  >> smtp direct address 44.0.0.0/8
>>  >>
>>  >> smtp direct domain ampr.org
>>  >>
>>  >> Instead of "direct", something like "nogateway" could be used.
>>  >>
>>  >> This basically says, if the host is in domain.txt or it has an address
>>  >> of 44.x or it has a domain of ampr.org, then send it direct.
>>  >> Otherwise, use the gateway.
>>  >>
>>  >> Is this doable?
>>  >>
>>  >> Michael
>>  >>
>>  >>
>>




More information about the nos-bbs mailing list