From 2a9ca0577ecdbee8b5a4bc8886c112dbc4260eab Mon Sep 17 00:00:00 2001 From: Claude Date: Tue, 25 Aug 2026 21:23:04 -0500 Subject: new-app: configure jail mail relay and persist the jail's network alias Two provisioning gaps in new-app: - The jail's dma.conf inherited the base image's shared SMARTHOST/ PORT/AUTHPATH, but never got a per-app MAILNAME - without one, dma can misroute mail for recipients on the jail's own apex domain as local delivery. EnableMail appends a MAILNAME of .skiff.local, which can't collide with any real domain an app sends to or from. - A classic jail's ip4.addr is only a bind restriction, not a route, until something aliases it onto a host interface. jail.conf.tmpl never set jail(8)'s own `interface` parameter, so nothing ever created that alias - confirmed on skiff-freebsd, where the address had twice been made to work via an ad hoc `ifconfig alias` that didn't survive a reboot. Setting `interface` lets jail(8) manage the alias itself, including on every boot. --- cmd/skiff/main.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'cmd/skiff/main.go') diff --git a/cmd/skiff/main.go b/cmd/skiff/main.go index 7c9d505..8ca1406 100644 --- a/cmd/skiff/main.go +++ b/cmd/skiff/main.go @@ -84,6 +84,7 @@ func cmdNewApp(args []string) error { healthPath := fs.String("health-path", layout.DefaultHealthPath, "health check path") serverName := fs.String("server-name", "", "nginx server_name (defaults to )") baseSnapshot := fs.String("base-snapshot", "ready", "snapshot on the base dataset to clone from") + iface := fs.String("iface", layout.DefaultJailIface, "host interface the jail's IP is aliased onto") fs.Parse(args) if *name == "" || *ip == "" { @@ -115,9 +116,12 @@ func cmdNewApp(args []string) error { return fmt.Errorf("initialize env file: %w", err) } - if err := jailmgr.WriteConf(cfg, *name, *ip); err != nil { + if err := jailmgr.WriteConf(cfg, *name, *ip, *iface); err != nil { return fmt.Errorf("write jail config: %w", err) } + if err := jailmgr.EnableMail(cfg, *name); err != nil { + return fmt.Errorf("configure mail: %w", err) + } if err := appmeta.Write(cfg.MetaPath(*name), appmeta.Meta{ IP: *ip, -- cgit v1.3