Re: Passing information from passdb to userdb

2017-11-21 Thread Aki Tuomi
The best way to is to use auth_request_set_userdb_field(request, key,
value);

and it will be available in userdb.

Aki

On 22.11.2017 01:57, Qmail wrote:
> I'm trying to hack together a new authentication back-end and I wanted to 
> know if it's possible to pass values from passdb to userdb in the 
> auth_request structure at authentication time. I modified struct auth_request 
> in auth-request.h to contain a new variable and it gets set properly in my 
> passdb, however the value is not there when checking for it userdb.
> I'm very novice when it comes to Dovecot programming so any help is 
> appreciated.
> Thanks!


Re: Log rotation and combining...

2017-11-21 Thread SH Development
No, I’m not using selinux.

I didn’t set up the logging to be under /home so I don’t know why it’s going 
there.  I do know it’s been there for many years.  Hence, my question about 
where it SHOULD be and if it can be combined with the maillog.

Ethon


> On Nov 18, 2017, at 9:47 AM, Tom Hendrikx  wrote:
> 
> HI,
> 
> Do you have selinux activated? Maybe the context for logrotate does not
> allow accessing files under /home, and the root cli is not troubled by
> such a limitation? Why are you storing log files under /home anyway?
> 
> Note: I don't use any OS with selinux, so can't really help with fixing
> this an issue.
> 
> Regards,
>   Tom
> 
> On 17-11-17 22:42, SH Development wrote:
>> So, the question is, why can I rotate the log manually, but cron returns a 
>> permission error?  Do I need to tell cron to run it as sudo or something 
>> like that?
>> 
>> Ethon
>> 
>>> On Nov 17, 2017, at 2:29 AM, Tom Hendrikx >> > wrote:
>>> 
>>> Hi,
>>> 
>>> 
>>> Your crontab should normally mail you error output. But you can also run
>>> the logrotate command manually, in verbose mode.
>>> 
>>> 
>>> Kind regards,
>>> Tom
>>> 
>>> On 17-11-17 03:35, SH Development wrote:
 That doesn’t seem to work either.  Where do I find logs for log rotation 
 to see the reason it failed?
 
 Ethon
 
 
 
> On Nov 16, 2017, at 7:53 PM, Bill Shirley    >> wrote:
> 
> I believe you need a 'create' statement to set the permissions. Here
> is an example for mariadb:
> /var/log/mariadb/general.log
> /var/log/mariadb/slow_query.log
> /var/log/mariadb/error.log
> /var/log/mariadb/mariadb.log {
>   create 640 mysql mysql
>   daily
>   minsize 30M
>   notifempty
>   rotate 3
>   missingok
>   compress
>   sharedscripts
>   postrotate
> #   # just if mysqld is really running
>   if test -x /usr/bin/mysqladmin && \
>   /usr/bin/mysqladmin ping &>/dev/null
>   then
>   /usr/bin/mysqladmin flush-logs
>   fi
>   endscript
> }
> 
> Bill
> 
> 
> On 11/16/2017 4:27 AM, SH Development wrote:
>> I have recently noticed that my dovecot-deliver.log is huge and wanted 
>> to start rotating it.  So a couple of questions:
>> 
>> 1. Can the dovecot-deliver.log be combined with the maillog, that gets 
>> rotated weekly?  If it can be done, is it advisable?
>> Since the inception of this particular server, the log file has been 
>> located in the /home/vmail directory.  Is there a reason it shouldn’t be 
>> located in the /var/log directory with the maillog?
>> 
>> 2. Separate from above, if I create a new logrotate script example as 
>> follows:
>> 
>> # dovecot SIGUSR1: Re-opens the log files.
>> /home/vmail/dovecot-deliver.log {
>> missingok
>> notifempty
>> delaycompress
>> sharedscripts
>> postrotate
>>   /bin/kill -USR1 `cat /var/run/dovecot/master.pid 2>/dev/null` 2> 
>> /dev/null || true
>> endscript
>> }
>> 
>> I get the following error only when cron tries to run it:
>> 
>> /etc/cron.daily/logrotate:
>> error: stat of /home/vmail/dovecot-deliver.log failed: Permission denied
>> 
>> 
>> Owner on the log are vmail:vmail.  If I manually force logrotate on this 
>> particular log, it works fine.
>> 
>> 
>> Ethon
> 
> 


