Configuring Getmail

Discussion in 'Installation/Configuration' started by Bob White, Dec 28, 2016.

  1. Bob White

    Bob White Member

    I've set up a server according to the article The Perfect Server - Ubuntu 16.04 (Xenial Xerus) with Apache, PHP, MySQL, PureFTPD, BIND, Postfix, Dovecot and ISPConfig 3.1. I have a number of email accounts hosted at my ISP and I'd like to accumulate the email to my own server where I can read it all in one place. I don't own a domain name, but have made up one to use on the server (thecovey.net). All of the setup and configuration has gone well and I'm able to send mail from RoundCube, but I've not figured out how to actually get mail from my ISP into my inbox.

    What seems to happen is that ISPConfig configures GetMail to run every 5 minutes, and it does. It pulls any email back, processes it, but when it gets passed off to Postfix, Postfix sends it off to my ISP, who rightly doesn't know what to do with a non-existent domain. Postfix winds up storing it all in a Maildir under /etc/getmail.

    I've attached the relevant lines from the log file.

    It looks like Amavis is the last thing to touch the mail before it gets sent back out to my ISP. I have had a similar setup some years ago that worked just fine, although it worked with Fetchmail. I was able to retrieve mail when I manually installed and ran Fetchmail here, but would prefer to stay with what's configured in ISPConfig if at all possible. The solution is probably a simple configuration tweak, but I'm not sure where to begin with it.

    Any help will be greatly appreciated!

    Thanks,

    Bob
     

    Attached Files:

  2. till

    till Super Moderator Staff Member ISPConfig Developer

    and you created a mailbox [email protected] on the ispconfig server? If not, then postfix must pas it back to your ISP like any other outgoing email.
     
  3. Bob White

    Bob White Member

    Till,
    Yes, the mailbox has been created.

    upload_2016-12-30_14-6-3.png
     
  4. till

    till Super Moderator Staff Member ISPConfig Developer

    Please test the mailbox by logging into webmail on this server with the email address of the mailbox and then send an email from within webmail to the mailbox address, the mail should pop up in the inbox after 20 - 30 seconds.
     
  5. Bob White

    Bob White Member

    Nope. I sent the email from Roundcube. It said "Sent Successfully", but the email didn't show up in the Roundcube inbox. Instead, a few minutes later, it showed up in my RoadRunner email account. You'll see the send in the attached log file, around lines 22-24.

    Thanks!

    Bob
     

    Attached Files:

  6. Bob White

    Bob White Member

    Till,
    Do you have any suggestions as to what I might try next? Sending from RoundCube just wound up with the message going to my ISP, who didn't know what to do with it.
    Thanks,
    Bob
     
  7. till

    till Super Moderator Staff Member ISPConfig Developer

    Please post your postfix main.cf file and master.cf file.
     
  8. till

    till Super Moderator Staff Member ISPConfig Developer

    He is the head of IT at an ISP company.

    You must have really good co-workers.

    But we leave the topic, back to the original question:

    You should try it. I posted you the steps that you can follow easily on your ISPConfig server.
     
  9. Bob White

    Bob White Member

    Till,
    I've attached the main.cf and master.cf files. Thank you for your help!!!
    Bob
     

    Attached Files:

  10. till

    till Super Moderator Staff Member ISPConfig Developer

    Please edit the postfix main.cf file and change the mydestination line to:

    mydestination = fileserver.thecovey.net, localhost, localhost.localdomain

    then restart postfix and run the test with the webmail client again. ISPConfig is using a virtual mail user setup, so all email domains are in the ISPConfig MySQL database and postfix reads them from there, so the email domain has not to be listed in mydestination.
     
  11. Bob White

    Bob White Member

    Till,
    I made the change to main.cf, restarted postfix, and sent myself an email message. It went out to my ISP instead of staying on the server. I've attached the lines from syslog starting where postfix restarts.
    I really appreciate your help with this!
    Thanks,
    Bob
     

    Attached Files:

  12. Jesse Norell

    Jesse Norell Well-Known Member Staff Member Howtoforge Staff

  13. Bob White

    Bob White Member

    It's a mailbox - the only one I have defined. I have no forwarding defined.
    Thanks!
    Bob
     
  14. Jesse Norell

    Jesse Norell Well-Known Member Staff Member Howtoforge Staff

    In looking at your log entry again, it looks like the original sender and recipient were both [email protected]; then both sender and recipient were rewritten to [email protected] - I don't think you can even do that via ISPConfig alone, so likely you've configured this outside of normal ISPConfig operation.
    What do you have in /etc/postfix/generic?
     
  15. Bob White

    Bob White Member

    And that was it!! Thank you very much. It contained a line that rewrote the address from bob@... to rwhite4@... Once I commented out that line and reran postmap and restarted postfix, everything started working correctly. Sending mail wound up on the server, not out at the ISP. Getmail started moving the data the way it was supposed to.
    I'm not sure how that file came to be the way it was - there certainly weren't any instructions to create/modify it. Oh, well, at least it's fixed. Probably a boneheaded move on my part.

    Till and Jesse (and others!), thank you very much for the help!

    Cheers,
    Bob
     

Share This Page