Find the answer to your Linux question:
Results 1 to 8 of 8
In Gmail, when a new mail arrives, it shows up automatically in the list. I would like to know how the server side of this is architected. Did they have ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Linux User
    Join Date
    Mar 2013
    Posts
    381

    How is Gmail's "new mail notification" done?


    In Gmail, when a new mail arrives, it shows up automatically in the list. I would like to know how the server side of this is architected. Did they have to tamper with the Linux kernel? (I'm assuming Google uses Linux).


    Thanks.

  2. #2
    Linux Engineer docbop's Avatar
    Join Date
    Nov 2009
    Location
    Woodshed, CA
    Posts
    947
    When you configure gmail one of the parameters is "Check for new mail" and I beleive the default is 10 minutes. So its just timer based they don't have to tamper with the kernel.

  3. #3
    Linux User sgosnell's Avatar
    Join Date
    Oct 2010
    Location
    Baja Oklahoma
    Posts
    494
    Yes, AFAIK Gmail doesn't do push, it just checks the server for new mail at the interval you select in settings, and then notifies you. No magic involved.

  4. $spacer_open
    $spacer_close
  5. #4
    Linux User
    Join Date
    Mar 2013
    Posts
    381
    OK, let me rephrase the question. If I wanted to do push, what would I have to do?

  6. #5
    Linux Engineer docbop's Avatar
    Join Date
    Nov 2009
    Location
    Woodshed, CA
    Posts
    947
    Quote Originally Posted by resetreset View Post
    OK, let me rephrase the question. If I wanted to do push, what would I have to do?
    What do you mean you want to push??? Most mail app's send mail immediatly when you hit sent. Even command line mail tool sends immediately. I think you need to give more details of what you are trying to accomplish.

  7. #6
    Linux User sgosnell's Avatar
    Join Date
    Oct 2010
    Location
    Baja Oklahoma
    Posts
    494
    Push email is done by the server, not the client. That has nothing to do with the kernel, it's done in the email program. No need to reinvent the wheel, since there are many email programs available, both for servers and clients. But if you really want to learn, the source code is available for many email packages.

    The more I think about this, the less I think I know about what the OP wants. Do you want to write your own email program? Develop a daemon that will do notifications? Or just be notified when you have new email? If the latter, there are many gmail notifiers available for Linux. Google will find lots of them for you. If the former, then you really need to do a lot of study on programming.
    Last edited by sgosnell; 12-20-2013 at 01:40 AM.

  8. #7
    Linux User
    Join Date
    Mar 2013
    Posts
    381
    I want, maybe, to set up a email website, just like gmail, which will do pushes. so, in the system, when a new mail arrives, it has to be propagated upwards, until something at application layer sends it to the browser - THIS is what I wish to know how to do, if I'm not talking out my ass

  9. #8
    Linux Engineer docbop's Avatar
    Join Date
    Nov 2009
    Location
    Woodshed, CA
    Posts
    947
    Quote Originally Posted by resetreset View Post
    I want, maybe, to set up a email website, just like gmail, which will do pushes. so, in the system, when a new mail arrives, it has to be propagated upwards, until something at application layer sends it to the browser - THIS is what I wish to know how to do, if I'm not talking out my ass
    Seems with that model the server would be pushing a lot to machines that are offline so it would be a very chatty mail server assuming you're going to keep trying till you deliver the mail. Also server side would need more knowledge IP/hostname of every client machine it doesn't need now, could be issue dealing with clients with no public hostname or IP. Seems like a similar result could be achieved by shortening the time the email client checks for new messages to client minium.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •