Re: Sieve not filtering

2017-02-20 Thread Alexander Dalloz

Am 18.02.2017 um 17:44 schrieb Ben:




[ ... ]


Actually, after many hours of head-bashing, I discovered the problem.

sieve doesn't work when you're just using telnet port 25 !

I was doing :
ehlo test
mail from:sen...@example.com
rcpt to:re...@example.com
data
Subject: hello world
Hello World !
.

With the above, sieve was simply sending everything to INBOX

When I changed my methodology :
ehlo test
mail from:sen...@example.com
rcpt to:re...@example.com
data
From:
To:
Subject: hello world
Hello World !
.

It worked as expected.


Just for the record: please don't use that invalid syntax.

Alexander


Re: Sieve not filtering

2017-02-20 Thread Ben



Thank you for this.

Actually, after many hours of head-bashing, I discovered the problem.

sieve doesn't work when you're just using telnet port 25 !

I was doing :
ehlo test
mail from:sen...@example.com
rcpt to:re...@example.com
data
Subject: hello world
Hello World !
.

With the above, sieve was simply sending everything to INBOX

When I changed my methodology :
ehlo test
mail from:sen...@example.com
rcpt to:re...@example.com
data
From:
To:
Subject: hello world
Hello World !
.

It worked as expected.


The first one works as expected too; your rule used "address" so it
is correct that it didn't look at the envelope address. You want e.g.

envelope "to" "f...@example.org"

Will take a look. Thanks !


Re: Sieve not filtering

2017-02-20 Thread Stuart Henderson
On 2017-02-18, Ben  wrote:
>
>> What I did when encountering a similar issue was to take one of the messages 
>> from INBOX that should have been moved elsewhere and use sieve-test on it:
>>
>> sieve-test -Tlevel=matching  
>>
>> That generates a lot of output as it goes through every line of the sieve 
>> file and shows the actual values that are used for the tests.  However, it 
>> pointed out my problem quite clearly.
>>
>
> Thank you for this.
>
> Actually, after many hours of head-bashing, I discovered the problem.
>
> sieve doesn't work when you're just using telnet port 25 !
>
> I was doing :
> ehlo test
> mail from:sen...@example.com
> rcpt to:re...@example.com
> data
> Subject: hello world
> Hello World !
> .
>
> With the above, sieve was simply sending everything to INBOX
> 
> When I changed my methodology :
> ehlo test
> mail from:sen...@example.com
> rcpt to:re...@example.com
> data
> From:
> To:
> Subject: hello world
> Hello World !
> .
>
> It worked as expected.
>

The first one works as expected too; your rule used "address" so it
is correct that it didn't look at the envelope address. You want e.g. 

envelope "to" "f...@example.org"


Re: Sieve not filtering

2017-02-18 Thread Ben



What I did when encountering a similar issue was to take one of the messages 
from INBOX that should have been moved elsewhere and use sieve-test on it:

sieve-test -Tlevel=matching  

That generates a lot of output as it goes through every line of the sieve file 
and shows the actual values that are used for the tests.  However, it pointed 
out my problem quite clearly.



Thank you for this.

Actually, after many hours of head-bashing, I discovered the problem.

sieve doesn't work when you're just using telnet port 25 !

I was doing :
ehlo test
mail from:sen...@example.com
rcpt to:re...@example.com
data
Subject: hello world
Hello World !
.

With the above, sieve was simply sending everything to INBOX

When I changed my methodology :
ehlo test
mail from:sen...@example.com
rcpt to:re...@example.com
data
From:
To:
Subject: hello world
Hello World !
.

It worked as expected.


Re: Sieve not filtering

2017-02-17 Thread Doug Hardie

> On 17 February 2017, at 08:24, Ben  wrote:
> 
> Hi,
> 
> I have copied accross a known-good sieve file from a working server and its 
> not filtering.  Everything just gets chucked into INBOX.

What I did when encountering a similar issue was to take one of the messages 
from INBOX that should have been moved elsewhere and use sieve-test on it:

sieve-test -Tlevel=matching  

That generates a lot of output as it goes through every line of the sieve file 
and shows the actual values that are used for the tests.  However, it pointed 
out my problem quite clearly.


Sieve not filtering

2017-02-17 Thread Ben

