1

I use a maildrop script to sort my mails directly on the mail server into folders and I would like it to mark certain unnecessary mails as read.

Unfortunately maildrop does not seem to have a command for that.

Right now I use this line to rename the newest mail of the qmail Maildir folder to a 2,s read status:

 `ls -t "$MAILDIR/.0 Spamfilter.catchall/new" | head -1 | xargs -I {} mv "$MAILDIR/.0 Spamfilter.catchall/new/{}" "$MAILDIR/.0 Spamfilter.catchall/cur/{}:2,S"`

However, this sometimes fails and the mail remains unread. I guess there is a race condition, when another mails arrives, before the mv has been executed.

4
  • Have you tried to set FLAGS variable in maildropfilter? courier-mta.org/maildrop/maildropfilter.html
    – AnFi
    Sep 30, 2017 at 6:54
  • no, i did not rtfm, just followed a tutorial
    – BeniBela
    Sep 30, 2017 at 11:08
  • Now I tried FLAGS="S" before to, but it does not seem to do anything
    – BeniBela
    Sep 30, 2017 at 14:17
  • 1
    Omg, on the server they have maildrop 2.5.5. FLAGS was added in maildrop 2.8.4
    – BeniBela
    Sep 30, 2017 at 18:55

1 Answer 1

0

This before the to does the thing:

  FLAGS="S"

However, the tricky part is to install >=2.8.4 on shared hosting without root rights. I did it like this: Download "courier-unicode-2.0.tar.bz2" and "maildrop-2.9.2.tar.bz2" from courier-mta.org:

cd courier-unicode-2.0/
./configure  --prefix=/home/user/
make
make install

cd ../maildrop-2.9.2
export CPPFLAGS=-I/home/user/include
export LDFLAGS=-L/home/user/lib/
./configure  --prefix=/home/user
make
make install

and then changed the .qmail files to |/home/user/bin/maildrop

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .