Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

friends, I am an Ubuntu 12.04 user and i want to any user can't send email from gmail in my pc, because they sending abuse mails from their gmail account but sending from my pc. So, please help me and suggest the right way.

share|improve this question
1  
Maybe your Router can block gmail (the Website, not the mails) but I think the best way is to secure your PC with a password and lock the desktop when you're not at the pc. –  prophecy201 Jun 17 '13 at 11:50
add comment

1 Answer

One method to prevent any access to gmail.com is to reroute it in your hosts file. This will redirect any requests to gmail.com to resolve to your local machine and not the external internet.

The method is reversible, so that you can toggle the setting when you need to use Gmail yourself.

  • Edit the file located at /etc/hosts
  • Add 2 new lines as below:

127.0.0.1 gmail.com

127.0.0.1 mail.google.com

  • Save and close the file
  • Restart the networking service by running the following in your terminal:

sudo service networking restart

If you now try to access gmail.com in your browser, you will find it does not load.

To disable this routing rule, so that you can access Gmail yourself, follow the same directions as above, but simply prefix the custom rules you added previously with a # character as below:

#127.0.0.1    gmail.com
#127.0.0.1    mail.google.com

Adding or removing the # character at the front of those lines will then enable or disable the blocking of Gmail. The same technique may be used for any other domains you want to block access to.

*help on editing your hosts file in Ubuntu and other OS's may be found here

share|improve this answer
1  
Also add mail.google.com, as gmail.com is just redirecting... –  gertvdijk Jun 17 '13 at 12:17
    
Thanks gertvdijk, updated –  lalalalalalalambda Jun 17 '13 at 12:21
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.