Re: folders not visible on copied mail folders

2018-07-19 Thread Kenneth Porter
--On Thursday, July 19, 2018 10:33 PM -0400 Mark Foley  
wrote:



Shortly after this post, I found a solution here:
http://forums.mozillazine.org/viewtopic.php?t=1097725

In order to see the .Dennis\ Email.Dennis\ Inbox sub-folder you have to
collapse and re-expand the folder list in Thunderbird. It's that simple
... AND that annoyingly obscure!


That sometimes works. Sometimes I have to open the Subscribe dialog and 
open/close the new hierarchy there. It's very tedious and annoying. I'd 
love to have a Thunderbird addon that automatically does this, either on 
demand or at every Thunderbird start when an account is first opened.





Re: folders not visible on copied mail folders

2018-07-19 Thread Mark Foley
Shortly after this post, I found a solution here: 
http://forums.mozillazine.org/viewtopic.php?t=1097725

In order to see the .Dennis\ Email.Dennis\ Inbox sub-folder you have to 
collapse and re-expand
the folder list in Thunderbird. It's that simple ... AND that annoyingly 
obscure!

Thanks for your help! --Mark

-Original Message-
From: Mark Foley 
Date: Thu, 19 Jul 2018 21:21:34 -0400
Organization: Ohio Highway Patrol Retirement System
To: dovecot@dovecot.org
Subject: Re: folders not visible on copied mail folders

On Thu, 19 Jul 2018 08:11:40 +0200 Steffen Kaiser  
wrote:
>
> On Thu, 19 Jul 2018, Mark Foley wrote:
> > On Wed, 18 Jul 2018 07:23:06 +0200 Steffen Kaiser  
> > wrote:
> >>
> >> On Tue, 17 Jul 2018, Mark Foley wrote:
> >>> On Tue, 17 Jul 2018 08:06:24 +0200 Steffen Kaiser 
> >>>  wrote:
> 
>  On Mon, 16 Jul 2018, Mark Foley wrote:
> 
> > We had a user quit recently.  Three days ago I copied his entire 
> > Maildir folder to another user
> > to that user's Maildir/.JoesEmail.  I changed ownership and made the 
> > permission 'chmod -R
> > og-rwx .', just like all the other files/directories of the new owner.  
> > This didn't work to show
> > the new folder.  Today, in his Thunderbird client, I subscribed to the 
> > 'JoesEmail' folder.  I
> > restarted dovecot and restarted Thunderbird.
> >
> > In Thunderbird, the 'JoesEmail' folder now shows, but it is empty and 
> > shows none of the
> > subordinate mail folders.  I ran 'doveadm index -u newowner JoesEmail' 
> > and
> > 'doveadm force-resync -u newowner JoesEmail'.  This didn't help.
> >
> > I did this once before with a previous user who quit and only changed 
> > ownership, no
> > subscribing, no doveadm, and that worked.
> >
> > What am I doing wrong?
> 
>  Your description might be interpreted one way or another, esp. "copied 
>  his
>  entire Maildir folder ... to that user's Maildir/.JoesEmail".
> 
>  Also, it depends on how you have configured mail_location.
> 
>  If this means that you have:
>  Maildir/.JoesEmail/{new,cur,tmp}
>  Maildir/.JoesEmail/.mailbox/{new,cur,tmp}
>  Maildir/.JoesEmail/.mailbox.submailbox/{new,cur,tmp}
>  now, that will clash with the standard Maildir format:
>  https://wiki2.dovecot.org/MailboxFormat/Maildir
> 
>  You would need to move the subfolders with a leading dot of .JoesEmail
>  into:
>  Maildir/.JoesEmail/{new,cur,tmp}
>  Maildir/.JoesEmail.mailbox/{new,cur,tmp}
>  Maildir/.JoesEmail.mailbox.submailbox/{new,cur,tmp}
> 
>  If you use :LAYOUT=fs to mail_location, .JoesEmail should spell JoesEmail
> 
>  Subscription is needed only, if the mail client "displays subscribed
>  folders only" or does not "display all folders". The meaning of the
>  setting varies from client to client.
> 
>  Another way would to keep the other account and share it via ACLs:
>  https://wiki2.dovecot.org/SharedMailboxes/Shared
> 
>  Steffen Kaiser
> >>>
> >>> Steffen, thanks for your reply. I did have the copied folders as shown in 
> >>> your first example. I
> >>> changed that to what you show as the remedy. The target user's Maildir 
> >>> folder now has:
> >>>
> >>> drwx--  5 mpress domusers   4096 2017-06-28 20:07 .Deleted\ 
> >>> Messages.Junk/
> >>> drwx--  5 mpress domusers   4096 2018-07-16 23:22 .Delta\ Dental/
> >>> drwx-- 21 mpress domusers   4096 2018-07-17 16:48 .Dennis\ Email/
> >>> drwx--  5 mpress domusers   4096 2018-07-16 23:15 .Dennis\ 
> >>> Email.Deleted\ Items/
> >>> drwx--  5 mpress domusers   4096 2018-07-16 23:15 .Dennis\ 
> >>> Email.Deleted\ Items.Sent/
> >>> drwx--  5 mpress domusers   4096 2018-07-17 17:02 .Drafts/
> >>> drwx--  5 mpress domusers   4096 2018-07-17 16:35 .ESI/
> >>>
> >>> Where '.Dennis Email' is the folder for the old user. I copied the old 
> >>> user's 'Maildir/.Deleted Items'
> >>> and 'Maildir/.Deleted Items/Sent' to the target user's 'Maildir/.Dennis 
> >>> Email.Deleted Items'
> >>> and 'Maildir/.Deleted Items/Sent, respective. That how I understood what 
> >>> you advised. There are
> >>> more such subfolders, but I thought I'd try this one first.
> >>
> >>> However, still only the "Dennis Email" folder shows in the mail client, 
> >>> empty, no sub-folders
> >>> even though "Deleted Items.Sent/cur" has plenty of mail files (1522).
> >>>
> >>> I did try running 'doveadm index -u mpress "Dennis Email"', again; and 
> >>> restarting dovecot and
> >>> thunderbird again, but still nothing.
> >>
> >> First check if Dovecot thinks the folders are there:
> >>
> >> doveadm mailbox list -u "mpress" | grep Dennis
> >
> > yes:
> >
> > # doveadm mailbox list -u "mpress" | grep Dennis
> > Dennis Email
> > Dennis Email.Deleted Items
> > Dennis Email.Deleted Items.Sent
>
> That means: Dovecot sees them, but your client is not.
> Are you ab

