Re: Problems with userdb and mail deliveribility

2020-05-17 Thread @lbutlr
On 17 May 2020, at 11:08, Chris Bennett  
wrote:
> 
> I realize that I dumpimg a lot of info out there.

But not what we need.

doveconf -n
postfix -n (or equivalent)

What MTA you are using (postfix, etc)

Errors in mail.log showing the failures.


> I can shoot for system users, but I really want to get the virtual users
> working. This is a bit of a project.

user=vmail delay=2h50m40s result=TempFail stat=Error (temporary failure: 
"mail.lmtp: LMTP server error: 550 5.1.1 
 User doesn't exist: 

Probably your LMTP lookup is malformed, probably in your MTA.

lmtp(rodeo)<45419>: Error: 
mkdir(/var/vmail//rodeo/Maildir) failed: Permission denied (euid=1000(rodeo) 
egid=1000(rodeo) missing +w perm: /var, dir owned by 0:0 mode=0755)

You have permission issues. vmail (and all files and folders in vmail) should 
be owned by the vmail user, not by root.



-- 
HILLBILLIES ARE PEOPLE TOO Bart chalkboard Ep. AABF11




Re: Problems with userdb and mail deliveribility

2020-05-17 Thread Chris Bennett
I realize that I dumpimg a lot of info out there.
Good news is that I´m online but not in production.

I can shoot for system users, but I really want to get the virtual users
working. This is a bit of a project.

Thanks for anyone who wants to help. I was in a hotel room when I
started and now on Amtrak train with connections fading in and out.

Someone shared some of their configs, but I still confused.
I may just scrap what Ie done and start fresh.

Would if be helpful if I followed up with each file inline
I was kirring then 40kb limit.

Thanks,
Chris Bennett




dovecot sync not pushing automatically ?

2020-05-17 Thread Laura Smith
Hi,
I'm aware its an async process, but despite sending test messages and then 
waiting a few minutes, the stats are still unchanged :

$ sudo doveadm replicator status


Queued 'sync' requests    0 


Queued 'high' requests    0 


Queued 'low' requests 0 


Queued 'failed' requests  0 


Queued 'full resync' requests 0 


Waiting 'failed' requests 0 


Total number of known users   18

However if I manually run it using :
sudo doveadm -D sync -u t...@example.com -1 -d -N -l 30 -U

It syncs fine and the mails are visible on the standby server.

The master server is setup as per the docs :
replication_dsync_parameters = -1 -d -N -l 30 -U
plugin {
mail_replica = tcps:foobar.example.com:11867
}
service replicator {
  process_min_avail = 1
}
service aggregator {
  fifo_listener replication-notify-fifo {
user = foobar
  }
  unix_listener replication-notify {
user = foobar
  }
}
service replicator {
  unix_listener replicator-doveadm {
mode = 0600
user = foobar
  }
}
replication_max_conns = 10


Re: iterate_query with static userdb ?

2020-05-17 Thread Laura Smith


On Sunday, 17 May 2020 11:11, James  wrote:

> On 17/05/2020 10:43, Laura Smith wrote:
>
> > Because I wanted to avoid storing uid/gid/home in the database ?
>
> I use:
>
> user_query = "SELECT 'vmail' AS uid, 'vmail' AS gid, allow_nets,
> '*:storage=' || quota || 'M' AS quota_rule FROM mailbox WHERE username =
> '%n' AND domain = '%d';"
>
> ... uid and gid are not stored in my database but are returned by the query.


Thanks !


Re: iterate_query with static userdb ?

2020-05-17 Thread James

On 17/05/2020 10:43, Laura Smith wrote:


Because I wanted to avoid storing uid/gid/home in the database ?


I use:

user_query = "SELECT 'vmail' AS uid, 'vmail' AS gid, allow_nets, 
'*:storage=' || quota || 'M' AS quota_rule FROM mailbox WHERE username = 
'%n' AND domain = '%d';"


... uid and gid are not stored in my database but are returned by the query.


Re: iterate_query with static userdb ?

2020-05-17 Thread Laura Smith
On Sunday, 17 May 2020 10:38, Aki Tuomi  wrote:

> > On 17/05/2020 12:34 Laura Smith  wrote:
> >
> > Hi,
> >
> > Going by the "static userdb" example  on this page 
> > (https://wiki.dovecot.org/VirtualUsers#homedirs), tried to achieve a 
> > similar setup in conjunction with pgsql for passdb.
> >
> > However I get an error "auth: Warning: sql: Ignoring changed iterate_query 
> > in /etc/dovecot/local_sql_users.conf, because userdb sql not used. (If this 
> > is intentional, set userdb_warning_disable=yes)"
> >
> > Does this mean the following is not a valid config ? Or at least I will not 
> > be able to achieve iteration ?
> >
> > mail_location = maildir:/foobar/mail/%d/%n/Maildir
> > passdb {
> >   driver = sql
> >   args = /etc/dovecot/local_sql_users.conf
> > }
> > userdb {
> >   driver = static
> >   args = uid=foo gid=bar home=/foobar/mail/%d/%n
> > }
>
> It's valid but why do it like this? You can return these fields with 
> user_query in the sql config. 
>
> Aki
>
> ---
> Aki Tuomi

Because I wanted to avoid storing uid/gid/home in the database ?


Re: iterate_query with static userdb ?

2020-05-17 Thread Aki Tuomi


 
 
  
   
  
  
   
On 17/05/2020 12:34 Laura Smith  wrote:
   
   

   
   

   
   
Hi,
   
   

   
   
Going by the "static userdb" example  on this page (https://wiki.dovecot.org/VirtualUsers#homedirs), tried to achieve a similar setup in conjunction with pgsql for passdb.
   
   

   
   
However I get an error "auth: Warning: sql: Ignoring changed iterate_query in /etc/dovecot/local_sql_users.conf, because userdb sql not used. (If this is intentional, set userdb_warning_disable=yes)"
   
   

   
   
Does this mean the following is not a valid config ? Or at least I will not be able to achieve iteration ?
   
   

   
   
mail_location = maildir:/foobar/mail/%d/%n/Maildir
   
   
passdb {
   
   
  driver = sql
   
   
  args = /etc/dovecot/local_sql_users.conf
   
   
}
   
   
userdb {
   
   
  driver = static
   
   
  args = uid=foo gid=bar home=/foobar/mail/%d/%n
   
   
}
   
  
  
   
  
  
   It's valid but why do it like this? You can return these fields with user_query in the sql config. 
  
  
   
  
  
   Aki
  
  
   ---
Aki Tuomi
  
 



iterate_query with static userdb ?

2020-05-17 Thread Laura Smith
Hi,

Going by the "static userdb" example  on this page 
(https://wiki.dovecot.org/VirtualUsers#homedirs), tried to achieve a similar 
setup in conjunction with pgsql for passdb.

However I get an error "auth: Warning: sql: Ignoring changed iterate_query in 
/etc/dovecot/local_sql_users.conf, because userdb sql not used. (If this is 
intentional, set userdb_warning_disable=yes)"

Does this mean the following is not a valid config ? Or at least I will not be 
able to achieve iteration ?

mail_location = maildir:/foobar/mail/%d/%n/Maildir
passdb {
  driver = sql
  args = /etc/dovecot/local_sql_users.conf
}
userdb {
  driver = static
  args = uid=foo gid=bar home=/foobar/mail/%d/%n
}


Re: "/etc/dovecot/dovecot.conf: passdb is missing driver"

2020-05-17 Thread Aki Tuomi


> On 17/05/2020 11:26 Laura Smith  wrote:
> 
>  
> Hi,
> 
> I'm trying to get dovecot working with postgres, I'm on Debian 10 and have 
> installed dovecot-pgsql from the Dovecot repo 
> (https://repo.dovecot.org/ce-2.3-latest/debian/).
> 
> I have the following in my local.conf :
> passdb sql {
>   args = /etc/dovecot/local_sql_users.conf
> }

passdb {
  driver = sql
  args = /etc/dovecot/local_sql_users.conf
}

Aki


"/etc/dovecot/dovecot.conf: passdb is missing driver"

2020-05-17 Thread Laura Smith
Hi,

I'm trying to get dovecot working with postgres, I'm on Debian 10 and have 
installed dovecot-pgsql from the Dovecot repo 
(https://repo.dovecot.org/ce-2.3-latest/debian/).

I have the following in my local.conf :
passdb sql {
  args = /etc/dovecot/local_sql_users.conf
}

And the following in the referenced file:
driver = pgsql
connect = host=localhost dbname=foobar user=bar password=foo
default_pass_scheme = ARGON2ID
password_query = select dovecot_username as user,password from get_user('%u')
iterate_query = select dovecot_username as user from get_users()

So surely it should work ?

doveconf -n just to complete the picture 

# 2.3.10 (0da0eff44): /etc/dovecot/dovecot.conf
# Pigeonhole version 0.5.10 (bf8ef1c2)
# OS: Linux 4.19.0-9-amd64 x86_64 Debian 10.4 xfs
# Hostname: foobar.example.com
auth_verbose = yes
auth_verbose_passwords = sha1:7
doveadm_password = # hidden, use -P to show it
mail_location = maildir:/foobar/mail/%d/%n/Maildir
mail_plugins = " notify replication"
managesieve_notify_capability = mailto
managesieve_sieve_capability = fileinto reject envelope encoded-character 
vacation subaddress comparator-i;ascii-numeric relational regex imap4flags copy 
include variables body enotify environment mailbox date index ihave duplicate 
mime foreverypart extracttext
namespace inbox {
  inbox = yes
  location =
  mailbox Drafts {
    special_use = \Drafts
  }
  mailbox Junk {
    special_use = \Junk
  }
  mailbox Sent {
    special_use = \Sent
  }
  mailbox "Sent Messages" {
    special_use = \Sent
  }
  mailbox Trash {
    special_use = \Trash
  }
  prefix =
}
passdb {
  driver = pam
}
passdb {
  args = /etc/dovecot/local_sql_users.conf
  name = sql
}
plugin {
  mail_replica = tcps:standby.example.com:11867
  sieve = file:~/sieve;active=~/.dovecot.sieve
}
protocols = imap lmtp
replication_dsync_parameters = -1 -d -N -l 30 -U
service aggregator {
  fifo_listener replication-notify-fifo {
    user = foobar
  }
  unix_listener replication-notify {
    user = foobar
  }
}
service auth {
  unix_listener /var/spool/postfix/private/dovecot-auth {
    group = postfix
    mode = 0660
    user = postfix
  }
  vsz_limit = 2 G
}
service doveadm {
  inet_listener {
    port = 11867
    ssl = yes
  }
}
service imap-login {
  process_min_avail = 5
  service_count = 1
}
service lmtp {
  process_min_avail = 5
  unix_listener /var/spool/postfix/private/dovecot-lmtp {
    group = postfix
    mode = 0660
    user = postfix
  }
  user = foobar
}
service managesieve-login {
  inet_listener sieve {
    port = 4190
  }
  inet_listener sieves {
    address =
    port = 5190
    ssl = yes
  }
}
service replicator {
  process_min_avail = 1
  unix_listener replicator-doveadm {
    mode = 0600
    user = foobar
  }
}
ssl = required
ssl_ca =  was automatically rejected:%n%r
}
protocol imap {
  mail_max_userip_connections = 20
}