Re: Multiple names in local_name for UCC certificates (was lazy-load SNI?)

2016-11-30 Thread Aki Tuomi
Thank you, we'll start looking at this.

Aki

On 01.12.2016 09:44, J. Nick Koston wrote:
> Hi Aki & Felipe,
>
> Attached is an implementation of supporting multiple domains in local_name.
>
> Example
>
> local_name "mail.domain.tld domain.tld mx.domain.tld" { ... }
>
> This can significantly reduce memory usage when using
> a UCC certificate with multiple names by only loading
> the certificate and key once.
>
>
>
> And the pull request…..
>
> https://github.com/dovecot/core/pull/24 
> 
>
> Thanks
> -Nick
>
>
>> On Nov 17, 2016, at 5:27 AM, J. Nick Koston  wrote:
>>
>> Aki,
>>
>> Multiple local_names would be ideal to accommodate certificates that have 
>> multiple names.  The way I’m reading the code it looks like its having to 
>> pay for the memory for every name on the certificate because a unique CTX is 
>> being created for each name even if they are all on a single certificate.
>>
>> This would be a big memory win for anyone using a certificate with multiple 
>> names on it.
>>
>> Thanks
>> -Nick
>> cPanel Inc
>>
>>
>>> Dear Aki et al.,
>>>
>>> How straightforward would it be to implement the following or similar 
>>> syntax:
>>>
>>> local_name foo.tld www.foo.tld mail.foo.tld bar.tld {
>>>   ...
>>> }
>>>
>>> ??
>>>
>>> Thank you!
>>>
>>> -FG
>>>
>>> --
>>>
>>> Subject: Digest Footer
>>>
>>> ___
>>> dovecot mailing list
>>> dovecot@dovecot.org
>>> http://dovecot.org/cgi-bin/mailman/listinfo/dovecot
>>>
>>> --
>>>
>>> End of dovecot Digest, Vol 163, Issue 34
>>> 
>


Multiple names in local_name for UCC certificates (was lazy-load SNI?)

2016-11-30 Thread J. Nick Koston


0001-config-Match-multiple-names-in-local_name.patch
Description: Binary data


smime.p7s
Description: S/MIME cryptographic signature


Re: Implementing secondary quota w/ "Archive" namespace

2016-11-30 Thread Mark Moseley
On Thu, Nov 24, 2016 at 9:10 PM, Mark Moseley  wrote:

> On Thu, Nov 24, 2016 at 10:52 AM, Timo Sirainen  wrote:
>
>> On 24 Nov 2016, at 9.33, Mark Moseley  wrote:
>> >
>> > On Wed, Nov 23, 2016 at 6:05 PM, Timo Sirainen  wrote:
>> >
>> >> On 23 Nov 2016, at 0.49, Mark Moseley  wrote:
>> >>>
>> >>> If I move messages between namespaces, it appears to ignore the quotas
>> >> I've
>> >>> set on them. A *copy* will trigger the quota error. But a *move* just
>> >>> happily piles on to the overquota namespace. Is that normal?
>> >>
>> >> Probably needs a bit more thinking, but I guess the attached patch
>> would
>> >> help.
>> >>
>> >>
>> > I appreciate the patch! Esp on a Weds night. I applied and rerolled
>> > dovecot, but I can still move messages into the over-quota namespace.
>>
>> How about this updated patch?
>>
>>
> Nope, still lets me move messages into the over-quota namespace.
>
> Both these are true in quota_check:
>
> ctx->moving
> quota_move_requires_check
>
>
>
>
>> > Out of curiosity, in the Quota wiki page, it mentions that 'in theory
>> there
>> > could be e.g. "user quota" and "domain quota" roots'. That's also super
>> > interesting to me. Does anyone have any experience with that? I.e. any
>> > gotchas?
>>
>>
>> There's no automatic quota recalculation for domain quotas, because it
>> would have to somehow sum up all the users' quotas. Also I think that it
>> still does do the automatic quota recalculation if it gets into a situation
>> where it realizes that quotas are wrong, but it'll then just use the single
>> user's quota as the entire domain quota. So maybe it would work if you
>> externally sum up all the users' quotas and update it to the domain quota
>> in cronjob, e.g. once per hour. I guess it would be also nice if the
>> internal quota recalculation could be disabled and maybe execute an
>> external script to do it (similar to quota-warnings).
>>
>>