Re: folders not visible on copied mail folders

2018-07-19 Thread Mark Foley
On Thu, 19 Jul 2018 08:11:40 +0200 Steffen Kaiser  
wrote:
>
> On Thu, 19 Jul 2018, Mark Foley wrote:
> > On Wed, 18 Jul 2018 07:23:06 +0200 Steffen Kaiser  
> > wrote:
> >>
> >> On Tue, 17 Jul 2018, Mark Foley wrote:
> >>> On Tue, 17 Jul 2018 08:06:24 +0200 Steffen Kaiser 
> >>>  wrote:
> 
>  On Mon, 16 Jul 2018, Mark Foley wrote:
> 
> > We had a user quit recently.  Three days ago I copied his entire 
> > Maildir folder to another user
> > to that user's Maildir/.JoesEmail.  I changed ownership and made the 
> > permission 'chmod -R
> > og-rwx .', just like all the other files/directories of the new owner.  
> > This didn't work to show
> > the new folder.  Today, in his Thunderbird client, I subscribed to the 
> > 'JoesEmail' folder.  I
> > restarted dovecot and restarted Thunderbird.
> >
> > In Thunderbird, the 'JoesEmail' folder now shows, but it is empty and 
> > shows none of the
> > subordinate mail folders.  I ran 'doveadm index -u newowner JoesEmail' 
> > and
> > 'doveadm force-resync -u newowner JoesEmail'.  This didn't help.
> >
> > I did this once before with a previous user who quit and only changed 
> > ownership, no
> > subscribing, no doveadm, and that worked.
> >
> > What am I doing wrong?
> 
>  Your description might be interpreted one way or another, esp. "copied 
>  his
>  entire Maildir folder ... to that user's Maildir/.JoesEmail".
> 
>  Also, it depends on how you have configured mail_location.
> 
>  If this means that you have:
>  Maildir/.JoesEmail/{new,cur,tmp}
>  Maildir/.JoesEmail/.mailbox/{new,cur,tmp}
>  Maildir/.JoesEmail/.mailbox.submailbox/{new,cur,tmp}
>  now, that will clash with the standard Maildir format:
>  https://wiki2.dovecot.org/MailboxFormat/Maildir
> 
>  You would need to move the subfolders with a leading dot of .JoesEmail
>  into:
>  Maildir/.JoesEmail/{new,cur,tmp}
>  Maildir/.JoesEmail.mailbox/{new,cur,tmp}
>  Maildir/.JoesEmail.mailbox.submailbox/{new,cur,tmp}
> 
>  If you use :LAYOUT=fs to mail_location, .JoesEmail should spell JoesEmail
> 
>  Subscription is needed only, if the mail client "displays subscribed
>  folders only" or does not "display all folders". The meaning of the
>  setting varies from client to client.
> 
>  Another way would to keep the other account and share it via ACLs:
>  https://wiki2.dovecot.org/SharedMailboxes/Shared
> 
>  Steffen Kaiser
> >>>
> >>> Steffen, thanks for your reply. I did have the copied folders as shown in 
> >>> your first example. I
> >>> changed that to what you show as the remedy. The target user's Maildir 
> >>> folder now has:
> >>>
> >>> drwx--  5 mpress domusers   4096 2017-06-28 20:07 .Deleted\ 
> >>> Messages.Junk/
> >>> drwx--  5 mpress domusers   4096 2018-07-16 23:22 .Delta\ Dental/
> >>> drwx-- 21 mpress domusers   4096 2018-07-17 16:48 .Dennis\ Email/
> >>> drwx--  5 mpress domusers   4096 2018-07-16 23:15 .Dennis\ 
> >>> Email.Deleted\ Items/
> >>> drwx--  5 mpress domusers   4096 2018-07-16 23:15 .Dennis\ 
> >>> Email.Deleted\ Items.Sent/
> >>> drwx--  5 mpress domusers   4096 2018-07-17 17:02 .Drafts/
> >>> drwx--  5 mpress domusers   4096 2018-07-17 16:35 .ESI/
> >>>
> >>> Where '.Dennis Email' is the folder for the old user. I copied the old 
> >>> user's 'Maildir/.Deleted Items'
> >>> and 'Maildir/.Deleted Items/Sent' to the target user's 'Maildir/.Dennis 
> >>> Email.Deleted Items'
> >>> and 'Maildir/.Deleted Items/Sent, respective. That how I understood what 
> >>> you advised. There are
> >>> more such subfolders, but I thought I'd try this one first.
> >>
> >>> However, still only the "Dennis Email" folder shows in the mail client, 
> >>> empty, no sub-folders
> >>> even though "Deleted Items.Sent/cur" has plenty of mail files (1522).
> >>>
> >>> I did try running 'doveadm index -u mpress "Dennis Email"', again; and 
> >>> restarting dovecot and
> >>> thunderbird again, but still nothing.
> >>
> >> First check if Dovecot thinks the folders are there:
> >>
> >> doveadm mailbox list -u "mpress" | grep Dennis
> >
> > yes:
> >
> > # doveadm mailbox list -u "mpress" | grep Dennis
> > Dennis Email
> > Dennis Email.Deleted Items
> > Dennis Email.Deleted Items.Sent
>
> That means: Dovecot sees them, but your client is not.
> Are you absolutely sure the client is set to "display all folders"?
> Secondly, make sure Thunderbird rescans the folders. Sometimes you need to 
> collapse *certain* levels and expand them. I mean, collaps the whole tree 
> of the account, then expand it again, see if the triangle in front of 
> Dennis Email appeared, tap there, a.s.o. I have a Thunderbird client, that 
> for whatever reason I don't know, "forgets" about a certain hierarchie 
> (subtree) now and then.
>
> As another test, you could speak IMAP:
>
> telnet localhost 143