Hi,

I have copied accross a known-good sieve file from a working server and 
its not filtering.  Everything just gets chucked into INBOX.


doveconf-n at the bottom of this mail

Feb 17 16:05:20 server postfix/smtpd[51562]: 7FA5E12CBBC: 
client=unknown[192.168.167.57]

Feb 17 16:05:23 server postfix/cleanup[51565]: 7FA5E12CBBC: message-id=<>
Feb 17 16:05:23 server postfix/qmgr[45471]: 7FA5E12CBBC: 
from=, size=182, nrcpt=1 (queue active)

Feb 17 16:05:23 server dovecot: lmtp(51467): Connect from local
Feb 17 16:05:23 server dovecot: auth-worker(51568): 
passwd(recipi...@example.com): unknown user
Feb 17 16:05:23 server dovecot: lmtp(51467, recipi...@example.com): 
1JK2B0Mfp1gLyQAAHLpRfg: sieve: msgid=unspecified: stored mail into 
mailbox 'INBOX'
Feb 17 16:05:23 server dovecot: lmtp(51467): Disconnect from local: 
Successful quit
Feb 17 16:05:23 server postfix/lmtp[51566]: 7FA5E12CBBC: 
to=, 
orig_to=, 
relay=server.example.com[private/dovecot-lmtp], delay=4.9, 
delays=4.9/0.01/0/0.05, dsn=2.0.0, status=sent (250 2.0.0 
 1JK2B0Mfp1gLyQAAHLpRfg Saved)

Feb 17 16:05:23 server postfix/qmgr[45471]: 7FA5E12CBBC: removed


This is the syntax I'm using in my sieve file:
require ["fileinto","envelope"];
if anyof (address :is :all "to" 
["recipient+someth...@example.com”,”mailing_l...@example.com”],
   header :contains ["Cc", "Delivered-To"] 
["recipient+someth...@example.com”,”mailing_l...@example.com”]) {

fileinto “THIS_FOLDER”;
stop;
}



# 2.2.10: /etc/dovecot/dovecot.conf
# OS: Linux 3.10.0-514.6.1.el7.x86_64 x86_64 CentOS Linux release 
7.3.1611 (Core)

auth_mechanisms = plain login
auth_verbose = yes
auth_verbose_passwords = sha1
first_valid_uid = 1000
mail_location = maildir:~/Maildir
managesieve_notify_capability = mailto
managesieve_sieve_capability = fileinto reject envelope 
encoded-character vacation subaddress comparator-i;ascii-numeric 
relational regex imap4flags copy include variables body environment 
mailbox date ihave enotify

mbox_write_locks = fcntl
namespace inbox {
  inbox = yes
  location =
  mailbox Drafts {
special_use = \Drafts
  }
  mailbox Junk {
special_use = \Junk
  }
  mailbox Sent {
special_use = \Sent
  }
  mailbox "Sent Messages" {
special_use = \Sent
  }
  mailbox Trash {
special_use = \Trash
  }
  prefix =
}
passdb {
  driver = pam
}
passdb {
  driver = pam
}
passdb {
  args = scheme=CRYPT username_format=%u /etc/dovecot/users
  driver = passwd-file
}
plugin {
  sieve = ~/.dovecot.sieve
}
protocols = imap lmtp
service auth {
  unix_listener /var/spool/postfix/private/dovecot-auth {
group = postfix
mode = 0660
user = postfix
  }
  unix_listener auth-userdb {
group = its_virtmail
mode = 0660
user = its_virtmail
  }
}
service imap-login {
  process_min_avail = 3
}
service lmtp {
  process_min_avail = 5
  unix_listener /var/spool/postfix/private/dovecot-lmtp {
group = postfix
mode = 0600
user = postfix
  }
  user = its_virtmail
}
service managesieve-login {
  inet_listener sieve {
port = 4190
  }
  inet_listener sieves {
address =
port = 5190
ssl = yes
  }
}
ssl = required
ssl_cert =  was automatically rejected:%n%r
}
protocol imap {
  imap_client_workarounds = delay-newmail
  mail_max_userip_connections = 20
}


[Dovecot] Sieve not filtering

2013-02-06 Thread Nicolas Mora

Hello,

I installed a few weeks ago the Dovecot package on a Debian stable 
along with postfix, everything works fine except the sieve filter. I 
followed the howto found on the internet (google: debian postfix dovecot 
sieve). I'm able to view and modify sieve rules with roundcube or 
thunderbird plugins, but the rules are not applied when a message 
arrives and all messages arrive in INBOX. Here is the content of my 
configuration files concerning sieve :


dovecot.conf
protocols = imap imaps managesieve

   protocol managesieve {
 listen = *:2000
   }

protocol managesieve {
  mail_executable = /usr/lib/dovecot/managesieve

  managesieve_max_line_length = 65536

  managesieve_logout_format = bytes=%i/%o

}

protocol lda {
  postmaster_address = postmas...@babelouest.org

  mail_plugins = sieve
  mail_plugin_dir = /usr/lib/dovecot/modules/lda

  log_path =
  info_log_path =
  syslog_facility = mail
}

plugin {
  sieve_dir=~/Maildir/sieve
}


And the postfix/main.cf config file contains for dovecot sieve the 
following


maibox_command = /usr/lib/dovecot/dovecot-lda -f $SENDER -a 
$RECIPIENT

dovecot_destination_recipient_limit = 1
virtual_transport = dovecot

I also tried the command
mailbox_command = /usr/lib/dovecot/deliver

it didn't work either...

Is there somthing so obvious that I didn't see it ?

Thanks in advance



Re: [Dovecot] Sieve not filtering

2013-02-06 Thread Thomas Leuxner
* Nicolas Mora nico...@babelouest.org 2013.02.06 16:06:

 plugin {
   sieve_dir=~/Maildir/sieve
 }

Better to post 'dovecot -n' which is the active config.

http://wiki.dovecot.org/LDA/Sieve/Dovecot

Not sure what the default was for the active script in the old Dovecot versions 
as 'sieve_dir' is the upload directory for scripts to be referenced (see Wiki). 
Active config will tell.

You may raise logging levels and it will tell you what happens when the LDA 
tries to spawn sieve:

http://wiki.dovecot.org/Logging

Regards
Thomas


signature.asc
Description: Digital signature


[Dovecot] Sieve plugin: Filtering UTF-8 Emails

2009-11-22 Thread micha

hi all,

i hope it´s okay for questions about the sieve plugin here...
my problem is, that the filters do not seem to match utf8-content

for instance: the email:

Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable
Subject: 
=?utf-8?Q?Erinnerung:=20Bitte=20f=C3=BChren=20Sie=20die=20Kaufabwicklung=20durch?=


when i use the same subject (of course in utf-8) in my .dovecot.sieve, 
the filter never matches ;-((


does anyone have an idea howto make the sample here matching by sieve ???

thank´s for any help!
michael


Re: [Dovecot] Sieve plugin: Filtering UTF-8 Emails

2009-11-22 Thread Pascal Volk
On 11/22/2009 09:33 PM mi...@pocomail.de wrote:
 hi all,
 
 i hope it´s okay for questions about the sieve plugin here...

Yes, this is the right mailing list for such questions…

 my problem is, that the filters do not seem to match utf8-content
 
 for instance: the email:
 
 Content-Type: text/plain; charset=utf-8
 Content-Transfer-Encoding: quoted-printable
 Subject: 
 =?utf-8?Q?Erinnerung:=20Bitte=20f=C3=BChren=20Sie=20die=20Kaufabwicklung=20durch?=
 
 when i use the same subject (of course in utf-8) in my .dovecot.sieve, 
 the filter never matches ;-((
 
 does anyone have an idea howto make the sample here matching by sieve ???

Huh, where is your script? No script - no error checking. ;)

Which Dovecot version? Which Sieve version?

# file .dovecot.sieve
.dovecot.sieve: UTF-8 Unicode text

~/.dovecot.sieve:
require fileinto;
if header :matches subject Erinnerung: Bitte führen Sie die Kaufabw* {
  fileinto Trash;
  setflag \\Seen;
}

Log: Info: sieve: msgid=20091…ple.com: stored mail into mailbox Trash'
The test message is attached.


Regards,
Pascal
-- 
The trapper recommends today: defaced.0932...@localdomain.org
---BeginMessage---
html
body
h1Hello wordl/h1
pfoo bar baz/p
/body
/html
---End Message---


Re: [Dovecot] Sieve plugin: Filtering UTF-8 Emails

2009-11-22 Thread micha

hi Pascal,

sorry, here are my infos:

dovecot version: Dovecot v1.0.rc15

i am not sure how to find out, which version of cumsieve the server has, 
as far as i can see with a locate cumsieve,

it must be version 1.0.3 or 1.1.6.

the scripte and a test-email is attached.

the log says:

deliver(s...@.de): 2009-11-23 00:09:45 Info: 
msgid=4b09c4ae.3070...@.de: saved mail to INBOX


thanks for your help!!
michael

Am Sonntag, den 22.11.2009 23:01:35 schrieb Pascal Volk 
user+dove...@localhost.localdomain.org...

On 11/22/2009 09:33 PM mi...@pocomail.de wrote:
  

hi all,

i hope it´s okay for questions about the sieve plugin here...



Yes, this is the right mailing list for such questions…

  

my problem is, that the filters do not seem to match utf8-content

for instance: the email:

Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable
Subject: 
=?utf-8?Q?Erinnerung:=20Bitte=20f=C3=BChren=20Sie=20die=20Kaufabwicklung=20durch?=


when i use the same subject (of course in utf-8) in my .dovecot.sieve, 
the filter never matches ;-((


does anyone have an idea howto make the sample here matching by sieve ???



Huh, where is your script? No script - no error checking. ;)

Which Dovecot version? Which Sieve version?

# file .dovecot.sieve
.dovecot.sieve: UTF-8 Unicode text

~/.dovecot.sieve:
require fileinto;
if header :matches subject Erinnerung: Bitte führen Sie die Kaufabw* {
  fileinto Trash;
  setflag \\Seen;
}

Log: Info: sieve: msgid=20091…ple.com: stored mail into mailbox Trash'
The test message is attached.


Regards,
Pascal
  




Betreff:
Erinnerung: Bitte führen Sie die Kaufabwicklung durch
Von:
spam...@example.com
Datum:
Sun, 22 Nov 2009 22:50:29 +0100 (CET)
An:
s...@firma.tld

An:
s...@firma.tld


html
body
h1Hello wordl/h1
pfoo bar baz/p
/body
/html
  
---BeginMessage---

test
---End Message---
# Erinnerung Kaufabwicklung
if allof ( 
header :comparator i;ascii-casemap :contains Subject 
Erinnerung: Bitte führen Sie die Kaufabwicklung durch,
) { 
redirect x...@googlemail.com;
stop;
}



Re: [Dovecot] Sieve plugin: Filtering UTF-8 Emails

2009-11-22 Thread Pascal Volk
On 11/23/2009 12:32 AM mi...@pocomail.de wrote:
 hi Pascal,
 
 sorry, here are my infos:
 
 dovecot version: Dovecot v1.0.rc15
 
 i am not sure how to find out, which version of cumsieve the server has, 
 as far as i can see with a locate cumsieve,
 it must be version 1.0.3 or 1.1.6.
 
 the scripte and a test-email is attached.
 
 the log says:
 
 deliver(s...@.de): 2009-11-23 00:09:45 Info: 
 msgid=4b09c4ae.3070...@.de: saved mail to INBOX
 

Please stop top posting.

Your installation is horrible old. You may consider an update.

You are using the omparator i;ascii-casemap. Please read in RFC 2244
section 3.4 about it http://tools.ietf.org/html/rfc2244#section-3.4.
And you will know, why your rule never will match.
You could test my working script from my last message.


Regards,
Pascal
-- 
The trapper recommends today: cafefeed.0932...@localdomain.org


Re: [Dovecot] Sieve plugin: Filtering UTF-8 Emails

2009-11-22 Thread micha


Am Montag, den 23.11.2009 0:53:15 schrieb Pascal Volk 
user+dove...@localhost.localdomain.org...

Please stop top posting.

Your installation is horrible old. You may consider an update.

You are using the omparator i;ascii-casemap. Please read in RFC 2244
section 3.4 about it http://tools.ietf.org/html/rfc2244#section-3.4.
And you will know, why your rule never will match.
You could test my working script from my last message.


Regards,
Pascal


okay, thank you !!!

michael