use postmoogle as general purpose SMTP server and allow other apps or scripts to send emails through it
This commit is contained in:
@@ -73,6 +73,12 @@ func (b *Bot) initCommands() commandList {
|
||||
sanitizer: func(s string) string { return s },
|
||||
allowed: b.allowOwner,
|
||||
},
|
||||
{
|
||||
key: roomOptionPassword,
|
||||
description: "Get or set SMTP password of the room's mailbox",
|
||||
sanitizer: func(s string) string { return strings.TrimSpace(s) },
|
||||
allowed: b.allowOwner,
|
||||
},
|
||||
{allowed: b.allowOwner}, // delimiter
|
||||
{
|
||||
key: roomOptionNoSend,
|
||||
@@ -293,6 +299,11 @@ func (b *Bot) runSend(ctx context.Context) {
|
||||
return
|
||||
}
|
||||
|
||||
if !utils.AddressValid(to) {
|
||||
b.Error(ctx, evt.RoomID, "email address is not valid")
|
||||
return
|
||||
}
|
||||
|
||||
cfg, err := b.getRoomSettings(evt.RoomID)
|
||||
if err != nil {
|
||||
b.Error(ctx, evt.RoomID, "failed to retrieve room settings: %v", err)
|
||||
|
||||
Reference in New Issue
Block a user