LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 07-09-2009, 04:08 PM   #1
steven19782007
LQ Newbie
 
Registered: Jan 2007
Location: Merseyside
Distribution: Ubuntu 9.04
Posts: 15

Rep: Reputation: 1
sieve setup on dovecot 1.1.4


Hi there

I am looking into setting up sieve mail filters on dovecot 1.1.4. I have been trying to find a good guide online that will talk me through it but they all seem a bit old. Does anyone have experience of doing this as I'm a bit scared of doing it on the live mail server where I work but I am being pressured into getting this done.

I have been looking at the dovecot.conf file and trying to work out what I need to do. So far I think I need to install the sieve plugin but I have seen in various places people saying that I will need to install 'deliver'. I was hoping someone could help me with this. I would be eternally grateful.

Thanks

Steve
 
Old 07-10-2009, 12:41 PM   #2
Berhanie
Senior Member
 
Registered: Dec 2003
Location: phnom penh
Distribution: Fedora
Posts: 1,625

Rep: Reputation: 165Reputation: 165
deliver should have been part of the dovecot install. It's essential, since deliver is the thing that executes the sieve scripts at delivery time. Configuration is trivial: you just need to add a single line in the protocol lda portion of the config file, as documented here under "Configuring".

You mention having to install the sieve plugin. The link above mentions this:
Quote:
In Ubuntu, starting from version 7.10 Gutsy, the CMU Sieve plugin already comes with Dovecot regular install. In this case you do not have to download additional packages. Simply skip "Compiling" section and proceed to "Configuring". This is also true for Debian Etch.
 
Old 07-11-2009, 11:49 AM   #3
steven19782007
LQ Newbie
 
Registered: Jan 2007
Location: Merseyside
Distribution: Ubuntu 9.04
Posts: 15

Original Poster
Rep: Reputation: 1
sieve setup

That does seem straight forward enough. I will let you know once I have got it working, thanks very much for your help.
 
Old 07-12-2009, 01:40 PM   #4
steven19782007
LQ Newbie
 
Registered: Jan 2007
Location: Merseyside
Distribution: Ubuntu 9.04
Posts: 15

Original Poster
Rep: Reputation: 1
sieve setup

I have done the steps mentioned in the link you sent but I can not get my sieve scripts to work so far. I have added the line to the protocol lda section:

mail_plugins = cmusieve

The link mentions that the default location checked for sieve scripts is on a file called .dovecot.sieve in the users home directory so I have created a file at:

/home/USERNAME/.dovecot.sieve

and put the following lines into it:

require "fileinto";

if header :contains "Subject" "test" {
fileinto "testing";
stop;
}

I also tried

require "fileinto";

if header :contains ["Subject"] ["test"] {
fileinto "testing";
}

I have created a folder called 'testing' using thunderbird but still any mails I send with subject 'test' go straight into the inbox. Should I be creating the folders somewhere special rather than in Thunderbird?
 
Old 07-12-2009, 03:32 PM   #5
Berhanie
Senior Member
 
Registered: Dec 2003
Location: phnom penh
Distribution: Fedora
Posts: 1,625

Rep: Reputation: 165Reputation: 165
Are you sure that deliver is delivering the mail? If not, create a ~/.forward that is something like this:
Code:
| "/usr/local/libexec/dovecot/deliver"
Substitute your system's path to deliver.
 
Old 07-12-2009, 05:45 PM   #6
steven19782007
LQ Newbie
 
Registered: Jan 2007
Location: Merseyside
Distribution: Ubuntu 9.04
Posts: 15

Original Poster
Rep: Reputation: 1
sieve setup

I tried doing this and my mail gets bounced back. I assume you meant create a file called .forward in my home directory and put '| "/usr/local/libexec/dovecot/deliver"' in it? I did that and made it executable but no luck.

