aboutsummaryrefslogtreecommitdiff
path: root/mta_recv.go
diff options
context:
space:
mode:
authorRunxi Yu <me@runxiyu.org>2025-01-02 19:30:51 +0000
committerRunxi Yu <me@runxiyu.org>2025-01-02 19:30:51 +0000
commit00f3cb9fb48cfb9768b695bd0d9eb8367ad84782 (patch)
tree2e35b4252b2538c7dbe13d90b501216ded240149 /mta_recv.go
parentFile splitting (diff)
downloadmaild-00f3cb9fb48cfb9768b695bd0d9eb8367ad84782.tar.gz
maild-00f3cb9fb48cfb9768b695bd0d9eb8367ad84782.tar.zst
maild-00f3cb9fb48cfb9768b695bd0d9eb8367ad84782.zip
Deliver to inbox
Diffstat (limited to '')
-rw-r--r--mta_recv.go10
1 files changed, 7 insertions, 3 deletions
diff --git a/mta_recv.go b/mta_recv.go
index 2b4679a..c77c46d 100644
--- a/mta_recv.go
+++ b/mta_recv.go
@@ -129,10 +129,14 @@ func handle_incoming_server_connection(reader *bufio.Reader, writer *bufio.Write
if err != nil {
return err
}
- deliver_incoming(current_mail_from, current_rcpt_to, current_data)
- server_state = server_state_helo
- _, _ = writer.WriteString("250 2.0.0 Ok: Accepted\r\n")
+ err = deliver_incoming(current_mail_from, current_rcpt_to, current_data)
+ if err == nil {
+ _, _ = writer.WriteString("250 2.0.0 Ok: Accepted\r\n")
+ } else {
+ _, _ = writer.WriteString("500 2.0.0 Funderscore\r\n")
+ }
_ = writer.Flush()
+ server_state = server_state_helo
case "QUIT":
_, _ = writer.WriteString("221 2.0.0 Bye\r\n")
_ = writer.Flush()