]> Cypherpunks.ru repositories - nncp.git/commitdiff
NNCP_SENDER envvar while sendmail calling
authorSergey Matveev <stargrave@stargrave.org>
Sat, 7 Oct 2017 10:00:28 +0000 (13:00 +0300)
committerSergey Matveev <stargrave@stargrave.org>
Sat, 7 Oct 2017 10:01:05 +0000 (13:01 +0300)
VERSION
doc/cfg.texi
doc/news.ru.texi
doc/news.texi
ports/nncp/Makefile
src/cypherpunks.ru/nncp/toss.go

diff --git a/VERSION b/VERSION
index 51176c7c891c45403eab9e0cf753cbab19dc2442..c43e1055fd3f2e00540c298404934e8097459098 100644 (file)
--- a/VERSION
+++ b/VERSION
@@ -1 +1 @@
-0.11
+0.12
index 1a37f10e5678410c3d7523ae311567a62c856e94..0420d3959fec7352b25e7695cd1159fec9d3f12a 100644 (file)
@@ -89,7 +89,9 @@ synchronization protocol}. Contains authentication public key.
 @item sendmail
 An array containing path to executable and its command line arguments
 that is called for mail sending. If it is empty, then no mail processing
-will be performed from that node.
+will be performed from that node. Sendmail command
+@command{["/bin/foo", "bar"]} called the following way:
+@command{NNCP_SENDER=NODEID /bin/foo bar RCPT1 RCPT2 ... < MSG}.
 
 @anchor{CfgIncoming}
 @item incoming
index f738d0e676a8b4ffaff78b7ba6851b0fd49dc441..98804fb87c014fde77431e6174b5445d45d7910d 100644 (file)
@@ -1,6 +1,13 @@
 @node Новости
 @section Новости
 
+@node Релиз 0.12
+@subsection Релиз 0.12
+@itemize
+@item
+Команда sendmail вызывается с @env{NNCP_SENDER} переменной окружения.
+@end itemize
+
 @node Релиз 0.11
 @subsection Релиз 0.11
 @itemize
index 8c3ec1a3b4548eebe9edf8d475d6f1bda74f15bb..8f36b4b590be2b2faa0a1a51b8911be68d189307 100644 (file)
@@ -3,6 +3,13 @@
 
 See also this page @ref{Новости, on russian}.
 
+@node Release 0.12
+@section Release 0.12
+@itemize
+@item
+Sendmail command is called with @env{NNCP_SENDER} environment variable.
+@end itemize
+
 @node Release 0.11
 @section Release 0.11
 @itemize
index 25bff5dbe33b170244b1c5981f97b9a1cafffd6a..22b33138499952702da92323258ec637a56e8ef8 100644 (file)
@@ -1,7 +1,7 @@
 # $FreeBSD$
 
 PORTNAME=      nncp
-PORTVERSION=   0.11
+PORTVERSION=   0.12
 CATEGORIES=    net
 MASTER_SITES=  http://www.nncpgo.org/download/
 
index 2fb4cbb034b47b1c549f92bfda036e6433182a8c..962b240152626e4f9299cb4a9584e47b2797677d 100644 (file)
@@ -98,7 +98,8 @@ func (ctx *Ctx) Toss(nodeId *NodeId, nice uint8, dryRun bool) bool {
                        if err != nil {
                                log.Fatalln(err)
                        }
-                       sendmail := ctx.Neigh[*job.PktEnc.Sender].Sendmail
+                       sender := ctx.Neigh[*job.PktEnc.Sender]
+                       sendmail := sender.Sendmail
                        if len(sendmail) == 0 {
                                ctx.LogE("rx", SdsAdd(sds, SDS{"err": "No sendmail configured"}), "")
                                isBad = true
@@ -112,6 +113,7 @@ func (ctx *Ctx) Toss(nodeId *NodeId, nice uint8, dryRun bool) bool {
                                                strings.Split(recipients, " ")...,
                                        )...,
                                )
+                               cmd.Env = append(cmd.Env, "NNCP_SENDER=" + sender.Id.String())
                                cmd.Stdin = decompressor
                                if err = cmd.Run(); err != nil {
                                        ctx.LogE("rx", SdsAdd(sds, SDS{"err": err}), "sendmail")