Re: Mailbox inaccessible after setaclmailbox with invalid identifier

2018-05-28 Thread ellie timoney
Hi Sven,

Are you able to provide a sample mailboxes.db entry (using cyr_dbtool as
Bron describes below) for a mailbox which is affected by this?
I'm trying to determine if the cause is bad data getting into the
database, or good data that's being misread for some reason.  An example
would help a lot!
Cheers,

ellie

On Tue, May 29, 2018, at 9:34 AM, Bron Gondwana wrote:
> https://github.com/cyrusimap/cyrus-imapd/issues/2378 to track
> the issue.> 
> Sorry about the short comment earlier on my phone as I woke up - meant
> to save it as a draft and add some detail!> 
> # /usr/cyrus/bin/cyr_dbtool   
> Usage: /usr/cyrus/bin/cyr_dbtool [-C altconfig]  
>  [] []> Usable Backends: flat, skiplist, quotalegacy, 
> twoskip
> 
> Actions:
> * show []
> * get 
> * set  
> * delete 
> * dump - internal format dump
> * consistent - check consistency
> * repack - repack/checkpoint the DB (if supported)
> * damage - start a commit then die during
> * batch - read from stdin and execute commands
> You may omit key or key/value and specify one per line on stdin
> keys are terminated by tab or newline, values are terminated by
> newline> 
> =
> 
>  will need to be your mailboxes.db (e.g.
> /var/imap/mailboxes.db on many systems).  You'll have to run it as the
> cyrus user.  You can use "show" to dump the whole file and grep for
> the individual mailbox, or "get" on the mailbox key directly to get
> the one line.  Then "set" to set it with a value with that group name
> removed.> 
> You'll probably want to do another setacl on that mailbox with
> something safe afterwards, just so the cyrus.header file gets cleaned
> up as well.  It contains a value which is a cache of the value in
> mailboxes.db.> 
> Cheers,
> 
> Bron.
> 
> 
> On Tue, May 29, 2018, at 07:55, Bron Gondwana wrote:
>> If you use cyr_dbtool you can edit the offending line in
>> mailboxes db.>> 
>> Clearly there's a bug here too, we should be sanitising group names!
>> Or at least storing them in a reversible format>> 
>> 
>> On Tue, May 29, 2018, at 00:33, Sven Schwedas wrote:
>>> After running `setaclmailbox some/mailbox "group:name with
>>> spaces" all`,>>> all attempts to access the mailbox in any way either 
>>> result in an
>>> "Invalid identifier" error message, or can't even find the mailbox.>>> 
>>> deleteaclmailbox with exactly the same parameters as set
>>> doesn't help>>> (same "invalid identifier" error); cyrreconstruct doesn't 
>>> even
>>> find the>>> mailbox. Deliveries are deferred as well.
>>> 
>>> Any ideas how I can recover the mailbox without rolling back
>>> the whole>>> server to an older backup?
>>> 
>>> (Cyrus 2.5.10 on Debian stretch, if that matters.)
>>> 
>>> --
>>> Mit freundlichen Grüßen, / Best Regards,
>>> Sven Schwedas, Systemadministrator
>>> ✉ sven.schwe...@tao.at | ☎ +43 680 301 7167
>>> TAO Digital   | Teil der TAO Beratungs- & Management GmbH
>>> Lendplatz 45  | FN 213999f/Klagenfurt, FB-Gericht Villach
>>> A8020 Graz| https://www.tao-digital.at
>>> 
>>> 
>>> Cyrus Home Page: http://www.cyrusimap.org/
>>> List Archives/Info:
>>> http://lists.andrew.cmu.edu/pipermail/info-cyrus/>>> To Unsubscribe:
>>> https://lists.andrew.cmu.edu/mailman/listinfo/info-cyrus
>>> Email had 1 attachment:


>>>  * signature.asc 1k (application/pgp-signature)>> 
>> --
>>   Bron Gondwana, CEO, FastMail Pty Ltd
>>   br...@fastmailteam.com
>> 
>> 
>> Cyrus Home Page: http://www.cyrusimap.org/
>> List Archives/Info: http://lists.andrew.cmu.edu/pipermail/info-cyrus/>> To 
>> Unsubscribe:
>> https://lists.andrew.cmu.edu/mailman/listinfo/info-cyrus
> 
> --
>   Bron Gondwana, CEO, FastMail Pty Ltd
>   br...@fastmailteam.com
> 
> 
> 
> Cyrus Home Page: http://www.cyrusimap.org/
> List Archives/Info: http://lists.andrew.cmu.edu/pipermail/info-cyrus/> To 
> Unsubscribe:
> https://lists.andrew.cmu.edu/mailman/listinfo/info-cyrus


