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
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.
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.
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
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
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.
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.
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
Your message to [email protected] was forwarded to [email protected], it didn't try to deliver thecovey.net email externally. Check that [email protected] is a mailbox (not email forward).
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?
And that was it!! Thank you very much. It contained a line that rewrote the address from [email protected] to [email protected] 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