1

Topic: Sieve is creating a duplicated maildir folder

- iRedMail version (check /etc/iredmail-release): iRedMail-0.9.5-1
- Linux/BSD distribution name and version: Ubuntu 14.04.4 LTS
- Store mail accounts in which backend (LDAP/MySQL/PGSQL): Windows 2003 Active Directory
- Web server (Apache or Nginx): Apache/2.4.7 (Ubuntu)
- Manage mail accounts with iRedAdmin-Pro? No
- Related log if you're reporting an issue: as follows...
====
Hi!
   When I enable Sieve in SOGo.conf, it creates a folder called maildir under users mail folders, but there is already a folder called Maildir there - the difference is that one is lowercase (Sieve's maildir) and the other one is uppercase (Dovecot's Maildir).
   How can I configure Sieve to create its folder inside Dovecot's Maildir?

Thank you!

----

Spider Email Archiver: On-Premises, lightweight email archiving software developed by iRedMail team. Supports Amazon S3 compatible storage and custom branding.

2

Re: Sieve is creating a duplicated maildir folder

I don't get it.

SOGo connects to managesieve service (offered by Dovecot) to manage sieve rules, so it doesn't create the folder itself, but Dovecot does.

Maybe you have some typo in Dovecot config file?

P.S. SOGo stores sieve rules in its SQL db first, then dump to server through managesieve service. And it's incompatible with Roundcube. Don't enable sieve support in both Roundcube and SOGo.

3 (edited by zuotoski 2017-01-19 00:59:49)

Re: Sieve is creating a duplicated maildir folder

ZhangHuangbin wrote:

I don't get it.

SOGo connects to managesieve service (offered by Dovecot) to manage sieve rules, so it doesn't create the folder itself, but Dovecot does.

Maybe you have some typo in Dovecot config file?

P.S. SOGo stores sieve rules in its SQL db first, then dump to server through managesieve service. And it's incompatible with Roundcube. Don't enable sieve support in both Roundcube and SOGo.

Thanks for reply, I really appreciate it smile - Yes, I understand all that and also don't get it. There is no typo or anything in dovecot.conf or any other configuration file. The thing is that when I enable Sieve in sogo.conf (the file that comes with iRedmail setup), it creates another maildir folder, as I am in a Linux OS., uppercase and lowercase are sensitive, resulting in two folders.

Here are the segments that has something to do with maildir folder creation in my /etc/dovecot/dovecot.conf:

mail_location = maildir:%Lh/Maildir/:INDEX=%Lh/Maildir/
    location = maildir:/var/vmail/vmail1/%Ld/%%Ln/Maildir/:INDEXPVT=/var/vmail/vmail1/%Ld/%%Ln/Maildir/Shared/%%u

A here is the only segment that has something to do with maildir folder creation in my /etc/dovecot/dovecot-ldap.conf:

user_attrs      = =home=/var/vmail/vmail1/%Ld/%Ln/Maildir/,=mail=maildir:/var/vmail/vmail1/%Ld/%Ln/Maildir/,=quota_rule=*:storage=%{ldap:ipPhone}M

   Before asking for support here, I've spent the entire morning trying to find an answer.

Well, thank you for your time and help.

4

Re: Sieve is creating a duplicated maildir folder

Tried with SOGo, cannot reproduce this issue. sad

How about create a new mail user for testing? so that we get a empty mailbox and easier to check whether it's created by sogo.

5 (edited by zuotoski 2018-09-29 03:08:22)

Re: Sieve is creating a duplicated maildir folder

ZhangHuangbin wrote:

Tried with SOGo, cannot reproduce this issue. sad

How about create a new mail user for testing? so that we get a empty mailbox and easier to check whether it's created by sogo.

I could reproduce it with a new user. Here are the steps:

1 - Created a new AD user;
2 - SOGo, Login with the new user;
3 - Went to Preferences -> Mail -> Vacantion;
4 - Marked "Enable vacation auto reply";
5 - Went back to INBOX without saving.

Ended up with this:

PunBB bbcode test

6

Re: Sieve is creating a duplicated maildir folder

Really no idea at all ... sad

Any file/directory in the "maildir"?

