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

  • Feathers McGraw
    replied
    No pressure, just wanted to make sure the email had got through!

    I wouldn't have been surprised if some misconfiguration on my part had resulted in a blocked email.

    Squirrelmail is up and running now too, it was probably the easiest to configure out of the three (postfix, dovecot, Squirrelmail).

    I like that some of the Squirrelmail plugins are in the repos too, it wasn't immediately obvious that they were, and I wasn't keen on installing something that apt couldn't update when it updates Squirrelmail to a new version.

    Leave a comment:


  • SteveRiley
    replied
    Got home a few hours ago from SF, and the weekend has filled up with a number of performances. Sorry, haven't forgotten...

    Leave a comment:


  • Feathers McGraw
    replied
    Any luck with this?

    Leave a comment:


  • Feathers McGraw
    replied
    Thank you! No rush at all, the mail server is chugging along quite happily at the moment, will be really interesting to learn how to do this though.

    If all else fails I'll have a crack at it using virtual maps and flat files like you suggested. Will have a read of those links in the meantime.

    Feathers

    Leave a comment:


  • SteveRiley
    replied
    Email coming in a PM.

    One bit... we are now in a spot -- making Dovecot work a little magic without virtual maps -- that is new for me. It'll be a couple days before I can spend some time with this. I am, of course, too curious to let it go unresolved

    And yes, I meant a folder named bar. Bah!

    Leave a comment:


  • Feathers McGraw
    replied
    And... after combining it all into one config file and trying to upload it, KDE paste still hates me.

    I could email you it, if you don't mind sending me an address via PM? I promise I won't spam you!

    Feathers

    Leave a comment:


  • Feathers McGraw
    replied
    Originally posted by SteveRiley View Post
    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?
    Added those lines to postfix and dovecot. I get the following output when I send an email to user+bar@samhobbs.co.uk

    Code:
    Nov 26 19:56:39 samhobbs postfix/smtpd[9794]: connect from dub0-omc2-s21.dub0.hotmail.com[157.55.1.160]
    Nov 26 19:56:39 samhobbs postfix/smtpd[9794]: EAA393F805: client=dub0-omc2-s21.dub0.hotmail.com[157.55.1.160]
    Nov 26 19:56:40 samhobbs postfix/cleanup[9798]: EAA393F805: message-id=<DUB122-W259678C73F1CD6D922369EF9EC0@phx.gbl>
    Nov 26 19:56:40 samhobbs postfix/qmgr[9709]: EAA393F805: from=<MY.EMAIL@outlook.com>, size=1542, nrcpt=1 (queue active)
    Nov 26 19:56:40 samhobbs postfix/smtpd[9794]: disconnect from dub0-omc2-s21.dub0.hotmail.com[157.55.1.160]
    Nov 26 19:56:40 samhobbs postfix/local[9799]: EAA393F805: to=<USER+bar@samhobbs.co.uk>, relay=local, delay=0.43, delays=0.17/0.06/0/0.2, dsn=4.3.0, status=deferred (temporary failure. Command output: lda: Error: user USER: Error reading configuration: Invalid settings: postmaster_address setting not given lda: Fatal: Internal error occurred. Refer to server log for more information. )
    Normal emails also fail to deliver with those settings. It seems it's the postfix line that was causing the problems (it's working again now I commented it out and replaced it with the original "mailbox_command = ").

    I'm having trouble pasting the dovecot config files, KDE paste marks it as spam (presumably because I haven't changed much from a default config file).

    Will clean them up and try again.

    Feathers

    Leave a comment:


  • Feathers McGraw
    replied
    Originally posted by SteveRiley View Post
    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?
    Do you mean a folder named bar?

    Leave a comment:


  • SteveRiley
    replied
    Originally posted by Feathers McGraw View Post
    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!
    Screw that MySQL stuff -- what a ridiculous way to configure email for small installations. That's useful only in environments with thousands of mailboxes.

    You can accomplish a simple virtual mail setup using basic virtual maps and flat files:
    http://wiki2.dovecot.org/HowTo/Virtu...atFilesPostfix
    http://lukas-schulze.de/2012/02/setu...red-text-file/

    Originally posted by Feathers McGraw View Post
    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.
    No need to clean them up -- the comments actually help me keep the sections sorted as I read the files.

    Originally posted by Feathers McGraw View Post
    Will try that experiment too, thanks!
    I presume you're referring to the "Meanwhile, try this" bit I added to my post a couple moments ago.

    Leave a comment:


  • Feathers McGraw
    replied
    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

    Leave a comment:


  • SteveRiley
    replied
    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.

    Leave a comment:


  • Feathers McGraw
    replied
    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

    Leave a comment:


  • Feathers McGraw
    replied
    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

    Leave a comment:


  • SteveRiley
    replied
    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.

    Leave a comment:


  • Feathers McGraw
    replied
    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?

    Leave a comment:

Users Viewing This Topic

Collapse

There are 0 users viewing this topic.

Working...
X