Sieve Saving Sent items Automatically


Have my mail server up and running with sieve junk filtering working.

I want to add a rule to save anything sent out to the sent items folder. Unfortunately my android client doesn't have this option, so this is my "workaround". (I know other android clients do have this function).

Here is my sieve script, with junk filter working, but sent items not working. I suppose this could be because it's not touching dovecot/sieve when sending a message - but just sending it to postfix which is sending it out? I'm not sure – new guy here with this stuff. If that is the reason, is there a solution?

The "Sent" folder is my location for storing sent emails.

 GNU nano 2.2.4         File: /var/vmail/globalsieverc

require ["fileinto"];

#Auto save sent items to sent items folder
if header :is ["X-Mail-from"] [""] {
  setflag "\\Seen";
  fileinto "Sent";

# Move spam to spam folder
if header :contains "X-Spam-Flag" ["YES"] {
  fileinto "Junk";

0 Replies


Please enter an answer

You can mention users to notify them: @username

You can use Markdown to format your question. For more examples see the Markdown Cheatsheet.

> I’m a blockquote.

I’m a blockquote.

[I'm a link] (

I'm a link

**I am bold** I am bold

*I am italicized* I am italicized

Community Code of Conduct