Passing information from passdb to userdb

2017-11-21 Thread Qmail
I'm trying to hack together a new authentication back-end and I wanted to know 
if it's possible to pass values from passdb to userdb in the auth_request 
structure at authentication time. I modified struct auth_request in 
auth-request.h to contain a new variable and it gets set properly in my passdb, 
however the value is not there when checking for it userdb.
I'm very novice when it comes to Dovecot programming so any help is appreciated.
Thanks!


Re: Errors installing on Ubuntu 17.04

2017-11-21 Thread Jeff Kletsky

On 11/21/17 5:20 AM, Someone wrote:


On Tue, 21/11/17, Jeff Kletsky  wrote:

On 11/20/17 1:58 PM, Someone wrote:

  > I've been

struggling with this on and off for a while now.  Upon


attempting to install Dovecot on Ubuntu

17.04 I get the following errors



[...]


"Hint: Some lines were ellipsized, use -l

to show in full."

I'm aware of that, yes.  Unfortunately I don't know how to tell any of
the myriad of package installers to "do the right thing" in such cases,

and, as stated, this is happening during installation.



  Without seeing the full messages, my guess is that you've got problems with 
your IPv6 configuration or connectivity.

Entirely possible, since I don't have IPv6 and have completely disabled
it as a result.  Even were I to re-enable it, I don't see it would help
if problems with IPv6 connectivity would also be a problem (because I
don't have it).
Without the log information, you've made it nearly impossible to help 
you. The problem looks to be occurring in the execution of dovecot, not 
the install process.


While you may not have IPv6 connectivity, with the little information 
you've provided:


Oct 05 14:08:56 ash dovecot[8885]: Error: socket() failed: Address family n…ocol
Oct 05 14:08:56 ash dovecot[8885]: Error: service(imap-login): listen(::, 1…ocol
Oct 05 14:08:56 ash dovecot[8885]: master: Error: socket() failed: Address …ocol
Oct 05 14:08:56 ash dovecot[8885]: Fatal: Failed to start listeners

it is possible that dovecot is expecting to be able to connect over IPv6 and is 
unable to do so.
"socket() failed: Address family" and "listen(::, " are strong hints of that.

If you have successfully disabled IPv6 (which, I believe, Ubuntu enables by 
default) and dovecot is trying to listen on an IPv6 address, it is not 
surprising that errors occur.

The output of 'ip addr' and 'sysctl -a | fgrep net.ipv6' would be helpful, as 
would you examining the output of 'doveconf' to see if dovecot is trying to 
listen on IPv6 addresses.



Jeff


set parameter per user

2017-11-21 Thread A. Schulze


Hello,

My dovecot server (2.2.33.2) work with "lmtp_save_to_detail_mailbox = no"
Now I would like to enable the feature for /some/ users.

Is that an option that could be set from an LDAP entry?

I tried the following:

   modify my ldap schema to allow an optional attribute  
"lmtp-save-to-detail-mailbox"


   in /etc/dovecot/ldap.conf
  user_attrs  = ...
   
=lmtp_save_to_detail_mailbox=%{ldap:lmtp-save-to-detail-mailbox:no},

  =...

Now I set an ldapattribute "lmtp-save-to-detail-mailbox" with value  
"yes" for some users.


Unfortunately messages to user+extension@domain are still delivered to INBOX/
while they should be delivered to INBOX/extension.

I also tried to make the attribute accessible vi pass_attr and  
userdb_foo = ...
because I use prefetch driver as userdb. I also disabled prefetching  
at all but no luck :-/


any Ideas?
Andreas


Re: Errors installing on Ubuntu 17.04

2017-11-21 Thread Someone
On Tue, 21/11/17, Jeff Kletsky  wrote:
> On 11/20/17 1:58 PM, Someone wrote:
> 
>  > I've been

struggling with this on and off for a while now.  Upon

> > attempting to install Dovecot on Ubuntu

17.04 I get the following errors



[...]

> "Hint: Some lines were ellipsized, use -l
to show in full."

I'm aware of that, yes.  Unfortunately I don't know how to tell any of
the myriad of package installers to "do the right thing" in such cases, 

and, as stated, this is happening during installation.


>  Without seeing the full messages, my guess is that you've got problems with 
> your IPv6 configuration or connectivity. 

Entirely possible, since I don't have IPv6 and have completely disabled
it as a result.  Even were I to re-enable it, I don't see it would help
if problems with IPv6 connectivity would also be a problem (because I
don't have it).


Re: home folder for virtual users with autoexpunge setting

2017-11-21 Thread Steffen Kaiser

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

On Tue, 21 Nov 2017, fe...@kngnt.org wrote:


dovecot-acl-list
dovecot.list.index.log
dovecot.mailbox.log.2
dovecot-uidvalidity.51e5857f
storage
dovecot.list.index
dovecot-uidvalidity
dovecot.mailbox.log
mailboxes
subscriptions

Which ones should I move to / ?


these:

dovecot.sieve.log
dovecot.svbin
sieve
dovecot.sieve
dovecot.sieve.log.0



I'm not sure about this one:

spamassassin


This is probably used by an plugin or something like that, so it should go 
into home as well.




Thank you!
Felix

November 21, 2017 9:08 AM, "Steffen Kaiser"  
wrote:


-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

On Sun, 19 Nov 2017, fe...@kngnt.org wrote:


I understand this is correct: as  is a virtual user, it does not > have 
home folder. Is there
any way I can set the autoexpunge plugin to > store the lock file in the 
virtual user email home
folder?


well, home folder in Dovecot != $HOME (or ~user), but user-specific besides the 
mail storage root
folder:

https://wiki2.dovecot.org/VirtualUsers/Home

Dovecot however uses ~ as abbrevation for "home directory".

- -- Steffen Kaiser
-BEGIN PGP SIGNATURE-
Version: GnuPG v1

iQEVAwUBWhPXQ3z1H7kL/d9rAQJBHwf+PjLMPpRPLuNC9NztmJ9G+1xo+vwQBWDM
TZZ2+LHg453ojhR/vdZhuhwl/UnMPq+PTyCINwtSzcvHjeRY9GCtUlnPWSH4nHN8
1x7YlsZm6kLa9K0d2e7MJ52s9yUEHlxtvIUxuRMrFfQyc6sHm7Q8WTGNDCH12N8q
Ob8sikXdh7+IFJvRP2sjXAb4MldPFudio5CtSfQ0MbrgLEp/pl8BCbrlcycpHCPX
s6+cis0GXaKu4ntCyUZAbsckPJ30JFAxhRNltUo+nmCCF4BY1Md87geyUnDr8ehE
4mJP4M4KfZne9i/+XTPuPfw4H3cCNMq3svBJtpLcvqWmnjnLzOhhyQ==
=YVgN
-END PGP SIGNATURE-





- -- 
Steffen Kaiser

-BEGIN PGP SIGNATURE-
Version: GnuPG v1

iQEVAwUBWhQPH8QnQQNheMxiAQJDEQgAv7jPTkGDZSC3iuYWutWcflJE+FbRoC6a
T3E932MHUHU0b3kXmzubFyXgKdLIWcWmZD6R+e1x0ys1Hc/4SzcdSPlpyNYCKzUf
beQeMQZFa7vvXuLlUaFBMnV5LCl2VlnT5sxm9hcu3mQAP2fj6A2fmJ1d5Mv5eepP
id3ILPTs+eO/ms03GJAwTtgqm8XVUhK+idXJEibvGKCuNDZKbq9XGyiHac74tpvX
q8EjBwy7VJ1l4B9XTr8GLuqRKApKtu6s9MC5GFeiVU9Qzt5Q4XseUf0ucDfbJ6XP
6MGvLWPLrsanoeDbHrz8P1kNf8luzr6wnu8KwkbFBEKE7QjaE9YhiQ==
=b/+T
-END PGP SIGNATURE-


Re: home folder for virtual users with autoexpunge setting

2017-11-21 Thread felix
Hi Steffen,

   Thank you very much for your answer, I did not know I was supposed to have 
that home folder. I have moved everything on the folder  /* 
to /mail. I have restarted dovecot and nothing seems to be 
broken. However, I see I have the following files inside /mail : 

dovecot-acl-list
dovecot.list.index.log
dovecot.mailbox.log.2
dovecot.sieve.log
dovecot.svbin
dovecot-uidvalidity.51e5857f
sieve
storage
dovecot.list.index
dovecot.mailbox.log
dovecot.sieve
dovecot.sieve.log.0
dovecot-uidvalidity
mailboxes
spamassassin
subscriptions

Which ones should I move to / ?

Thank you!
Felix

November 21, 2017 9:08 AM, "Steffen Kaiser"  
wrote:

> -BEGIN PGP SIGNED MESSAGE-
> Hash: SHA1
> 
> On Sun, 19 Nov 2017, fe...@kngnt.org wrote:
> 
>> I understand this is correct: as  is a virtual user, it does not > 
>> have home folder. Is there
>> any way I can set the autoexpunge plugin to > store the lock file in the 
>> virtual user email home
>> folder?
> 
> well, home folder in Dovecot != $HOME (or ~user), but user-specific besides 
> the mail storage root
> folder:
> 
> https://wiki2.dovecot.org/VirtualUsers/Home
> 
> Dovecot however uses ~ as abbrevation for "home directory".
> 
> - -- Steffen Kaiser
> -BEGIN PGP SIGNATURE-
> Version: GnuPG v1
> 
> iQEVAwUBWhPXQ3z1H7kL/d9rAQJBHwf+PjLMPpRPLuNC9NztmJ9G+1xo+vwQBWDM
> TZZ2+LHg453ojhR/vdZhuhwl/UnMPq+PTyCINwtSzcvHjeRY9GCtUlnPWSH4nHN8
> 1x7YlsZm6kLa9K0d2e7MJ52s9yUEHlxtvIUxuRMrFfQyc6sHm7Q8WTGNDCH12N8q
> Ob8sikXdh7+IFJvRP2sjXAb4MldPFudio5CtSfQ0MbrgLEp/pl8BCbrlcycpHCPX
> s6+cis0GXaKu4ntCyUZAbsckPJ30JFAxhRNltUo+nmCCF4BY1Md87geyUnDr8ehE
> 4mJP4M4KfZne9i/+XTPuPfw4H3cCNMq3svBJtpLcvqWmnjnLzOhhyQ==
> =YVgN
> -END PGP SIGNATURE-


macros in config support

2017-11-21 Thread Arkadiusz Miśkiewicz

Hi.

Is there any support for macros in dovecot configuration - user defined 
macros?

For example:

server-config.conf:
%define my_db_name "aaa"
%define my_db_host "db.example.com"
%define my_db_pass "sdfdsfsdfsdf2313"
%define server_id  10
%define something blabla
...

dovecot-sql.conf:
!include server-config.conf

connect = host=%{my_db_host} dbname=%{my_db_name} 

iterate_query = SELECT ... WHERE os.id_pop3_server=%{server_id}
...


Basically to be able to use own macros anywhere in config files.

-- 
Arkadiusz Miśkiewicz, arekm / ( maven.pl | pld-linux.org )