Anything else I can try? I'm not sure how the logic in the quota system
works, so I'm not sure what to suggest. What's the gist of the patch (i.e.
what's it trying to do that it wasn't before)?

If I can get a handle on that, I can start littering things with debug
statements to try to track stuff down.


Re: use IMAPSIEVE to update database with last_read date

2016-11-30 Thread KT Walrus
> if you're instead interested in the date that the user *first* read the 
> message, you could capture the STORE \Seen event.

Yes. That is what I intend to do. That is, the sieve script will run on change 
of FLAGs. I really just want to verify that the user is reading certain emails 
that I send. I don’t need to track every time the user reads the message (which 
the mail server would never see anyway since the message is fetched on first 
read and then stored locally in the client).

I’m also planning on delivering most messages by IMAP to a “next day” mailstore 
and use doveadm sync (during the early morning) of the “next day” mailstore to 
the “current day” mailstore that the clients connect to. Some messages will be 
delivered directly to the “current day” mailstore via Postfix/LMTP which should 
be copied into the “next day” mailstore during the morning sync.

I’m hoping that doveadm sync is really bullet-proof and won’t add to my 
administration burden. Using IMAPSIEVE to track user’s modification of their 
mailboxes will really help keeping the website’s mysql database up to date with 
changes to Dovecot side of the website.

Kevin


> On Nov 30, 2016, at 7:07 AM, Stephan Bosch  wrote:
> 
> 
> 
> Op 30-11-2016 om 11:37 schreef Stephan Bosch:
>> 
>> 
>> Op 29-11-2016 om 19:29 schreef KT Walrus:
>>> Just noticed the Dovecot support IMAPSIEVE extension…
>>> 
>>> Could I use this extension to update an external database with the date 
>>> that the user last read the message?
>> 
>> No, IMAPSieve is only triggered by modifications: APPEND, COPY, MOVE and 
>> STORE.
>> 
> 
> BTW,
> if you're instead interested in the date that the user *first* read the 
> message, you could capture the STORE \Seen event.
> 
> Regards,
> 
> Stephan.


Re: Antispam plugin: insufficent error messages

2016-11-30 Thread Volker Wysk
Am Mittwoch, 30. November 2016, 16:23:13 CET schrieb Volker Wysk:
> Do you know any documentation about the Dovecot
> plugin API? I couldn't find any.

I've found it. No need to tell me.

Volker


Re: Antispam plugin: insufficent error messages

2016-11-30 Thread Volker Wysk
Am Dienstag, 29. November 2016, 13:59:52 CET schrieb Stephan Bosch:
> However, AntiSpam is 
> not part of the normal Dovecot distribution, nor is it a plugin created 
> by Dovecot developers. From what I know, Dovecot has mirrored/hosted the 
> AntiSpam Mercurial repository in the past and contributed a few small 
> fixes, but nothing more. Also, it doesn't look like it is actively 
> maintained at the moment.

So, if I would debug the antispam plugin, adding more log messages, finding the 
reason it doesn't work now, would my changes be included in the antispam 
distribution? Do you know any documentation about the Dovecot plugin API? I 
couldn't find any.

