Gnus development mailing list
 help / color / mirror / Atom feed
* Yet another thread about Gnus, isync and dovecot mail stack
@ 2022-08-07 18:34 bk
  2022-08-07 20:25 ` bk
  2022-08-08 15:59 ` Eric Abrahamsen
  0 siblings, 2 replies; 6+ messages in thread
From: bk @ 2022-08-07 18:34 UTC (permalink / raw)
  To: ding

Hi,
I am asking you about help with basic configuration and available 
sources [1][2][3] are not enough for me.
Using mbsync I successfully synchronize e-mails with my IMAP provider. I 
have problem with connection from Gnus to local dovecot server and I'm 
stuck now.

Current configuration of ~/.mbsyncrc (inspired heavily on [4]:
IMAPAccount gandi
Host mail.gandi.net
User bk@asterio.cloud
PassCmd "/usr/bin/pass email/bk"
SSLType IMAPS
CertificateFile /var/lib/ca-certificates/ca-bundle.pem

IMAPStore gandi-remote
Account gandi

MaildirStore gandi-local
SubFolders Verbatim
Path ~/.mail/gandi/
Inbox ~/.mail/gandi/Inbox

Channel gandi
Far :gandi-remote:
Near :gandi-local:
Patterns *
Create Both
Expunge Both
SyncState *

My /etc/dovecot/dovecot.conf contains (inspired Eric's post and [5]):
protocols = imap
listen = localhost
ssl = no
disable_plaintext_auth = no
mail_location = maildir:~/.mail:LAYOUT=fs
auth_verbose = yes
auth_mechanisms = plain login
passdb {
   driver = passwd-file
   args = /etc/dovecot/passwd
}
userdb {
   driver = static
   args = uid=bk gid=users home=/home/bk
}

And finally my ~/.gnus is simply:
(setq gnus-select-method
       '(nnimap "asterio.cloud"
	       (nnimap-stream network)
	       (nnimap-address "localhost")
	       (nnimap-authenticator login)
	       (nnimap-user "bk")))

During connection Gnus I see logs in *MESSAGES* buffer:
Opening nnimap server on asterio.cloud...failed: BAD NULs not allowed in 
strings

dovecot logs says:
imap-login: Disconnected: Connection closed (no auth attempts in 2 
secs): user=<>, rip=::1, lip=::1, secured, 
session=<bnKv3qrl+rcAAAAAAAAAAAAAAAAAAAAB>

What I can check more?

1. https://ericabrahamsen.net/tech/2014/oct/gnus-dovecot-lucene.html
2. https://github.com/gongzhitaao/GnusSolution
3. https://www.mail-archive.com/info-gnus-english@gnu.org/msg13957.html
4. https://wiki.archlinux.org/title/isync#Configuring
5. 
https://doc.dovecot.org/configuration_manual/howto/simple_virtual_install/


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Yet another thread about Gnus, isync and dovecot mail stack
  2022-08-07 18:34 Yet another thread about Gnus, isync and dovecot mail stack bk
@ 2022-08-07 20:25 ` bk
  2022-08-08 15:18   ` Greg Troxel
  2022-08-08 15:59 ` Eric Abrahamsen
  1 sibling, 1 reply; 6+ messages in thread
From: bk @ 2022-08-07 20:25 UTC (permalink / raw)
  To: ding

Hi again...
I made some changes and fix paths in both dovecot and mbsync configs and 
successfully login to dovecot, but I receive some errors about 
permissions:
Aug 07 22:14:53 localhost.localdomain dovecot[4724]: 
imap(bk@asterio)<4732><kKkwWqzl1OEAAAAAAAAAAAAAAAAAAAAB>: Error: 
mkdir(/home/bk/.mail/asterio/bk) failed: Permission denied 
(euid=1000(bk) egid=1000(bk) UNIX perms appear ok (ACL/MAC wrong?))
Aug 07 22:14:53 localhost.localdomain dovecot[4724]: 
imap(bk@asterio)<4732><kKkwWqzl1OEAAAAAAAAAAAAAAAAAAAAB>: Error: 
mkdir(/home/bk/.mail/asterio/bk) failed: Permission denied 
(euid=1000(bk) egid=1000(bk) UNIX perms appear ok (ACL/MAC wrong?))
Aug 07 22:14:53 localhost.localdomain dovecot[4724]: 
imap(bk@asterio)<4732><kKkwWqzl1OEAAAAAAAAAAAAAAAAAAAAB>: Error: 
mkdir(/home/bk/.mail/asterio/bk) failed: Permission denied 
(euid=1000(bk) egid=1000(bk) UNIX perms appear ok (ACL/MAC wrong?))
Aug 07 22:14:53 localhost.localdomain dovecot[4724]: 
imap(bk@asterio)<4732><kKkwWqzl1OEAAAAAAAAAAAAAAAAAAAAB>: Error: Mailbox 
INBOX: Failed to autocreate mailbox: Internal error occurred. Refer to 
server log for more information. [2022-08-07 22:14:53]

Changes in dovecot.conf:
userdb {
        driver = static
        args = uid=bk gid=bk home=/home/bk/.mail/%d/%n
        default_fields = mail=maildir:/home/bk/.mail/%d/%n
}

in .mbsyncrc:
Path ~/.mail/asterio.cloud/bk/
Inbox ~/.mail/asterio.cloud/bk/Inbox

Permissions of ~/.mail/asterio/bk:
drwxr-xr-x 1 bk bk 62 Aug  7 22:23 /home/bk/.mail/asterio.cloud/bk


On 2022-08-07 20:34, bk@asterio.cloud wrote:
> Hi,
> I am asking you about help with basic configuration and available
> sources [1][2][3] are not enough for me.
> Using mbsync I successfully synchronize e-mails with my IMAP provider.
> I have problem with connection from Gnus to local dovecot server and
> I'm stuck now.
> 
> Current configuration of ~/.mbsyncrc (inspired heavily on [4]:
> IMAPAccount gandi
> Host mail.gandi.net
> User bk@asterio.cloud
> PassCmd "/usr/bin/pass email/bk"
> SSLType IMAPS
> CertificateFile /var/lib/ca-certificates/ca-bundle.pem
> 
> IMAPStore gandi-remote
> Account gandi
> 
> MaildirStore gandi-local
> SubFolders Verbatim
> Path ~/.mail/gandi/
> Inbox ~/.mail/gandi/Inbox
> 
> Channel gandi
> Far :gandi-remote:
> Near :gandi-local:
> Patterns *
> Create Both
> Expunge Both
> SyncState *
> 
> My /etc/dovecot/dovecot.conf contains (inspired Eric's post and [5]):
> protocols = imap
> listen = localhost
> ssl = no
> disable_plaintext_auth = no
> mail_location = maildir:~/.mail:LAYOUT=fs
> auth_verbose = yes
> auth_mechanisms = plain login
> passdb {
>   driver = passwd-file
>   args = /etc/dovecot/passwd
> }
> userdb {
>   driver = static
>   args = uid=bk gid=users home=/home/bk
> }
> 
> And finally my ~/.gnus is simply:
> (setq gnus-select-method
>       '(nnimap "asterio.cloud"
> 	       (nnimap-stream network)
> 	       (nnimap-address "localhost")
> 	       (nnimap-authenticator login)
> 	       (nnimap-user "bk")))
> 
> During connection Gnus I see logs in *MESSAGES* buffer:
> Opening nnimap server on asterio.cloud...failed: BAD NULs not allowed 
> in strings
> 
> dovecot logs says:
> imap-login: Disconnected: Connection closed (no auth attempts in 2
> secs): user=<>, rip=::1, lip=::1, secured,
> session=<bnKv3qrl+rcAAAAAAAAAAAAAAAAAAAAB>
> 
> What I can check more?
> 
> 1. https://ericabrahamsen.net/tech/2014/oct/gnus-dovecot-lucene.html
> 2. https://github.com/gongzhitaao/GnusSolution
> 3. https://www.mail-archive.com/info-gnus-english@gnu.org/msg13957.html
> 4. https://wiki.archlinux.org/title/isync#Configuring
> 5. 
> https://doc.dovecot.org/configuration_manual/howto/simple_virtual_install/


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Yet another thread about Gnus, isync and dovecot mail stack
  2022-08-07 20:25 ` bk
@ 2022-08-08 15:18   ` Greg Troxel
  2022-08-10  6:38     ` Bartosz Kaczyński
  0 siblings, 1 reply; 6+ messages in thread
From: Greg Troxel @ 2022-08-08 15:18 UTC (permalink / raw)
  To: bk; +Cc: ding

[-- Attachment #1: Type: text/plain, Size: 426 bytes --]


It sounds like you really have a dovecot problem, not a gnus problem.
dovecot needs to be able to write to your mailstore.

I would suggest pointing some other imap client against it and seeing
what's happens.

usually people start dovecot as root, have some kind of user/pass
login, and  dovecot setuid's to the use.

I have been using gnus with dovecot for a very long time, maybe 2005 or
2006, with no permissions issues.

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 194 bytes --]

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Yet another thread about Gnus, isync and dovecot mail stack
  2022-08-07 18:34 Yet another thread about Gnus, isync and dovecot mail stack bk
  2022-08-07 20:25 ` bk
@ 2022-08-08 15:59 ` Eric Abrahamsen
  2022-08-10  6:34   ` Bartosz Kaczyński
  1 sibling, 1 reply; 6+ messages in thread
From: Eric Abrahamsen @ 2022-08-08 15:59 UTC (permalink / raw)
  To: ding

bk@asterio.cloud writes:

> Hi,
> I am asking you about help with basic configuration and available
> sources [1][2][3] are not enough for me.
> Using mbsync I successfully synchronize e-mails with my IMAP provider.
> I have problem with connection from Gnus to local dovecot server and
> I'm stuck now.
>
> Current configuration of ~/.mbsyncrc (inspired heavily on [4]:
> IMAPAccount gandi
> Host mail.gandi.net
> User bk@asterio.cloud
> PassCmd "/usr/bin/pass email/bk"
> SSLType IMAPS
> CertificateFile /var/lib/ca-certificates/ca-bundle.pem
>
> IMAPStore gandi-remote
> Account gandi
>
> MaildirStore gandi-local
> SubFolders Verbatim
> Path ~/.mail/gandi/
> Inbox ~/.mail/gandi/Inbox

You're using a local maildir store, but trying to connect to it with a
local IMAP server. Either have mbsync use MaildirStore and connect to it
directly with Gnus' nnmaildir, OR use IMAPStore/IMAPAccount to talk to
local Dovecot, and have Gnus connect to Dovecot with nnimap.



^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Yet another thread about Gnus, isync and dovecot mail stack
  2022-08-08 15:59 ` Eric Abrahamsen
@ 2022-08-10  6:34   ` Bartosz Kaczyński
  0 siblings, 0 replies; 6+ messages in thread
From: Bartosz Kaczyński @ 2022-08-10  6:34 UTC (permalink / raw)
  To: Eric Abrahamsen, ding

Thank you, that was useful. I didn't notice that difference in you setup.

On 8/8/22 17:59, Eric Abrahamsen wrote:
> bk@asterio.cloud writes:
>
>> Hi,
>> I am asking you about help with basic configuration and available
>> sources [1][2][3] are not enough for me.
>> Using mbsync I successfully synchronize e-mails with my IMAP provider.
>> I have problem with connection from Gnus to local dovecot server and
>> I'm stuck now.
>>
>> Current configuration of ~/.mbsyncrc (inspired heavily on [4]:
>> IMAPAccount gandi
>> Host mail.gandi.net
>> User bk@asterio.cloud
>> PassCmd "/usr/bin/pass email/bk"
>> SSLType IMAPS
>> CertificateFile /var/lib/ca-certificates/ca-bundle.pem
>>
>> IMAPStore gandi-remote
>> Account gandi
>>
>> MaildirStore gandi-local
>> SubFolders Verbatim
>> Path ~/.mail/gandi/
>> Inbox ~/.mail/gandi/Inbox
> You're using a local maildir store, but trying to connect to it with a
> local IMAP server. Either have mbsync use MaildirStore and connect to it
> directly with Gnus' nnmaildir, OR use IMAPStore/IMAPAccount to talk to
> local Dovecot, and have Gnus connect to Dovecot with nnimap.
>
>


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Yet another thread about Gnus, isync and dovecot mail stack
  2022-08-08 15:18   ` Greg Troxel
@ 2022-08-10  6:38     ` Bartosz Kaczyński
  0 siblings, 0 replies; 6+ messages in thread
From: Bartosz Kaczyński @ 2022-08-10  6:38 UTC (permalink / raw)
  To: Greg Troxel; +Cc: ding

Yes, indeed it is. And honestly I didn't resolve it yet with dovecot 
from repos on my GNU/Linux distribution, but I ran dovecot as a rootless 
podman container which actually gives me some level of security of my 
local mailbox.

On 8/8/22 17:18, Greg Troxel wrote:
> It sounds like you really have a dovecot problem, not a gnus problem.
> dovecot needs to be able to write to your mailstore.
>
> I would suggest pointing some other imap client against it and seeing
> what's happens.
>
> usually people start dovecot as root, have some kind of user/pass
> login, and  dovecot setuid's to the use.
>
> I have been using gnus with dovecot for a very long time, maybe 2005 or
> 2006, with no permissions issues.


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2022-08-10  6:38 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-08-07 18:34 Yet another thread about Gnus, isync and dovecot mail stack bk
2022-08-07 20:25 ` bk
2022-08-08 15:18   ` Greg Troxel
2022-08-10  6:38     ` Bartosz Kaczyński
2022-08-08 15:59 ` Eric Abrahamsen
2022-08-10  6:34   ` Bartosz Kaczyński

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).