From 8cfca6f25358b2ce75abd2b410e28e5b5008413b Mon Sep 17 00:00:00 2001 From: Sergey Matveev Date: Sun, 15 Jan 2017 10:59:14 +0300 Subject: [PATCH] Check that sendmail is configured for the peer --- THANKS | 1 + src/cypherpunks.ru/nncp/toss.go | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/THANKS b/THANKS index 1f382f9..939764c 100644 --- a/THANKS +++ b/THANKS @@ -2,3 +2,4 @@ There are people deserving to be thanked for helping this project: * Shawn K. Quinn for his descriptive instructions about building NNCP under Ubuntu GNU/Linux distributions + and bug reports diff --git a/src/cypherpunks.ru/nncp/toss.go b/src/cypherpunks.ru/nncp/toss.go index 31bda11..11e8591 100644 --- a/src/cypherpunks.ru/nncp/toss.go +++ b/src/cypherpunks.ru/nncp/toss.go @@ -133,6 +133,11 @@ func (ctx *Ctx) Toss(nodeId *NodeId, nice uint8, dryRun bool) bool { log.Fatalln(err) } sendmail := ctx.Neigh[*job.PktEnc.Sender].Sendmail + if len(sendmail) == 0 { + ctx.LogE("rx", SdsAdd(sds, SDS{"err": "No sendmail configured"}), "") + isBad = true + goto Closing + } if !dryRun { cmd := exec.Command( sendmail[0], -- 2.44.0