> Pigeonhole Sieve recently gained support for the IMAPSieve extension 
> (http://wiki2.dovecot.org/Pigeonhole/Sieve/Plugins/IMAPSieve). When 
> combined with the exprograms plugin 
> (http://wiki2.dovecot.org/Pigeonhole/Sieve/Plugins/Extprograms), you 
> should be able achieve something quite similar using a Sieve script, 
> although I have never tried that myself.

Thanks for the hint. This looks interesing, but also quite complicated. I've 
read the two pages you specified. Is there any good documentation? I have Peer 
Heinlein's Dovecot book. But there isn't much in it about plugins.

Bye
Volker


Re: Sieve script won't compile. Compiler output isn't helpful.

2016-11-30 Thread Steffen Kaiser

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

On Wed, 30 Nov 2016, Stephan Bosch wrote:

Op 30-11-2016 om 11:04 schreef Steven Mainor:


The main problem is that Sieve quoted strings are allowed to contain 
newlines, which means that a string doesn't necessarily end before the end of 
the line.


perl does display a comment in this case:

(Might be a runaway multi-line "" string starting on line 2)

I find this info very helpful.

- -- 
Steffen Kaiser

-BEGIN PGP SIGNATURE-
Version: GnuPG v1

iQEVAwUBWD7OD3z1H7kL/d9rAQL8cgf+MfppUhPQrN+gPaNGfK/PZnqp0wv2G2ax
B9Ik5IkmjPuiQJkrdYOCEPRsibXKlEcG9Hzm99u0lYJMupMduFH7UoXE8Ve48Scz
YuFixqEccfkIsfy2HIIbtcE4IuhDFcvf6g6DaGPNSkJlDHqXqwLlyOHbznz9J1f7
HQBAbZRINJoX4GmfeiHPU3bg2GEBpzPTD6RWGio7lsNmQgH74QIQKJXC/y4EyB9P
XqQLjKt0b92n3QYsIKvM62CLZ2LqU3zwbWw/H7g/PY74xddTOXThldJVWHBw1RcL
RWDgdV2x8FEKO1nsOh8wyHfVTzltYIIMbk5pA+FZzQC6hCjSod2Ylw==
=za9p
-END PGP SIGNATURE-


Quota Clone not tracking unlimited quota

2016-11-30 Thread Prakash Autade
We are configuring 'Count quota' with 'Quota Clone Plugin'

Everything is working perfectly when we set limit in quota_rule(quota_rule
= *:bytes=500M).

In case of unlimited quota(quota_rule = *:bytes=0)
 - Count quota is updating values
* - Quota Clone plugin is not updating values in redis.*

We have configured dovecot as

mail_plugins = $mail_plugins quota quota_clone mail_log notify

mailbox_list_index = yes

plugin {
  quota = count:User quota
  quota_vsizes = yes
  quota_rule = *:bytes=0
  quota_clone_dict = redis:host=127.0.0.1:port=6379
}

-- 
Sincerely,
Prakash P. Autade.


Re: use IMAPSIEVE to update database with last_read date

2016-11-30 Thread Stephan Bosch



Op 30-11-2016 om 11:37 schreef Stephan Bosch:



Op 29-11-2016 om 19:29 schreef KT Walrus:

Just noticed the Dovecot support IMAPSIEVE extension…

Could I use this extension to update an external database with the 
date that the user last read the message?


No, IMAPSieve is only triggered by modifications: APPEND, COPY, MOVE 
and STORE.




BTW,
if you're instead interested in the date that the user *first* read the 
message, you could capture the STORE \Seen event.


Regards,

Stephan.


Re: Sieve script won't compile. Compiler output isn't helpful.

2016-11-30 Thread Giles Coochey



On 30/11/16 11:39, Steven Mainor wrote:

Hey Stephan,

Its okay I should have been able to spot that as many times as I read it. I 
feel very silly about it.

I just recently started using sieve but already I love how powerful it is.

Thanks,
Steven
An easy way to spot these types of errors is to use a context sensitive 
editor with highlighting, they can often highlight these issues and make 
them easier to spot.



--
Regards,

Giles Coochey
+44 (0) 7584 634 135
+44 (0) 1803 529 451
gi...@coochey.net




smime.p7s
Description: S/MIME Cryptographic Signature


Re: Sieve script won't compile. Compiler output isn't helpful.

2016-11-30 Thread Steven Mainor
Hey Stephan, 

Its okay I should have been able to spot that as many times as I read it. I 
feel very silly about it.

I just recently started using sieve but already I love how powerful it is. 

Thanks, 
Steven

On November 30, 2016 5:44:55 AM EST, Stephan Bosch  wrote:
>
>
>Op 30-11-2016 om 11:04 schreef Steven Mainor:
>> Hello Martin,
>>
>> Wow. That was indeed the problem. I have been staring at that small 
>> script for a week and I just couldn't see it. I even had a friend
>look 
>> at it and he couldn't find it either. I feel a bit ridiculous now.
>
>Making the handling/reporting of unterminated quoted strings better has
>
>been on my list for a while now. You're the first to actually complain 
>about it so far. :)
>
>The main problem is that Sieve quoted strings are allowed to contain 
>newlines, which means that a string doesn't necessarily end before the 
>end of the line.
>
>Regards,
>
>Stephan.
>
>>
>> On 11/30/2016 04:48 AM, Martin Wheldon wrote:
>>> Hi Steven,
>>>
>>> OK a on closer inspection :)
>>>
>>> You are missing a closing double quote on line 59:
>>>
 fileinto :create "Lists/Debain/News;