Re: doveadm expunge didn't clear Trash mailbox

2018-07-19 Thread Joseph Tam

On Wed, 18 Jul 2018, Joseph Tam wrote:


I wrote about a related issue several years back, starting with

https://dovecot.org/list/dovecot/2012-March/134706.html

I'm not sure how I got over this and got usable "date.saved" cache values,
and why it stopped working.  Maybe I need to set something like

mail_always_cache_fields = date.saved
mail_cache_fields = date.saved

to force date.saved to be cached.


This doesn't work -- it's not a cachable value.

To get around the wonky date.saved values, I used date.received
instead, which seems to have more reliable values

doveadm -f tab fetch -u {user} "uid date.received" mailbox {box}

and the corresponding expunge command would be

doveadm expunge -u {user} mailbox {box} BEFORE {time-limit}

It not quite the same as it's not the time it was copied into
{box} but rather, the internal date, which may be earlier (i.e when
it was received).

Joseph Tam 


Stopping login via "nologin" parameter

2018-07-19 Thread J Doe
Hello,

I have a basic e-mail server with Postfix 3.1 and Dovecot 2.2.22.

I am using a passwd-file for both userdb and passdb:

/etc/dovecot/dovecot.conf
userdb {
driver = passwd-file
args = /etc/dovecot/passwd
}

