Announcement

Collapse
No announcement yet.

How do servers send and receive email?

Collapse
This topic is closed.
X
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    #16
    Originally posted by GreyGeek View Post
    I've purchased a domain name (jlkreps.net) around 2000 and my last activity was in Aug of 2004. It was to put my wife's geneology on for a few years so her family could generate the family tree and link everyone up. When I dropped it porn makers picked it up and I started getting complaints from friends that I was pushing porn! http://www.plotip.com/domain/jlkreps.net Somebody else registered it in 2008.

    Buying the domain name I still couldn't use it until I bought a hosting service and their DNS service. They set up a server with my domain name on it and set up the DNS also.

    So, if I read you right, I can set up my laptop, or another computer here at home, purchased a domain name and register it with Dyn, who will then give me an IP address (static?) and DNS connections, bypassing my ISP email service or gmail?
    That's hilarious (but annoying for you). Do you know if that's something that spammers do often?

    Whether or not your IP is static depends on your ISP. However, if you have a dynamic IP address then Dyn (or namecheap / most other DNS providers) have a service that will keep your domain name pointed at the right IP address even when your ISP changes it. This is called Dynamic DNS, and with namecheap it's free with the domain name. As I understand it, you run a DNS client on whichever computer is your server, and it calls out to your Dynamic DNS provider every now and then. If the Dynamic DNS provider receives a call and the IP address has changed then it will update the MX record to point to the new IP.

    My IP is now static so I don't need it, but for a while it was dynamic and I was using Namecheap's DynDNS options:

    Click image for larger version

