March 29, 2024, 05:28:33 AM

News : LinuxSolved.com Linux Help Community Forum..


Author Topic: How to block paricular user's pop/imap login  (Read 10016 times)

Offline sandeepvson

  • Linux Noob !
  • *
  • Posts: 10
How to block paricular user's pop/imap login
« on: October 30, 2009, 10:08:12 AM »
Is this possible to block particular user's email-client configuration on basis of pop/imap
settings in linux ,dovecot.conf or anywhere ?

Offline ravis123

  • New Member
  • Posts: 1
Is it possible in Linux to restrict POP3 or IMAP for particular users.
« Reply #1 on: October 31, 2009, 07:46:31 AM »
Hi,
Is it possible in Linux to restrict POP3 or IMAP for particular users.
I need a confirmation on this, that it is possible or not in Linux.
If yes, then how to do this....
Please reply
Thanks in advance

Offline kaushalpatel1982

  • LST CareTaker
  • Linux Learner
  • *****
  • Posts: 87
Re: Is it possible in Linux to restrict POP3 or IMAP for particular users.
« Reply #2 on: November 06, 2009, 12:04:56 PM »
If users having static IP Addresses on their machines, Yes it is possible with iptables. Just apply following command can restrict the user to access POP3 and IMAP:

# iptables -t filter -I INPUT -s <user's IP Address> -p tcp --dport 110 -d <mail server IP> -j REJECT (or DROP)
# iptables -t filter -I INPUT -s <user's IP Address> -p tcp --dport 143 -d <mail server IP> -j REJECT (or DROP)

Dont use Mail server IP in case of mail server hosted on this machine.

You can also deny the users in pop3 and imap server like if you have dovecot just remove the comment from following lines in dovecot.conf file. Create files and restart dovecot,

1.)

  passdb passwd-file {
     File contains a list of usernames, one per line
    args = /etc/dovecot.deny
    deny = yes
  }

2.) Create /etc/dovecot.deny file and add username inside to the file.

for more help on dovecot go through the following link : http://wiki.dovecot.org/Authentication/RestrictAccess

If you still have problem let us know. Best of Luck

Offline sandeepvson

  • Linux Noob !
  • *
  • Posts: 10
Re: How to block paricular user's pop/imap login
« Reply #3 on: November 06, 2009, 01:03:26 PM »
 Thanks for help.
I tried with dovecot configuration file at 'passdb' tag setting.
i created /etc/dovecot.deny file and put some users ,those are successfully denied.
but how to block only pop3/imap to those users.
email client is not connecting to both any pop3/imap settings to listed users.

Please reply..

Offline kaushalpatel1982

  • LST CareTaker
  • Linux Learner
  • *****
  • Posts: 87
Re: How to block paricular user's pop/imap login
« Reply #4 on: November 06, 2009, 02:20:47 PM »
As per my understand, you want to deny either POP3 or IMAP.

The link provided with the post will help you to resolve the problem.

Offline ravis007

  • Linux Noob !
  • *
  • Posts: 9
Re: How to block paricular user's pop/imap login
« Reply #5 on: November 09, 2009, 05:54:03 AM »
Thanks for your help........

I have gone through the link you provided, but I am not getting the configuration.

Can you please give me some configuration example for restricting IMAP access to certain users.

Please help....

Offline sandeepvson

  • Linux Noob !
  • *
  • Posts: 10
Re: How to block paricular user's pop/imap login
« Reply #6 on: November 09, 2009, 06:39:11 AM »
 
 
It is working now.
We can restrict users for either IMAP or POP3.
I have modified passdb section in dovecot with the help of above provided link
http://wiki.dovecot.org/Authentication/RestrictAccess
 
Thanks for help.