When I do a locate deliver, that is the path that gets returned, thats why I left out the 'libexec'. I have also tried manually compiling my sieve script (.dovecot.sieve) with sievec but that didn't work either. I appreciate your help with this. I am a bit of a noob when it comes to configuring mail servers.
 
Old 07-12-2009, 09:21 PM   #7
Berhanie
Senior Member
 
Registered: Dec 2003
Location: phnom penh
Distribution: Fedora
Posts: 1,625

Rep: Reputation: 165Reputation: 165
I think you're making progress. What was the reason for the rejection?

So, the first task is to get deliver to deliver mail without any sieve scripts.
You can start here.

By the way, your script is good. It compiled automatically by deliver,
and I also did it manually with sievec. It also performed as intended.
 
Old 07-13-2009, 02:50 PM   #8
steven19782007
LQ Newbie
 
Registered: Jan 2007
Location: Merseyside
Distribution: Ubuntu 9.04
Posts: 15

Original Poster
Rep: Reputation: 1
sieve setup

The message I get when the mail is rejected is this:

Final-Recipient: rfc822; steven@sykes.co.uk
Original-Recipient: rfc822;steven@sykes.co.uk
Action: failed
Status: 5.3.5
Diagnostic-Code: x-unix; local configuration error


my dovecot.conf file contains the following in the protocol lda section:

protocol lda {
# Address to use when sending rejection mails.
#postmaster_address = postmaster@example.com

# Hostname to use in various parts of sent mails, eg. in Message-Id.
# Default is the system's real hostname.
#hostname =

# Support for dynamically loadable plugins. mail_plugins is a space separated
# list of plugins to load.
mail_plugins = cmusieve
mail_plugin_dir = /usr/lib/dovecot/modules/lda

# If user is over quota, return with temporary failure instead of
# bouncing the mail.
#quota_full_tempfail = no

# Format to use for logging mail deliveries. You can use variables:
# %$ - Delivery status message (e.g. "saved to INBOX")
# %m - Message-ID
# %s - Subject
# %f - From address
#deliver_log_format = msgid=%m: %$

# Binary to use for sending mails.
#sendmail_path = /usr/lib/sendmail

# Human readable error message for rejection mails. Use can use variables:
# %n = CRLF, %r = reason, %s = subject, %t = recipient
#rejection_reason = Your message to <%t> was automatically rejected:%n%r

# UNIX socket path to master authentication server to find users.
#auth_socket_path = /var/run/dovecot/auth-master
}

I tihnk I need to uncomment some more lines maybe but not sure which as I have no problems sending and receiving mails at the moment.
 
Old 06-03-2010, 03:16 PM   #9
julianbaker
LQ Newbie
 
Registered: Jun 2010
Posts: 1

Rep: Reputation: 0
Did you ever manage to resolve this?

I'm trying to configure Dovecot to automatically forward mail to another account without the virtual user having to log-in first to Roundcube web mail.

These are virtual users with no log-in to the server only Roundcube's web interface

Exim handles regular domain email and would rather leave it as it is, since it handles email forwarding for a bunch of virtual sites.

The situation is that I have two domains who want to receive email at their domains, get a forwarded copy at their hotmail account, then log-in to Roundcube to reply.

A Sieve script running in Dovecot seems the way to go, but te finer points of configuration have failed me.
 
  


Reply

Tags
dovecot, postfix, server, ubuntu



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Dovecot + Sieve and Smartsieve robertjinx Linux - Server 2 11-26-2008 03:52 AM
Dovecot setup Fernandoch Linux - Server 16 04-22-2008 05:52 AM
LXer: How To Install & Set Up Dovecot Mail Server With Sieve And Virtual Users LXer Syndicated Linux News 0 09-08-2007 04:21 AM
Dovecot setup problems on SuSE 9.2 Coldmiser SUSE / openSUSE 1 04-20-2006 07:46 PM
i want to setup pop3 for dovecot in rh9 syedabdul Linux - Networking 0 04-09-2006 02:00 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 03:30 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration