Disable user login for a few seconds ?

Florent B florent at coppint.com
Fri Jul 4 09:46:40 UTC 2014


On 07/04/2014 11:33 AM, Robert Schetterer wrote:
> Am 04.07.2014 10:52, schrieb Florent B:
>> Hi all,
>>
>> I need to move e-mail files of my users from one file system to another.
>>
>> I use a MySQL backend on Dovecot 2.1.
>>
>> How can I do to disable temporary an account while moving files ?
>>
>> I have an "active" bit in my DB, but if I set it to 0, my MX servers are
>> bouncing mails.
>>
>> How can I do to disable temporary an account ? In fact, I need dovecot
>> not to do any change on files...
>>
>> I think I could change account password for a while, and reset it after
>> migration, but it will disturb connected users.
>>
>> Maybe I could chmod 0 files on my old file system during migration ? How
>> Dovecot will act ?
>>
>> Thank you :)
>>
>> Flo
>>
> read about this
>
> http://wiki2.dovecot.org/Authentication/RestrictAccess
>
> and/or
>
> if your user has static ip use firwall to reject ( be aware of nat )
>
> and/or
>
> change behave of sql active table with i.e postfix to tmp fail etc
>
> i.e ( dont copy paste ,must fit to your postfix(sql)config !!! )
>
> smtpd_recipient_restrictions = reject_unknown_recipient_domain,
>                                reject_non_fqdn_recipient,
>                                permit_mynetworks,
>                                check_recipient_access
> mysql:/etc/postfix/mysql_virtual_inactive_mailaddress.cf,
>
> mysql_virtual_inactive_mailaddress.cf
>
> ...
> query = SELECT CONCAT('421 mailaddress %s is set in inactive mode')
> address FROM mailbox WHERE username='%s' AND active = '0'
>
> be aware of all other involved postfix/sql tables where active = 0 is
> honored too, do hard testing before use in production
>
> after all change password might be the most easy way for only seconds
>
> Best Regards
> MfG Robert Schetterer
>

Thank you very much Robert.

I also had a look at "dsync" tool. But I think it handles only mails
directory, and not all user's home (my users's home contains indexes,
Maildir and sieve directories).


More information about the dovecot mailing list