[Dovecot] IMAP access based on username & IP

Andrei Dumitrescu a.dumitrescu at crystalmind.ro
Wed Jul 13 13:36:53 EEST 2011


Hello,
I have all the users and passwords in separate files like in the 
configuration below.
I want that a specific user (ex: joe at domain.con) to be able to read 
mails using imaps only from a specific IP.

All the other users should be able to read email from any IP.

How can I do that?

Thank you




Imap version:
#dovecot --version
1.2.12


dovecot.conf:

# 1.2.12: /etc/dovecot/dovecot.conf
# OS: Linux 2.6.35-28-server x86_64 Ubuntu 10.10 ext4
base_dir: /var/run/dovecot/
log_path: /var/log/dovecot.log
info_log_path: /var/log/dovecot.info
ssl_cert_file: /etc/ssl/certs/dovecot1.crt
ssl_key_file: /etc/ssl/private/dovecot1.key
ssl_cipher_list: ALL:!LOW:!SSLv2
disable_plaintext_auth: no
login_dir: /var/run/dovecot/login
login_executable: /usr/lib/dovecot/imap-login
login_greeting: IMAP ready.
login_processes_count: 7
login_max_processes_count: 84
verbose_proctitle: yes
first_valid_uid: 1000
first_valid_gid: 1000
mail_privileged_group: mail
mail_location: maildir:/var/spool/vmail/%d/%n
fsync_disable: yes
mbox_write_locks: fcntl dotlock
imap_client_workarounds: delay-newmail netscape-eoh tb-extra-mailbox-sep
lda:
   postmaster_address: postmaster at example.com
   sendmail_path: /usr/sbin/sendmail
auth default:
   mechanisms: plain login
   user: mail
   username_format: %Lu
   passdb:
     driver: pam
     args: session=yes dovecot
   passdb:
     driver: passwd-file
     args: /etc/dovecot/dovecot_passwd
userdb:
     driver: passwd
     args: blocking=yes
   userdb:
     driver: passwd-file
     args: /etc/dovecot/dovecot_users
   socket:
     type: listen
     client:
       path: /var/spool/postfix/private/auth
       mode: 432
       user: postfix
       group: postfix
     master:
       path: /var/run/dovecot/auth-master
       mode: 384
				



More information about the dovecot mailing list