For per-user restriction in your case, you can try to restrict it with Dovecot post login script.
- For Dovecot-1.x: http://wiki.dovecot.org/PostLoginScripting
- For Dovecot-2.x: http://wiki2.dovecot.org/PostLoginScripting
If you just want to restrict all users, how about add rules in firewall?