Cyrus Home Page: http://www.cyrusimap.org/
List Archives/Info: http://lists.andrew.cmu.edu/pipermail/info-cyrus/
To Unsubscribe:
https://lists.andrew.cmu.edu/mailman/listinfo/info-cyrus

Re: Mailbox inaccessible after setaclmailbox with invalid identifier

2018-05-28 Thread Bron Gondwana
https://github.com/cyrusimap/cyrus-imapd/issues/2378 to track the issue.
Sorry about the short comment earlier on my phone as I woke up - meant
to save it as a draft and add some detail!
# /usr/cyrus/bin/cyr_dbtool   
Usage: /usr/cyrus/bin/cyr_dbtool [-C altconfig]
[] []Usable Backends: flat, skiplist, quotalegacy, twoskip

Actions:
* show []
* get 
* set  
* delete 
* dump - internal format dump
* consistent - check consistency
* repack - repack/checkpoint the DB (if supported)
* damage - start a commit then die during
* batch - read from stdin and execute commands
You may omit key or key/value and specify one per line on stdin
keys are terminated by tab or newline, values are terminated by newline
=

 will need to be your mailboxes.db (e.g. /var/imap/mailboxes.db
on many systems).  You'll have to run it as the cyrus user.  You can use
"show" to dump the whole file and grep for the individual mailbox, or
"get" on the mailbox key directly to get the one line.  Then "set" to
set it with a value with that group name removed.
You'll probably want to do another setacl on that mailbox with something
safe afterwards, just so the cyrus.header file gets cleaned up as well.
It contains a value which is a cache of the value in mailboxes.db.
Cheers,

Bron.


On Tue, May 29, 2018, at 07:55, Bron Gondwana wrote:
> If you use cyr_dbtool you can edit the offending line in mailboxes db.> 
> Clearly there's a bug here too, we should be sanitising group names!
> Or at least storing them in a reversible format> 
> 
> On Tue, May 29, 2018, at 00:33, Sven Schwedas wrote:
>> After running `setaclmailbox some/mailbox "group:name with
>> spaces" all`,>> all attempts to access the mailbox in any way either result 
>> in an
>> "Invalid identifier" error message, or can't even find the mailbox.
>> 
>> deleteaclmailbox with exactly the same parameters as set doesn't help>> 
>> (same "invalid identifier" error); cyrreconstruct doesn't even
>> find the>> mailbox. Deliveries are deferred as well.
>> 
>> Any ideas how I can recover the mailbox without rolling back
>> the whole>> server to an older backup?
>> 
>> (Cyrus 2.5.10 on Debian stretch, if that matters.)
>> 
>> --
>> Mit freundlichen Grüßen, / Best Regards,
>> Sven Schwedas, Systemadministrator
>> ✉ sven.schwe...@tao.at | ☎ +43 680 301 7167
>> TAO Digital   | Teil der TAO Beratungs- & Management GmbH
>> Lendplatz 45  | FN 213999f/Klagenfurt, FB-Gericht Villach
>> A8020 Graz| https://www.tao-digital.at
>> 
>> 
>> Cyrus Home Page: http://www.cyrusimap.org/
>> List Archives/Info: http://lists.andrew.cmu.edu/pipermail/info-cyrus/>> To 
>> Unsubscribe:
>> https://lists.andrew.cmu.edu/mailman/listinfo/info-cyrus
>> Email had 1 attachment:


>>  * signature.asc 1k (application/pgp-signature)> 
> --
>   Bron Gondwana, CEO, FastMail Pty Ltd
>   br...@fastmailteam.com
> 
> 
> Cyrus Home Page: http://www.cyrusimap.org/
> List Archives/Info: http://lists.andrew.cmu.edu/pipermail/info-cyrus/> To 
> Unsubscribe:
> https://lists.andrew.cmu.edu/mailman/listinfo/info-cyrus

--
  Bron Gondwana, CEO, FastMail Pty Ltd
  br...@fastmailteam.com



Cyrus Home Page: http://www.cyrusimap.org/
List Archives/Info: http://lists.andrew.cmu.edu/pipermail/info-cyrus/
To Unsubscribe:
https://lists.andrew.cmu.edu/mailman/listinfo/info-cyrus

Re: Mailbox inaccessible after setaclmailbox with invalid identifier

2018-05-28 Thread Bron Gondwana
If you use cyr_dbtool you can edit the offending line in mailboxes db.

Clearly there's a bug here too, we should be sanitising group names! Or
at least storing them in a reversible format