Name:	dynamic_dns.jpg
Views:	1
Size:	35.5 KB
ID:	640474

    Remember, your laptop or other computer needs to be always on in order to receive emails, or some of them will bounce. If you're looking to do this then consider getting a Raspberry Pi - they're perfect for this kind of thing because of their low cost and power consumption. The standard distribution on the Pi is Raspbian, which is based on Debian and is very similar to Ubuntu in terms of file system, package manager etc. so it has the benefit of being easy to use!

    Having your own email server is brilliant, my favourite part is being able to have loads of aliases (like ubuntu@samhobbs.co.uk) that map to a single account, so that if a company sells or leaks your email address to spammers you
    a) know who it is and can complain/let them know
    b) delete the alias without deleting your whole account

    Feathers
    samhobbs.co.uk

    Comment


      #17
      Originally posted by Feathers McGraw View Post
      .....

      Having your own email server is brilliant, my favourite part is being able to have loads of aliases (like ubuntu@samhobbs.co.uk) that map to a single account, so that if a company sells or leaks your email address to spammers you
      a) know who it is and can complain/let them know
      b) delete the alias without deleting your whole account

      Feathers
      Thanks, Feathers!
      Using Pi and letting it run 24/7 is great. Thanks for the info! Even though I programmed for forty years and worked with networking using Novell's stuff in the mid 1980s, this is one area of computers and networking I never got into.
      "A nation that is afraid to let its people judge the truth and falsehood in an open market is a nation that is afraid of its people.”
      – John F. Kennedy, February 26, 1962.

      Comment


        #18
        You're very welcome, most of what I've learned I've read here or on similar sites, I feel I owe a lot back. It's rare I can be very helpful, everyone here knows so much!

        Feathers
        samhobbs.co.uk

        Comment


          #19
          Originally posted by GreyGeek View Post
          So, if I read you right, I can set up my laptop, or another computer here at home, purchased a domain name and register it with Dyn, who will then give me an IP address (static?) and DNS connections, bypassing my ISP email service or gmail?
          Nope, they won't give you an IP address -- that comes from your ISP. Most home and small-biz routers have a mechanism for updating your "A" record at Dyn whenever your public IP address changes. Here's how I do it on my router, a Cisco RV-220W:

          Comment


            #20
            Originally posted by Feathers McGraw View Post
            Having your own email server is brilliant, my favourite part is being able to have loads of aliases (like ubuntu@samhobbs.co.uk) that map to a single account
            Simpler: use Postfix's address extension character, which by default is the plus sign.

            Say your account is alice@baz.org. You might consider using sign-up emails like:

            * alice+linkedin@baz.org
            * alice+facebook@baz.org
            * alice+canukpharm@baz.org

            When Postfix receives incoming mail, it ignores everything from the + up to the @. All it asks is, "Does alice@baz.org" live here?" If the answer is yes, Postfix accepts the message and invokes the delivery agent.

            Now it's Dovecot's turn to handle. If you have IMAP folders underneath your Inbox, then Dovecot will place incoming messages according to the address extension. Mail sent to alice+facebook@baz.org will get placed into the facebook folder. Depending on how Dovecot is configured, if this folder doesn't exist, Dovecot will create it for you automatically. iRedMail configures Dovecot to create nonexistent folders. Ubuntu's mail-stack-delivery won't create folders; if you don't manually create them, Dovecot delivers to Inbox.

            The cool thing about address extensions is that you don't need to write any Sieve scripts to move mail into folders.
            Last edited by SteveRiley; Nov 26, 2013, 01:58 AM.

            Comment


              #21
              Nice!

              Can you send email from an address with a + in it?

              I said aliases, but really I just meant another address book entry in citadel. Not sure how it does things behind the scenes because it has its own self-contained authorisation mechanism.

              Feathers
              samhobbs.co.uk

              Comment


                #22
                Originally posted by Feathers McGraw View Post
                Can you send email from an address with a + in it?
                I know I have replied to emails sent to name+thing@somewhere.tld, so yeah, that works.

                Originally posted by Feathers McGraw View Post
                I said aliases, but really I just meant another address book entry in citadel. Not sure how it does things behind the scenes because it has its own self-contained authorisation mechanism.
                "Alias" has a specific meaning, and it sounds like that's what you're doing: creating an email address that maps to some other actual account.

                I keep forgetting that you're using Citadel! Grr. I have no clue whether Citadel's SMTP and IMAP servers understand address extensions. You'll have to experiment to find out

                Comment


                  #23
                  Originally posted by SteveRiley View Post
                  When Postfix receives incoming mail, it ignores everything from the + up to the @. All it asks is, "Does alice@baz.org" live here?" If the answer is yes, Postfix accepts the message and invokes the delivery agent.

                  Now it's Dovecot's turn to handle. If you have IMAP folders underneath your Inbox, then Dovecot will place incoming messages according to the address extension. Mail sent to alice+facebook@baz.org will get placed into the Facebook folder. Depending on how Dovecot is configured, if this folder doesn't exist, Dovecot will create it for you automatically. iRedMail configures Dovecot to create nonexistent folders. Ubuntu's mail-stack-delivery won't create folders; if you don't manually create them, Dovecot delivers to Inbox.
                  Citadel... my newly built Postfix & Dovecot email server is now up and running

                  I've tried sending emails to foo+facebook but the facebook folder isn't automatically created, the email appears in inbox.

                  Is there a specific dovecot config setting that I need to set for this to happen?

                  Feathers
                  Last edited by SteveRiley; Nov 26, 2013, 01:59 AM.
                  samhobbs.co.uk

                  Comment


                    #24
                    Originally posted by Feathers McGraw View Post
                    my newly built Postfix & Dovecot email server is now up and running
                    Congrats! I give ya six months; you'll find some reason to rebuild it, haha

                    Originally posted by Feathers McGraw View Post
                    I've tried sending emails to foo+facebook but the facebook folder isn't automatically created, the email appears in inbox... Is there a specific dovecot config setting that I need to set for this to happen?
                    In /etc/postfix/main.cf, what is the mailbox_command line?

                    In /etc/postfix/master.cf, do you have something like this:
                    Code:
                    # Use dovecot deliver program as LDA.
                        flags=DRhu user=vmail:vmail argv=/usr/lib/dovecot/deliver -f ${sender} -d ${user}@${domain} -m ${extension}

                    Comment


                      #25
                      Originally posted by SteveRiley View Post
                      Congrats! I give ya six months; you'll find some reason to rebuild it, haha
                      Yeah, that sounds likely. Watch this space!

                      Originally posted by SteveRiley View Post
                      In /etc/postfix/main.cf, what is the mailbox_command line?

                      In /etc/postfix/master.cf, do you have something like this:
                      Code:
                      # Use dovecot deliver program as LDA.
                          flags=DRhu user=vmail:vmail argv=/usr/lib/dovecot/deliver -f ${sender} -d ${user}@${domain} -m ${extension}
                      The mailbox command is blank after equals.

                      Nope, I don't have anything like that. Are you using virtual users? My setup is using Maildir and "real" users with system accounts, does that matter?
                      samhobbs.co.uk

                      Comment


                        #26
                        Wait...then how is Dovecot getting called by Postfix? Please put your main.cf and master.cf on http://paste.kde.org and reply here with the URLs. I'd like to take a look.

                        Comment


                          #27
                          Originally posted by SteveRiley View Post
                          Wait...then how is Dovecot getting called by Postfix? Please put your main.cf and master.cf on http://paste.kde.org and reply here with the URLs. I'd like to take a look.
                          Will do ASAP. Is it possible that Dovecot can be set up to fetch mail and be used for SASL but not be called when incoming mail arrives?

                          I can connect with IMAP and collect emails, and I'm definitely using dovecot SASL because Cyrus SASL isn't even installed, but I can authenticate successfully!

                          Feathers
                          samhobbs.co.uk

                          Comment


                            #28
                            Here they are:

                            main.cf:
                            http://pastebin.kde.org/p5tm2a5oz/ez8aag

                            master.cf:
                            http://pastebin.kde.org/pxxfk7t6b/yhridw

                            Will send you the passwords in a PM.

                            On closer inspection, I do in fact have something similar in master.cf, I missed it this morning (was checking on a tablet on the way to work). Sorry about that .

                            Code:
                            #
                            # maildrop. See the Postfix MAILDROP_README file for details.
                            # Also specify in main.cf: maildrop_destination_recipient_limit=1
                            #
                            maildrop  unix  -       n       n       -       -       pipe
                              flags=DRhu user=vmail argv=/usr/bin/maildrop -d ${recipient}
                            #
                            #
                            I take it this is Postfix's own way of doing things that I need to replace with instructions to use Dovecot instead?

                            Feathers
                            samhobbs.co.uk

                            Comment


                              #29
                              The "maildrop" stuff doesn't apply here, you can ignore that.

                              I have built Postfix+Dovecot servers only using virtual users and domains, because this gives you a lot of flexibility in configuring Dovecot's LDA (local delivery agent). I think in your case, Dovecot is automatically finding the Maildir/ subdirectory for each user. But since you haven't told Dovecot how to handle recipient delimiters, everything gets shoved into INBOX.

                              I can think of an experiment. Adding this to /etc/postfix/main.cf:
                              Code:
                              mailbox_command = /usr/lib/dovecot/dovecot-lda -f "$SENDER" -a "$RECIPIENT" -m "$EXTENSION"
                              might do the trick. But: dovecot-lda doesn't run as root, so it would need access to each user's mailbox. That'll take a bit of tinkering.

                              We also need to configure lda_mailbox_autocreate = yes in dovecot.conf. However, I would like to see all your Dovecot configuration files. Mind posting them to the same place?

                              -----

                              Meanwhile, try this -- create a folder foo (not under INBOX but instead at the same level). Now send an email to foo+bar. Did it arrive as expected?
                              Last edited by SteveRiley; Nov 26, 2013, 02:01 AM.

                              Comment


                                #30
                                Originally posted by SteveRiley View Post
                                The "maildrop" stuff doesn't apply here, you can ignore that.

                                I have built Postfix+Dovecot servers only using virtual users and domains, because this gives you a lot of flexibility in configuring Dovecot's LDA (local delivery agent). I think in your case, Dovecot is automatically finding the Maildir/ subdirectory for each user. But since you haven't told Dovecot how to handle recipient delimiters, everything gets shoved into INBOX.

                                I can think of an experiment. Adding this to /etc/postfix/main.cf:
                                Code:
                                mailbox_command = /usr/lib/dovecot/dovecot-lda -f "$SENDER" -a "$RECIPIENT" -m "$EXTENSION"
                                might do the trick. We also need to configure lda_mailbox_autocreate = yes in dovecot.conf. However, I would like to see all your Dovecot configuration files. Mind posting them to the same place?
                                I considered "going virtual" but decided it wasn't for me yet because I'm not all that comfortable with databases. The plan is to take it one step at a time, learn how to configure dovecot and postfix for "normal" users and then go back and have a crack at virtual users later. Perhaps that can be my 6 month rebuild!

                                Yes of course you can have a look, will upload them when I get back from work tonight. May have to clean them up first, there are so many blocks of comment that are slightly useful but make it really difficult to read! I think I remember seeing a command that generates an uncluttered version of your config files, may try that instead of doing it manually.

                                Will try that experiment too, thanks!

                                Feathers
                                samhobbs.co.uk

                                Comment

                                Working...
                                X