Restrict users from accessing POP3 or IMAP in Linux
Hello, I have recently switched to Linux operating system from the Windows operating system and now wanted to know the setup by using which I can able to restrict some specific users for POP3 or IMAP in Linux platform. If you give me steps to configuration of this then it will be helpful to me. Please give the steps in the way that I can able to understand.
Re: Restrict users from accessing POP3 or IMAP in Linux
Hello, I don't think that this would be possible in the Linux platform. It is not possible to Restrict users from accessing POP3 or IMAP in Linux. I think you can restrict users from accessing POP3 or IMAP in Windows either by making some changes in to the registry or simply by making some or the setting in your firewall and able to solve this. But, as you are working on Linux operating system it is not possible.
Re: Restrict users from accessing POP3 or IMAP in Linux
It is possible to Restrict users from accessing POP3 or IMAP in Linux, but for that you need to take help of PAM or server itself. In Linux operating system it is possible to take or give access to different services. But, if you restrict users from accessing the POP3 or IMAP then you are restricting the protocol facilities upon which email is based. But, while doing this, if they are having some or the other internal email account, then it is needed that you have to apply specific rules to handle this problem.
Re: Restrict users from accessing POP3 or IMAP in Linux
For Restricting users from accessing POP3 or IMAP in Linux you need to create two files as imap.deny and pop.deny. Then copy the name of the user to respective file to block the port for this user. Now in these files add the add the following code in dovecot.conf file:
Code:
passdb passwd-file
{
args = /etc/dovecot/deny.%Ls <- dovecot path
deny = yes
}
Re: Restrict users from accessing POP3 or IMAP in Linux
Hello, I have got some solution on internet regarding the Restricting the users from accessing the POP3 or IMAP in Linux. But, for this all the users must have static IP on their machines. Then you need to apply the following command to restrict the user from accessing 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)
I don't know whether it is working or not, as I am not Linux user. So, try it yourself.
Re: Restrict users from accessing POP3 or IMAP in Linux
Hello, you can make use of the deny command to restrict users from accessing POP3 or IMAP in Linux. For that you need to have the dovecot. First remove the comment from following lines in dovecot.conf file. Create files as below and then close the dovecot and again open it.and restart dovecot,
First file as:
Code:
passdb passwd-file
{
//list of username one by one
args = /etc/dovecot.deny
deny = yes
}
Second filse as:
- Create /etc/dovecot.deny file.
- Add username inside to the file.