README | 2 ++
src/uploader/main.go | 49 ++++++++++++++++++++++++++++++++++++++++++++++++-
diff --git a/README b/README
index 5d674a948daaca55439908757fb05ecb3b281f88..9f5cf193ca53f493d53b0d5bfdeec9a9c8687a96 100644
--- a/README
+++ b/README
@@ -11,3 +11,5 @@
You can verify integrity locally:
b2sum -a blake2b somedata.tar.gpg
+
+You can enable mail notification with -notify-to and -notify-from options.
diff --git a/src/uploader/main.go b/src/uploader/main.go
index a1465cd663bfbe5b75807e2d06c1e697d5cdce48..788c2cafc7a43df9a907266ab2499fb36a951863 100644
--- a/src/uploader/main.go
+++ b/src/uploader/main.go
@@ -7,15 +7,20 @@ package main
import (
"bufio"
+ "encoding/base64"
"encoding/hex"
"flag"
"fmt"
"html/template"
"io"
+ "io/ioutil"
"log"
+ "mime"
"net"
"net/http"
"os"
+ "os/exec"
+ "strings"
"time"
"golang.org/x/crypto/blake2b"
@@ -26,6 +31,8 @@ const (
WriteBufSize = 1 << 20
FileFieldName = "fileupload"
CommentFieldName = "comment"
+
+ SendmailCmd = "/usr/sbin/sendmail"
)
var (
@@ -37,8 +44,41 @@