mirror of
https://github.com/Luzifer/automail.git
synced 2024-12-20 13:01:20 +00:00
Add debugging for script commands
Signed-off-by: Knut Ahlers <knut@ahlers.me>
This commit is contained in:
parent
ccc77f980e
commit
e2b309056f
1 changed files with 6 additions and 0 deletions
|
@ -49,6 +49,7 @@ func (m mailHandler) Process(imapClient *client.Client, msg *imap.Message, envel
|
|||
scanner := bufio.NewScanner(stdout)
|
||||
for scanner.Scan() {
|
||||
if scanner.Err() != nil {
|
||||
log.WithError(err).Error("Stdout errored")
|
||||
return
|
||||
}
|
||||
|
||||
|
@ -58,6 +59,11 @@ func (m mailHandler) Process(imapClient *client.Client, msg *imap.Message, envel
|
|||
continue
|
||||
}
|
||||
|
||||
log.WithFields(log.Fields{
|
||||
"type": cw.Type,
|
||||
"uid": msg.Uid,
|
||||
}).Debug("Received command from script")
|
||||
|
||||
c, err := cw.rewrap(scanner.Bytes())
|
||||
if err != nil {
|
||||
log.WithError(err).Error("Unable to parse command")
|
||||
|
|
Loading…
Reference in a new issue