aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--config.go5
-rw-r--r--errors.go4
-rw-r--r--incoming.go5
-rw-r--r--main.go5
4 files changed, 9 insertions, 10 deletions
diff --git a/config.go b/config.go
index c4b5579..f965c24 100644
--- a/config.go
+++ b/config.go
@@ -2,14 +2,15 @@ package main
import (
"bufio"
- "go.lindenii.runxiyu.org/lindenii-common/scfg"
"os"
"sync"
+
+ "go.lindenii.runxiyu.org/lindenii-common/scfg"
)
var config struct {
Server_name string `scfg:"server_name"`
- Inbox_path string `scfg:"inbox_path"`
+ Inbox_path string `scfg:"inbox_path"`
}
var config_mutex sync.RWMutex
diff --git a/errors.go b/errors.go
index 0d6a8d7..247e507 100644
--- a/errors.go
+++ b/errors.go
@@ -4,6 +4,4 @@ import (
"errors"
)
-var (
- err_deliver_write = errors.New("unable to write to filesystem while attempting to deliver message")
-)
+var err_deliver_write = errors.New("unable to write to filesystem while attempting to deliver message")
diff --git a/incoming.go b/incoming.go
index 169bde5..e264262 100644
--- a/incoming.go
+++ b/incoming.go
@@ -1,10 +1,11 @@
package main
import (
- "go.lindenii.runxiyu.org/lindenii-common/clog"
"os"
"path"
"time"
+
+ "go.lindenii.runxiyu.org/lindenii-common/clog"
)
func deliver_incoming(envelope_from string, envelope_recipients []string, data []byte) error {
@@ -15,7 +16,7 @@ func deliver_incoming(envelope_from string, envelope_recipients []string, data [
"data", string(data),
)
t := time.Now()
- fd, err := os.OpenFile(path.Join(config.Inbox_path, envelope_from+" "+t.Format(time.RFC3339Nano)+".eml"), os.O_CREATE|os.O_EXCL|os.O_WRONLY, 0660) // TODO: vulnerability
+ fd, err := os.OpenFile(path.Join(config.Inbox_path, envelope_from+" "+t.Format(time.RFC3339Nano)+".eml"), os.O_CREATE|os.O_EXCL|os.O_WRONLY, 0o660) // TODO: vulnerability
if err != nil {
// TODO: handle fs.ErrExist
return err_deliver_write
diff --git a/main.go b/main.go
index 052deec..94f195e 100644
--- a/main.go
+++ b/main.go
@@ -2,10 +2,10 @@ package main
import (
"bufio"
- "net"
- "flag"
"errors"
+ "flag"
"io"
+ "net"
"go.lindenii.runxiyu.org/lindenii-common/clog"
)
@@ -38,5 +38,4 @@ func main() {
}
}()
}
-
}