>>>
>>> should be:
>>>
>>> fileinto :create "Lists/Debain/News";
>>>
>>> Best Regards
>>>
>>> Martin
>>>
>>> On 2016-11-30 09:30, Steven Mainor wrote:
 Hey martin,

 Thanks for the reply! I made the changes you suggested but I got
>the
 same results.

 According to my understanding, #header "from" "per...@example.com"#
>is
 correct for an exact match.


 On 11/30/2016 04:10 AM, Martin Wheldon wrote:
> Hi Steven,
>
> I think you may be missing the :contains from the two header lines
>
> below:
>
>> if anyof (header "From" "store-n...@amazon.com",
>>  envelope :contains "From" "menswearhouse.com",
>>  envelope :contains "From" "officedepot.com",
>>  envelope :contains "From" "walgreens.com",
>>  header "From" "pr...@email.newegg.com") {
>> fileinto :create "Promo";
>> stop;
>
> if anyof (header :contains "From" "store-n...@amazon.com",
>   envelope :contains "From" "menswearhouse.com",
>   envelope :contains "From" "officedepot.com",
>   envelope :contains "From" "walgreens.com",
>   header :contains "From" "pr...@email.newegg.com") {
>  fileinto :create "Promo";
>  stop;
>
> Hope that helps
>
> Best Regards
>
> Martin
>
> On 2016-11-30 08:47, Steven Mainor wrote:
>> Hello! I hope you will forgive my ignorance but I have a problem
>I
>> have been trying to solve for a week and I'm not sure where else
>to
>> turn.
>>
>> I'm trying to write a sieve script to sort all of my mail. I was
>> writing this script to replace the one I am currently using but I
>> can't seem to get it to compile. I don't know a lot about sieve
>or
>> really scripting of any kind and I just can't figure out what I'm
>> doing wrong.
>>
>> The compiler just puts out a bunch of output that doesn't make
>sense.
>> like "unexpected character" when I know the character works there
>> because I am already running a script with some of the same
>lines.
>>
>> I'm attaching the script with some names and addresses changed
>and 
>> the
>> sieve output to this email.
>>
>> I would greatly appreciate any help anyone could offer.


Re: Sieve script won't compile. Compiler output isn't helpful.

2016-11-30 Thread Stephan Bosch



Op 30-11-2016 om 11:04 schreef Steven Mainor:

Hello Martin,

Wow. That was indeed the problem. I have been staring at that small 
script for a week and I just couldn't see it. I even had a friend look 
at it and he couldn't find it either. I feel a bit ridiculous now.


Making the handling/reporting of unterminated quoted strings better has 
been on my list for a while now. You're the first to actually complain 
about it so far. :)


The main problem is that Sieve quoted strings are allowed to contain 
newlines, which means that a string doesn't necessarily end before the 
end of the line.


Regards,

Stephan.



On 11/30/2016 04:48 AM, Martin Wheldon wrote:

Hi Steven,

OK a on closer inspection :)