passdb {
driver = passwd-file
args = /etc/dovecot/passwd
}
}

In the passwd file, I want to have user account names for SMTP SASL AUTH and 
IMAP that are NOT e-mail addresses.

For example, employee one of ABC corp would have a SMTP SASL AUTH/IMAP account 
name in the form: abc_company_employeeid (for example: abc_company_03284).  The 
idea behind that is that I do not want someone outside of the company to be 
able to know the first half of the username and password pair just because they 
have an employee's e-mail address.

For the e-mail address I specify something like: b...@abc.com however I never 
want someone to be able to login via their e-mail address.  Originally, I 
specified the password field as empty, with the understanding being that the 
default encryption of a password is {CRYPT}.  Since crypt() cannot output a 
null string, this meant that there was never a valid password.

So passwd looked like this:

/etc/dovecot/passwd
# SMTP SASL AUTH and IMAP accounts

abc_company_03284:::userdb_mail=maildir:/var/mail/vhosts/abc.com/abc_company_03284

# IMAP

b...@abc.com:vmail:vmail::/home/vmail/bob::userdb_maill=maildir:/var/mail/vhosts/abc.com/abc_company_03284

I tested SMTP SASL AUTH and IMAP via the openssl s_client and can confirm that 
I can login and send e-mail as well as retrieve mail only via the: 
abc_company_03284 account, but because an empty password field isn’t mentioned 
on the Dovecot wiki, I was wondering if I should add “nologin” to explicitly 
make it impossible for: b...@abc.com.  “nologin” was mentioned to me in a 
previous e-mail to this list.

So passwd would now look like this:

/etc/dovecot/passwd
# SMTP SASL AUTH and IMAP accounts

abc_company_03284:::userdb_mail=maildir:/var/mail/vhosts/abc.com/abc_company_03284

# IMAP

b...@abc.com:vmail:vmail::/home/vmail/bob::userdb_mail=maildir:/var/mail/vhosts/abc.com/abc_company_03284
 nologin

I restarted Dovecot and tested this with openssl s_client for SMTP SASL AUTH 
and IMAP, but just wanted to make sure that this STOPS ANY LOGINS via the 
e-mail address: b...@abc.com ?

Thanks,

- J



Re: 100% Dovecot MTA Replacement Setup

2018-07-19 Thread Michael Slusarz
> On July 19, 2018 at 9:41 AM David Favor  wrote:
> 
> 
> Working out upgrade of old 1.x + 2.x Dovecot installs to
> latest 2.3.2.1 out of Ubuntu Bionic repositories.
> ___
> 
> https://wiki.dovecot.org/Services suggests Dovecot can
> be used for full mail infrastructure, avoiding the
> complexity of exim4 or other MTA setup/management.
> 
> Let me know if I understand this correctly.
> 
> 1) https://wiki.dovecot.org/Submission can be used to
> listen on port 25 + port 587 (with auth).

This is a proxy only.  For any non-local delivery, you still need a submission 
server to deliver (and queue) mail remotely.  That requires a full SMTP service 
running somewhere.


