1

I have a mailserver configured(spamassassin+procmail+sendmail+dovecot) I want all spam mails redirected to spam folder I set /etc/procmail

DEFAULT=/var/spool/mail/$LOGNAME/new
ORGMAIL=/var/spool/mail/$LOGNAME
MAILDIR=/var/spool/mail/$LOGNAME

# deliver spam to spam folder
:0:
* ^X-Spam-Status: Yes
.Spam/

And mailbox for dovecot

inbox = yes
  #mailbox name {
    # auto=create will automatically create this mailbox.
    # auto=subscribe will both create and subscribe to the mailbox.
    #auto = no

    # Space separated list of IMAP SPECIAL-USE attributes as specified by
    # RFC 6154: \All \Archive \Drafts \Flagged \Junk \Sent \Trash
    #special_use =
  #}

  # These mailboxes are widely used and could perhaps be created automatically:
  mailbox Drafts {
    special_use = \Drafts
    auto = create
  }
  mailbox Spam {
    special_use = \Junk
    auto = create
  }
  mailbox Trash {
    special_use = \Trash
    auto = create
  }

When i send a spam mail for test,it not create the folder automatically on thunderbird,and i see the folder(exist on system) has root permissions instead of user permission,of course if do chown after another mail sending return to original permissions(root!)

3

Add DROPPRIVS=yes at begin of /etc/procmailrc

man procmailrc :

DROPPRIVS If set to `yes' procmail will drop all privileges it might have had (suid or sgid). This is only useful if you want to guarantee that the bottom half of the /etc/procmailrc file is executed on behalf of the recipient.

  • Perfect solution – elbarna Nov 11 '15 at 0:35
1

Solution found:

mailbox Spam {
    special_use = \Junk
    auto = create
}

became

mailbox Spam {
    special_use = \Junk
    auto = subscribe
}

Now it works

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.