On Tue, May 29, 2018, at 00:33, Sven Schwedas wrote:
> After running `setaclmailbox some/mailbox "group:name with
> spaces" all`,> all attempts to access the mailbox in any way either result in 
> an
> "Invalid identifier" error message, or can't even find the mailbox.
> 
> deleteaclmailbox with exactly the same parameters as set doesn't help> (same 
> "invalid identifier" error); cyrreconstruct doesn't even
> find the> mailbox. Deliveries are deferred as well.
> 
> Any ideas how I can recover the mailbox without rolling back the whole> 
> server to an older backup?
> 
> (Cyrus 2.5.10 on Debian stretch, if that matters.)
> 
> --
> Mit freundlichen Grüßen, / Best Regards,
> Sven Schwedas, Systemadministrator
> ✉ sven.schwe...@tao.at | ☎ +43 680 301 7167
> TAO Digital   | Teil der TAO Beratungs- & Management GmbH
> Lendplatz 45  | FN 213999f/Klagenfurt, FB-Gericht Villach
> A8020 Graz| https://www.tao-digital.at
> 
> 
> Cyrus Home Page: http://www.cyrusimap.org/
> List Archives/Info: http://lists.andrew.cmu.edu/pipermail/info-cyrus/> To 
> Unsubscribe:
> https://lists.andrew.cmu.edu/mailman/listinfo/info-cyrus
> Email had 1 attachment:


>  * signature.asc 1k (application/pgp-signature)
--
  Bron Gondwana, CEO, FastMail Pty Ltd
  br...@fastmailteam.com


Cyrus Home Page: http://www.cyrusimap.org/
List Archives/Info: http://lists.andrew.cmu.edu/pipermail/info-cyrus/
To Unsubscribe:
https://lists.andrew.cmu.edu/mailman/listinfo/info-cyrus

Re: Cyrus (Sieve) and external programs

2018-05-28 Thread Sven Schwedas
On 2018-05-28 16:41, Pedro silva wrote:
> Hello,
> 
> I'm trying to set up a spam learning system, and I would like to pipe
> email places in (for example) the SPAM folder to an external program.
> 
> I have cyrus 2.4.17
> 
> Does any one know how or if this is possible in cyrus (or sieve)?

If you want to (read only) process data already received to train your
spam filter, just use the individual mail files in cyrus' spool.

If you want to act on mails being received and possibly delete/redirect
them, you normally want hook into your MTA, not cyrus/sieve.

-- 
Mit freundlichen Grüßen, / Best Regards,
Sven Schwedas, Systemadministrator
✉ sven.schwe...@tao.at | ☎ +43 680 301 7167
TAO Digital   | Teil der TAO Beratungs- & Management GmbH
Lendplatz 45  | FN 213999f/Klagenfurt, FB-Gericht Villach
A8020 Graz| https://www.tao-digital.at



signature.asc
Description: OpenPGP digital signature

Cyrus Home Page: http://www.cyrusimap.org/
List Archives/Info: http://lists.andrew.cmu.edu/pipermail/info-cyrus/
To Unsubscribe:
https://lists.andrew.cmu.edu/mailman/listinfo/info-cyrus

Cyrus (Sieve) and external programs

2018-05-28 Thread Pedro silva
Hello, 

I'm trying to set up a spam learning system, and I would like to pipe
email places in (for example) the SPAM folder to an external program. 

I have cyrus 2.4.17 

Does any one know how or if this is possible in cyrus (or sieve)? 

I wasn't able to find any documentation about using external programs
with sieve. 

Thanks, 

Pedro Silva
Cyrus Home Page: http://www.cyrusimap.org/
List Archives/Info: http://lists.andrew.cmu.edu/pipermail/info-cyrus/
To Unsubscribe:
https://lists.andrew.cmu.edu/mailman/listinfo/info-cyrus

Mailbox inaccessible after setaclmailbox with invalid identifier

2018-05-28 Thread Sven Schwedas
After running `setaclmailbox some/mailbox "group:name with spaces" all`,
all attempts to access the mailbox in any way either result in an
"Invalid identifier" error message, or can't even find the mailbox.

deleteaclmailbox with exactly the same parameters as set doesn't help
(same "invalid identifier" error); cyrreconstruct doesn't even find the
mailbox. Deliveries are deferred as well.

Any ideas how I can recover the mailbox without rolling back the whole
server to an older backup?

(Cyrus 2.5.10 on Debian stretch, if that matters.)

-- 
Mit freundlichen Grüßen, / Best Regards,
Sven Schwedas, Systemadministrator
✉ sven.schwe...@tao.at | ☎ +43 680 301 7167
TAO Digital   | Teil der TAO Beratungs- & Management GmbH
Lendplatz 45  | FN 213999f/Klagenfurt, FB-Gericht Villach
A8020 Graz| https://www.tao-digital.at



signature.asc
Description: OpenPGP digital signature

Cyrus Home Page: http://www.cyrusimap.org/
List Archives/Info: http://lists.andrew.cmu.edu/pipermail/info-cyrus/
To Unsubscribe:
https://lists.andrew.cmu.edu/mailman/listinfo/info-cyrus