7 (edited by zuotoski 2017-01-19 18:03:52)

Re: Sieve is creating a duplicated maildir folder

ZhangHuangbin wrote:

Really no idea at all ... sad

Any file/directory in the "maildir"?

Yes, there is a "sieve" folder, which contains an empty folder called "tmp".

It may not be a big deal if I can achieve what I am trying to do. I am trying to mount a NTFS sharing, and move the mail folders to this mounted driver. If I succeed, then it will not be a problem, because Windows isn't case sensitive, so folders "maildir" and "Maildir" will be the same.

Yesterday I was able to mount the driver and access my e-mails using SOGo and Outlook, I could send and receive e-mail and the new files were created in Windows share. But I couldn't share mail folders, like my Inbox, for example, it just didn't "remember" the sharing after logging out.

Another problem is that it is not mounting the driver automatically when booting the system, sometimes it hangs and sometimes it asks me to interact by pressing "s" or "m" to skip or manual recover.

So, if I make it work, then the duplicated folders will not be a problem for me anymore.

I'll let you know if I succeed or not.

8

Re: Sieve is creating a duplicated maildir folder

Oh, a NTFS file system, i guess the "maildir" issue is caused by NTFS.

if you use a Linux file system, it should be fine.

9

Re: Sieve is creating a duplicated maildir folder

I know this is an old topic but I have just faced this problem.

in /dovecot/dovecot.conf we had:
sieve_dir = %Lh/sieve
sieve = %Lh/sieve/dovecot.sieve

That %Lh was doing the mess, just leaving it like this:

sieve_dir = %h/sieve
sieve = %h/sieve/dovecot.sieve

made the trick.

I hope this help someone wink

10

Re: Sieve is creating a duplicated maildir folder

vidalin wrote:

That %Lh was doing the mess, just leaving it like this:

"L" is used to convert strings to lower case, why does it cause the mess?

11

Re: Sieve is creating a duplicated maildir folder

ZhangHuangbin wrote:
vidalin wrote:

That %Lh was doing the mess, just leaving it like this:

"L" is used to convert strings to lower case, why does it cause the mess?

The home folder (%h) is something like /var/xxxxx/user_name/Maildir
If we use %Lh it puts the string in lowercase so it's: /var/xxxxx/user_name/maildir and there is where the duplicated folder comes out.

In short:

%h = /user_name/Maildir
%Lh = /user_name/maildir

I'm trying to explain myself but English it's not my first language, sorry about that.

12

Re: Sieve is creating a duplicated maildir folder

vidalin wrote:

%h = /user_name/Maildir
%Lh = /user_name/maildir

This is not right.

%h or %Lh should be just /var/vmail/vmail1/.../user_name/, but no 'Maildir' appended.

13 (edited by vidalin 2018-10-02 22:57:29)

Re: Sieve is creating a duplicated maildir folder

ZhangHuangbin wrote:
vidalin wrote:

%h = /user_name/Maildir
%Lh = /user_name/maildir

This is not right.

%h or %Lh should be just /var/vmail/vmail1/.../user_name/, but no 'Maildir' appended.

Yes, you're correct, %h is home dir not mail dir, sorry.

But the fact is that removing the %L did the trick for me (luckily :$).  I didn't find any config file where  I manually append "Maildir" so it can be some kind of bug, I'm not sure, I'll give it another try this evening and keep this updated.

UPDATE:

I think I've found it, I have this configuration line:
user_attrs      = =home=/var/vmail/vmail1/%Ld/%Ln/Maildir/,=mail=maildir:/var/vmail/vmail1/%Ld/%Ln/Maildir/

That makes "home" and "Maildir" the same so that's because that "L" created the /maildir,  am I right?

The value for user_attrs is from: https://docs.iredmail.org/active.directory.html

14

Re: Sieve is creating a duplicated maildir folder

I think this is a mistake of our tutorial, "home" should be without '/Maildir'. I will update the doc immediately.

15

Re: Sieve is creating a duplicated maildir folder

UPDATE: Doc has been updated, and I make it even simpler (but return same value):

user_attrs      = =home=/var/vmail/vmail1/%Ld/%Ln/,=mail=maildir:~/Maildir/