You are missing a closing double quote on line 59:


fileinto :create "Lists/Debain/News;


should be:

fileinto :create "Lists/Debain/News";

Best Regards

Martin

On 2016-11-30 09:30, Steven Mainor wrote:

Hey martin,

Thanks for the reply! I made the changes you suggested but I got the
same results.

According to my understanding, #header "from" "per...@example.com"# is
correct for an exact match.


On 11/30/2016 04:10 AM, Martin Wheldon wrote:

Hi Steven,

I think you may be missing the :contains from the two header lines 
below:



if anyof (header "From" "store-n...@amazon.com",
 envelope :contains "From" "menswearhouse.com",
 envelope :contains "From" "officedepot.com",
 envelope :contains "From" "walgreens.com",
 header "From" "pr...@email.newegg.com") {
fileinto :create "Promo";
stop;


if anyof (header :contains "From" "store-n...@amazon.com",
  envelope :contains "From" "menswearhouse.com",
  envelope :contains "From" "officedepot.com",
  envelope :contains "From" "walgreens.com",
  header :contains "From" "pr...@email.newegg.com") {
 fileinto :create "Promo";
 stop;

Hope that helps

Best Regards

Martin

On 2016-11-30 08:47, Steven Mainor wrote:

Hello! I hope you will forgive my ignorance but I have a problem I
have been trying to solve for a week and I'm not sure where else to
turn.

I'm trying to write a sieve script to sort all of my mail. I was
writing this script to replace the one I am currently using but I
can't seem to get it to compile. I don't know a lot about sieve or
really scripting of any kind and I just can't figure out what I'm
doing wrong.

The compiler just puts out a bunch of output that doesn't make sense.
like "unexpected character" when I know the character works there
because I am already running a script with some of the same lines.

I'm attaching the script with some names and addresses changed and 
the

sieve output to this email.

I would greatly appreciate any help anyone could offer.


Re: use IMAPSIEVE to update database with last_read date

2016-11-30 Thread Stephan Bosch



Op 29-11-2016 om 19:29 schreef KT Walrus:

Just noticed the Dovecot support IMAPSIEVE extension…

Could I use this extension to update an external database with the date that 
the user last read the message?


No, IMAPSieve is only triggered by modifications: APPEND, COPY, MOVE and 
STORE.



My app sends certain “notification” messages to the user’s dovecot mail 
address. The user reads the messages in their dovecot mailboxes only using 
IMAP. I want to update my app’s database to record this read time for all 
“notification” messages sent by the app.

Seems to me I could write a short sieve script to send a “notify” message to an 
app specific address that my app “watches” and updates the appropriate database 
record with the last_read time.

Is this workable for production deploy?

Or, is there a better way for a sender to be notified when the recipient 
actually reads the message? The sender will be my app and the recipient is a 
dovecot mailbox accessed by IMAP.


I don't see a solution at this time. You'd need to use some derivative 
of the notify plugin to do something like this. But afaik it doesn't 
exist. The push-notification plugin comes close though.


Regards,

Stephan.


Re: Sieve script won't compile. Compiler output isn't helpful.

2016-11-30 Thread Steven Mainor

Hello Martin,

Wow. That was indeed the problem. I have been staring at that small 
script for a week and I just couldn't see it. I even had a friend look 
at it and he couldn't find it either. I feel a bit ridiculous now.



Thanks so much for your help,

Steven


On 11/30/2016 04:48 AM, Martin Wheldon wrote:

Hi Steven,

OK a on closer inspection :)

You are missing a closing double quote on line 59:


fileinto :create "Lists/Debain/News;


should be:

fileinto :create "Lists/Debain/News";

Best Regards

Martin

On 2016-11-30 09:30, Steven Mainor wrote:

Hey martin,

Thanks for the reply! I made the changes you suggested but I got the
same results.

According to my understanding, #header "from" "per...@example.com"# is
correct for an exact match.


On 11/30/2016 04:10 AM, Martin Wheldon wrote:

Hi Steven,

I think you may be missing the :contains from the two header lines 
below:



if anyof (header "From" "store-n...@amazon.com",
 envelope :contains "From" "menswearhouse.com",
 envelope :contains "From" "officedepot.com",
 envelope :contains "From" "walgreens.com",
 header "From" "pr...@email.newegg.com") {
fileinto :create "Promo";
stop;


if anyof (header :contains "From" "store-n...@amazon.com",
  envelope :contains "From" "menswearhouse.com",
  envelope :contains "From" "officedepot.com",
  envelope :contains "From" "walgreens.com",
  header :contains "From" "pr...@email.newegg.com") {
 fileinto :create "Promo";
 stop;

Hope that helps

Best Regards

Martin

On 2016-11-30 08:47, Steven Mainor wrote:

Hello! I hope you will forgive my ignorance but I have a problem I
have been trying to solve for a week and I'm not sure where else to
turn.

I'm trying to write a sieve script to sort all of my mail. I was
writing this script to replace the one I am currently using but I
can't seem to get it to compile. I don't know a lot about sieve or
really scripting of any kind and I just can't figure out what I'm
doing wrong.

The compiler just puts out a bunch of output that doesn't make sense.
like "unexpected character" when I know the character works there
because I am already running a script with some of the same lines.

I'm attaching the script with some names and addresses changed and the
sieve output to this email.

I would greatly appreciate any help anyone could offer.


Re: Sieve script won't compile. Compiler output isn't helpful.

2016-11-30 Thread Martin Wheldon

Hi Steven,

OK a on closer inspection :)

You are missing a closing double quote on line 59:


fileinto :create "Lists/Debain/News;


should be:

fileinto :create "Lists/Debain/News";

Best Regards

Martin

On 2016-11-30 09:30, Steven Mainor wrote:

Hey martin,

Thanks for the reply! I made the changes you suggested but I got the
same results.

According to my understanding, #header "from" "per...@example.com"# is
correct for an exact match.


On 11/30/2016 04:10 AM, Martin Wheldon wrote:

Hi Steven,

I think you may be missing the :contains from the two header lines 
below:



if anyof (header "From" "store-n...@amazon.com",
 envelope :contains "From" "menswearhouse.com",
 envelope :contains "From" "officedepot.com",
 envelope :contains "From" "walgreens.com",
 header "From" "pr...@email.newegg.com") {
fileinto :create "Promo";
stop;


if anyof (header :contains "From" "store-n...@amazon.com",
  envelope :contains "From" "menswearhouse.com",
  envelope :contains "From" "officedepot.com",
  envelope :contains "From" "walgreens.com",
  header :contains "From" "pr...@email.newegg.com") {
 fileinto :create "Promo";
 stop;

Hope that helps

Best Regards

Martin

On 2016-11-30 08:47, Steven Mainor wrote:

Hello! I hope you will forgive my ignorance but I have a problem I
have been trying to solve for a week and I'm not sure where else to
turn.

I'm trying to write a sieve script to sort all of my mail. I was
writing this script to replace the one I am currently using but I
can't seem to get it to compile. I don't know a lot about sieve or
really scripting of any kind and I just can't figure out what I'm
doing wrong.

The compiler just puts out a bunch of output that doesn't make sense.
like "unexpected character" when I know the character works there
because I am already running a script with some of the same lines.

I'm attaching the script with some names and addresses changed and 
the

sieve output to this email.

I would greatly appreciate any help anyone could offer.


Re: Sieve script won't compile. Compiler output isn't helpful.

2016-11-30 Thread Steven Mainor

Hey martin,

Thanks for the reply! I made the changes you suggested but I got the 
same results.


According to my understanding, #header "from" "per...@example.com"# is 
correct for an exact match.



On 11/30/2016 04:10 AM, Martin Wheldon wrote:

Hi Steven,

I think you may be missing the :contains from the two header lines below:


if anyof (header "From" "store-n...@amazon.com",
 envelope :contains "From" "menswearhouse.com",
 envelope :contains "From" "officedepot.com",
 envelope :contains "From" "walgreens.com",
 header "From" "pr...@email.newegg.com") {
fileinto :create "Promo";
stop;


if anyof (header :contains "From" "store-n...@amazon.com",
  envelope :contains "From" "menswearhouse.com",
  envelope :contains "From" "officedepot.com",
  envelope :contains "From" "walgreens.com",
  header :contains "From" "pr...@email.newegg.com") {
 fileinto :create "Promo";
 stop;

Hope that helps

Best Regards

Martin

On 2016-11-30 08:47, Steven Mainor wrote:

Hello! I hope you will forgive my ignorance but I have a problem I
have been trying to solve for a week and I'm not sure where else to
turn.

I'm trying to write a sieve script to sort all of my mail. I was
writing this script to replace the one I am currently using but I
can't seem to get it to compile. I don't know a lot about sieve or
really scripting of any kind and I just can't figure out what I'm
doing wrong.

The compiler just puts out a bunch of output that doesn't make sense.
like "unexpected character" when I know the character works there
because I am already running a script with some of the same lines.

I'm attaching the script with some names and addresses changed and the
sieve output to this email.

I would greatly appreciate any help anyone could offer.


Re: Sieve script won't compile. Compiler output isn't helpful.

2016-11-30 Thread Martin Wheldon

Hi Steven,

I think you may be missing the :contains from the two header lines 
below:



if anyof (header "From" "store-n...@amazon.com",
 envelope :contains "From" "menswearhouse.com",
 envelope :contains "From" "officedepot.com",
 envelope :contains "From" "walgreens.com",
 header "From" "pr...@email.newegg.com") {
fileinto :create "Promo";
stop;


if anyof (header :contains "From" "store-n...@amazon.com",
  envelope :contains "From" "menswearhouse.com",
  envelope :contains "From" "officedepot.com",
  envelope :contains "From" "walgreens.com",
  header :contains "From" "pr...@email.newegg.com") {
 fileinto :create "Promo";
 stop;

Hope that helps

Best Regards

Martin

On 2016-11-30 08:47, Steven Mainor wrote:

Hello! I hope you will forgive my ignorance but I have a problem I
have been trying to solve for a week and I'm not sure where else to
turn.

I'm trying to write a sieve script to sort all of my mail. I was
writing this script to replace the one I am currently using but I
can't seem to get it to compile. I don't know a lot about sieve or
really scripting of any kind and I just can't figure out what I'm
doing wrong.

The compiler just puts out a bunch of output that doesn't make sense.
like "unexpected character" when I know the character works there
because I am already running a script with some of the same lines.

I'm attaching the script with some names and addresses changed and the
sieve output to this email.

I would greatly appreciate any help anyone could offer.


Sieve script won't compile. Compiler output isn't helpful.

2016-11-30 Thread Steven Mainor
Hello! I hope you will forgive my ignorance but I have a problem I have 
been trying to solve for a week and I'm not sure where else to turn.


I'm trying to write a sieve script to sort all of my mail. I was writing 
this script to replace the one I am currently using but I can't seem to 
get it to compile. I don't know a lot about sieve or really scripting of 
any kind and I just can't figure out what I'm doing wrong.


The compiler just puts out a bunch of output that doesn't make sense. 
like "unexpected character" when I know the character works there 
because I am already running a script with some of the same lines.


I'm attaching the script with some names and addresses changed and the 
sieve output to this email.


I would greatly appreciate any help anyone could offer.


require ["envelope", "fileinto", "mailbox", "imap4flags", "regex"];

if anyof (header :contains "List-ID" "",
  header :contains "List-Id" "Dovecot",
  envelope :domain "From" "lists.ubuntu.com",
  envelope :domain "from" "debian.org",
  envelope :domain "From" "1.example.com",
  envelope :domain "From" "2.example.com",
  envelope :domain "From" "3.example.com",
  envelope :domain "From" "4.example.com",
  envelope :domain "From" "5.example.com",
  envelope :domain "From" "6.example.com",
  envelope "From" "per...@7.example.com",
  envelope :domain "From" "8.example.com",
  envelope :domain "From" "9.example.com",
  envelope :domain "From" "10.example.com",
  envelope :domain "From" "11.example.com",
  envelope :domain "From" "12.example.com",
  envelope :domain "From" "13.example.com",
  envelope :domain "From" "14.example.com",
  envelope :domain "From" "15.example.com",
  envelope :domain "From" "16.ecample.com") {
 if header :contains "List-ID" "" {
 fileinto :create "Lists/Kernel";
 stop;
 }
 if header :contains "List-Id" "Dovecot" {
 fileinto :create "Lists/Dovecot";
 stop;
 }
 if envelope :domain "From" "lists.ubuntu.com" {
 if envelope "from" "ubuntu-users-boun...@lists.ubuntu.com"  {
 fileinto :create "Lists/Ubuntu/Users";
 stop;
 }
 if envelope "From" "ubuntu-security-announce-boun...@lists.ubuntu.com" 
 {
 fileinto :create "Lists/Ubuntu/Security";
 stop;
 }
 else {
 fileinto :create "Lists/Ubuntu";
 stop;
 }
 } 
 if envelope :domain "From" "debian.org"  {
 if envelope :contains "From" "debian-user" {
 fileinto :create "Lists/Debian/User";
 stop;
 }
 if envelope :contains "From" "debain-security" {
 fileinto :create "Lists/Debain/Security";
 stop;
 }
 if envelope :contains "From" "debain-security-announce" {
 fileinto :create "Lists/Debain/SecurityAnnounce";
 stop;
 }
 if envelope :contains "From" "debian-news" {
 fileinto :create "Lists/Debain/News;
 stop;
 }
 if envelope :contains "From" "debian-lts" {
 fileinto :create "Lists/Debian/LtsAnnounce";
 stop;
 }
 if envelope :contains "From" "debian-photo" {
 fileinto :create "Lists/Debian/Photo";
 stop;
 }
 else {
 fileinto :create "Lists/Debain";
 stop;
 }
 }
 if anyof (envelope :domain "From" "1.example.com",
   envelope :domain "From" "2.example.com",
   envelope :domain "From" "3.example.com",
   envelope :domain "From" "4.example.com",
   envelope :domain "From" "5.example.com",
   envelope :domain "From" "6.example.com",
   envelope "From" "per...@7.example.com",
   envelope :domain "From" "8.example.com",
   envelope :domain "From" "9.example.com",
   envelope :domain "From" "10.example.com",
   envelope :domain "From" "11.example.com",
   envelope :domain "From" "11.example.com",
   envelope :domain "From" "12.example.com",
   envelope :domain "From" "13.example.com",
   envelope :domain "From" "14.example.com",
   envelope :domain "From" "15.example.com") {
 fileinto :create "Lists/Bulk";
 stop;
 }
 else {
 fileinto :create "Lists";
 stop;
 }
}
if anyof (header "From" "store-n...@amazon.com",
  envelope :contains "From" "menswearhouse.com",
  envelope :contains "From" "officedepot.com",
  envelope :contains "From" "walgreens.com",
  header "From" "pr...@email.newegg.com") {
 fileinto :create "Promo";
 stop;
}
if envelope :contains "From" "facebookmail.com" {
 fileinto :create "SocialMedi