> 2) https://wiki.dovecot.org/Pigeonhole can be used for
> filtering, including forwarding email to other machines.
> 
> 3) https://wiki.dovecot.org/Pigeonhole/ManageSieve/Configuration
> can be used to forward off machine email, for example flowing
> through a relay service like MailGun, using a simple script
> or service like ESMTPD.
> 
> 4) https://wiki.dovecot.org/LMTP can be used to deposit messages
> into filesystem as Maildir or dbox or mdbox backing stores.

michael


100% Dovecot MTA Replacement Setup

2018-07-19 Thread David Favor

Working out upgrade of old 1.x + 2.x Dovecot installs to
latest 2.3.2.1 out of Ubuntu Bionic repositories.
___

https://wiki.dovecot.org/Services suggests Dovecot can
be used for full mail infrastructure, avoiding the
complexity of exim4 or other MTA setup/management.

Let me know if I understand this correctly.

1) https://wiki.dovecot.org/Submission can be used to
   listen on port 25 + port 587 (with auth).

2) https://wiki.dovecot.org/Pigeonhole can be used for
   filtering, including forwarding email to other machines.

3) https://wiki.dovecot.org/Pigeonhole/ManageSieve/Configuration
   can be used to forward off machine email, for example flowing
   through a relay service like MailGun, using a simple script
   or service like ESMTPD.

4) https://wiki.dovecot.org/LMTP can be used to deposit messages
   into filesystem as Maildir or dbox or mdbox backing stores.


Re: Replication problems

2018-07-19 Thread Gerald Galster
Hello Thomas,

which version of dovecot do you use?

I'm running a dovecot cluster with 2 servers and dsync replication with ssh (no 
loadbalancer but active/active with same priority dns mx records).
dsync replicates some emails back after they have been deleted on one node. For 
me this started after 2.2.33.2. No solution yet.
If you're using a 2.2 version you could try 2.2.33.2.

Best regards,
Gerald


> Am 19.07.2018 um 14:13 schrieb Thomas Kristensen :
> 
> Hey 
>  
> I am trying to setup a dovecot cluster with 2 servers using replication 
> /dsync.
>  
> In front of it I got a Fortinet ADC (Load balance) and I think that I messing 
> up the dsync.
> I see mails duplicated in the sync progress.
>  
> If I disable one of the servers in the ADC, it seems to work and the sync if 
> working without a problem.
> But if I use both servers with a round robin on the ADC, I see mailed 
> duplicated.
> Ex. I sent 100 mails thru the SMTP (Postfix) and 107 mails is in both 
> servers, but as said before, if I disable one of the servers in the ADC, I 
> see the correct amount of mails in both dovecot servers.
>  
> In the header of the duplicated mails I see the exact same postfix id and 
> LMTP id from dovecot.
>  
> Also I cant seem to get any log from the sync progress.
>  
> Med venlig hilsen
> Thomas Kristensen
> 
> Storhaven 12 - 7100 Vejle
> Tlf: 75 72 54 99 - Fax: 75 72 65 33
> E-mail: t...@multimed.dk
>  
> Denne e-mail kan indeholde fortrolig information. Hvis du ikke er den rette 
> modtager af denne e-mail eller hvis du modtager den ved en fejltagelse, beder 
> vi dig venligst informere afsender om fejlen ved at bruge svarfunktionen. 
> Samtidig bedes du slette e-mailen med det samme uden at videresende eller 
> kopiere den.
> 



Replication problems

2018-07-19 Thread Thomas Kristensen
Hey

I am trying to setup a dovecot cluster with 2 servers using replication /dsync.

In front of it I got a Fortinet ADC (Load balance) and I think that I messing 
up the dsync.
I see mails duplicated in the sync progress.

If I disable one of the servers in the ADC, it seems to work and the sync if 
working without a problem.
But if I use both servers with a round robin on the ADC, I see mailed 
duplicated.
Ex. I sent 100 mails thru the SMTP (Postfix) and 107 mails is in both servers, 
but as said before, if I disable one of the servers in the ADC, I see the 
correct amount of mails in both dovecot servers.

In the header of the duplicated mails I see the exact same postfix id and LMTP 
id from dovecot.

Also I cant seem to get any log from the sync progress.

Med venlig hilsen
Thomas Kristensen
[MM_mail_logo_3_AS]
Storhaven 12 - 7100 Vejle
Tlf: 75 72 54 99 - Fax: 75 72 65 33
E-mail: t...@multimed.dk