* /mail/lib/rewrite and net!$smtp
@ 2019-12-07 0:13 Steven Stallion
2019-12-07 21:10 ` [9fans] " Richard Miller
0 siblings, 1 reply; 4+ messages in thread
From: Steven Stallion @ 2019-12-07 0:13 UTC (permalink / raw)
To: 9fans
All,
I was reviewing my mail setup this evening and I came across an old
kludge to forward mail to a relay host on my network in
/mail/lib/rewrite. I used a host-specific dial string rather than
net!$smtp. For kicks, I reverted back to the classic behavior to try
and sort out why the lookup fails and I'm hitting a brick wall
(again).
I've try adding smtp= entries to the sys, ipnet, and dom entries in
/lib/ndb/local and nothing seems to be taking. I'm testing changes by
issuing an ndb/csquery and I'm always getting the same result:
% ndb/csquery /net/cs 'net!$smtp!smtp'
translating net!$smtp!smtp: cs: can't translate address: dns: name does not exist
I haven't found much other than a thread dating back to 2013 from fgb,
which appears related but doesn't seem to have a solution that works
for me.
Any ideas?
Steve
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [9fans] /mail/lib/rewrite and net!$smtp
2019-12-07 0:13 /mail/lib/rewrite and net!$smtp Steven Stallion
@ 2019-12-07 21:10 ` Richard Miller
2019-12-07 21:46 ` Steven Stallion
0 siblings, 1 reply; 4+ messages in thread
From: Richard Miller @ 2019-12-07 21:10 UTC (permalink / raw)
To: 9fans
> % ndb/csquery /net/cs 'net!$smtp!smtp'
> translating net!$smtp!smtp: cs: can't translate address: dns: name does not exist
Don't give up yet, it works for me:
term% ndb/csquery /net/cs 'net!$smtp!smtp'
/net/tcp/clone 93.93.130.6!25
/net/tcp/clone 93.93.131.52!25
/net/tcp/clone 2a00:1098::86:1000:0:2:1!25
/net/tcp/clone 2a00:1098::82:1000:0:2:1!25
In my /lib/ndb/local I have this:
ipnet=localnet
ip=192.168.0.0 ipmask=255.255.0.0
smtp=mx.mythic-beasts.com
ntp=pool.ntp.org
dnsdomain=hamnavoe.com
MAILSERVER=atom
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [9fans] /mail/lib/rewrite and net!$smtp
2019-12-07 21:10 ` [9fans] " Richard Miller
@ 2019-12-07 21:46 ` Steven Stallion
0 siblings, 0 replies; 4+ messages in thread
From: Steven Stallion @ 2019-12-07 21:46 UTC (permalink / raw)
To: 9fans
> Don't give up yet, it works for me:
>
> term% ndb/csquery /net/cs 'net!$smtp!smtp'
> /net/tcp/clone 93.93.130.6!25
> /net/tcp/clone 93.93.131.52!25
> /net/tcp/clone 2a00:1098::86:1000:0:2:1!25
> /net/tcp/clone 2a00:1098::82:1000:0:2:1!25
>
> In my /lib/ndb/local I have this:
>
> ipnet=localnet
> ip=192.168.0.0 ipmask=255.255.0.0
> smtp=mx.mythic-beasts.com
> ntp=pool.ntp.org
> dnsdomain=hamnavoe.com
> MAILSERVER=atom
Thanks! Unfortunately my MX host only exposes port 587 for relaying
mail outside of the domain. I suppose I could update cs to permit
specifying a port number in ndb for $smtp, but I'm not sure that's any
better than just specifying the relay host directly in rewrite.
Cheers,
Steve
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: /mail/lib/rewrite and net!$smtp
@ 2019-12-07 1:08 Steven Stallion
0 siblings, 0 replies; 4+ messages in thread
From: Steven Stallion @ 2019-12-07 1:08 UTC (permalink / raw)
To: 9fans
> I haven't found much other than a thread dating back to 2013 from fgb,
> which appears related but doesn't seem to have a solution that works
> for me.
Apologies, this was a thread from 2007 though fgb was not the original
poster.
After digging a little more based on one of steve's suggestions in the
thread to run upas/smtp with -d, I think this makes much more sense
now:
% upas/smtp -d 'net!$smtp' stallion foo@bar.com
expanding /net!$smtp
sending /net/dns 'x.x.x.x mx'
dns: dns: name does not exist
mxlookup returns nothing
smtp: cs: can't translate address: dns: name does not exist (net!$smtp)
So it looks like upas will attempt to do an mx lookup for smtp; which
means it's expecting a domain rather than the dial string of an SMTP
server.
After digging into the source a bit, it looks like mkdial in
/sys/src/cmd/upas/smtp/mkdial.c is to blame; it also looks like it's
not possible to specify a port number, which makes sense given that
its relying on an mx lookup.
I suppose in the end the kludge I added was the right solution after
all. Go figure.
Steve
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2019-12-07 21:46 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-12-07 0:13 /mail/lib/rewrite and net!$smtp Steven Stallion
2019-12-07 21:10 ` [9fans] " Richard Miller
2019-12-07 21:46 ` Steven Stallion
2019-12-07 1:08 Steven Stallion
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).