0

I would like to know if its possible to archive specific emails based on the /Subject:/ for example if I receive an email with "Website Support" it will archive it in "Support".. is this possible?

1

Use procmail for this. Your /etc/postfix/main.cf should have the line:

mailbox_command = procmail -a "$EXTENSION"

to enable procmail

You can then use rules like:

MAILDIR=$HOME/Maildir

:0
* ^Subject:.*\[zeromq-dev\]
$MAILDIR/.Mailing.zeromq/

in your ~/.procmailrc to have all items with [zeromq-dev] in the subject got to the zeromq subfolder under Mailing where your IMAP server, will find it.

-1

Postfix is SMTP daemon. You should do this on MDA or on IMAP server. For MDA you could use sieve scripts (dovecot MDA supports sieve). For IMAP itself, you could use imap-filter (lua). Usually we don't have access to things like procmail/maildrop on remote mail servers. Some webmails' filtering also fancy filter rules as well.

  • I do have dovecot installed with postfix.. how do I do this ? – XK8ER Oct 31 '13 at 11:00
  • It depends what you want. The idea behind my answer was that "modern" style of filtering mail is sieve (see en.wikipedia.org/wiki/Sieve_%28mail_filtering_language%29). There are various tools which support sieve. One of them is Dovecot MDA. Benefit is that you can modify sieve filters remotely via mail clients or specialized tools (ManageSieve protocol). You didn't describe what is your mail storage. Is it traditional mbox, maildir; do you have IMAP server installed? I won't use procmail as I like client-server design of ManageSieve protocol and I don't need ssh to edit procmail rules. – jirib Oct 31 '13 at 12:29

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.