mirror of
https://github.com/foxcpp/maddy.git
synced 2025-04-06 06:27:38 +03:00
storage/imapsql: Fix nil pointer reference when no IMAP filters are set
This commit is contained in:
parent
2344c9f87f
commit
1da80d9ac5
2 changed files with 6 additions and 2 deletions
|
@ -145,11 +145,12 @@ func (d *delivery) AddRcpt(ctx context.Context, rcptTo string) error {
|
|||
func (d *delivery) Body(ctx context.Context, header textproto.Header, body buffer.Buffer) error {
|
||||
defer trace.StartRegion(ctx, "sql/Body").End()
|
||||
|
||||
if !d.msgMeta.Quarantine {
|
||||
if !d.msgMeta.Quarantine && d.store.filters != nil {
|
||||
for rcpt := range d.addedRcpts {
|
||||
folder, flags, err := d.store.filters.IMAPFilter(rcpt, d.msgMeta, header, body)
|
||||
if err != nil {
|
||||
return err
|
||||
d.store.Log.Error("IMAPFilter failed", err, "rcpt", rcpt)
|
||||
continue
|
||||
}
|
||||
d.d.UserMailbox(rcpt, folder, flags)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue