Installing and configuring a barebones email server on Ubuntu - email

I've got an unmanaged Linux VPS running ubuntu that I'm using for the web server for a personal website. I'd like to get a barebones email server up and running. All the installation guides I've found so far are for a full-fledged email server with a webmail interface and everything. That's a lot more than I need. There's only two things I need:
My web application needs to be able to send email. Specifically, it'll be emailing me when an exception occurs.
I want all email sent to [anything]#domain.com forwarded to my personal gmail account. The server doesn't even need to retain the email or anything.
I want to reserve resources for the actual web app, so I don't want to install anything I won't need for this.

msmtp or nullmailer sounds like it would fit the bill for the former. You could use google mail for domains for the latter.

I'll Second Postfix. I've been using it since around 2000 - it's not that hard to set up. However, for what you're doing (relaying to your ISP) msmtp or nullmailer as suggested by geocar will probably do the trick - they appear to be specifically designed for this sort of role - although I've never used them so I can't really comment from experience in the way I can with Postfix.

Your web application needs a SMTP server. That server can be a hosted service like Google's or MailHop. If you really want to be an email administrator postfix should be installed HOWTO is here.
If not:
sudo apt-get install postfix

Related

Viewing emails via browser on Ubuntu

I have a working postfix smtp server on my Ubuntu 20.04 cloud machine. I can send/receive emails using the standard command line "mail" client. I am now looking for a way to do the same via web browser. I already am running nginx on the server.
It seems there are various apps such as RoundCube and SquirrelMail that are available on Ubuntu. However, they seem to require additional pop3/imap server packages to be installed.
As the webmail client is intended to be on the same machine as my smtp server is, I do not see why additional pop3/imap packages need to be installed.
Wondering if there is a simpler way to look at emails via web browser. Regards.
You need to install a web server, PHP (or whatever is required to run the webmail app of your choosing), and an IMAP server.
mail is an email client that knows how to directly access your messages on the filesystem, something that a web app has no capability to do. Also note that it is executed from the context of you having already logged in to your server as a particular user.
It's a Very Bad Idea to give your web server read/write access to parts of the filesystem outside the directories where your web-related files are kept (write access can and should be even more strict).
It's technically feasible to create a webmail app that does what you want (I think there may have been some attempts in the distant past), but it would be limited to systems with a very specific mail system setup and require some questionable permission tweaking. IMAP is the layer that abstracts your particular mail system setup from any of the various mail clients you may want to use to access your messages. It also helps make sure users and apps are not able to access things they should not.
Wondering if there is a simpler way to look at emails via web browser
Not that I can think of. Fortunately, this will get you most of the way there:
apt-get install dovecot-imapd
Dovecot will need minimal configuration in your case, and more time will be spent installing and tweaking whatever webmail client you choose (or you can try Thunderbird). And remember that the IMAP server can be limited to local clients (webmail counts as such) and need not be exposed to the Internet.

How to install mail server on vps (digitalocean)

I need send and receive e-mails. I need configure on Digital Ocean Vps a Mail server.
I need a how to or any recommendation about it. I think I will have to create a database to store messages.
I have seen:
Mailgun: I have created an account and created dns records Mx and Txt but Its not verified yet. So I can't receive email.
SendMail: I think it's I have already installed but I don't know how to send and receive email from hello#domain.com
Postfix: I've tried to install didn't work it
Thanks.
Mailservers are complex beasts of software. Installing your own might be a bad idea, unless you're willing to invest time to
make it secure
protect it against spam and viruses
back up your emails
understand topics such as DMARC and TLS and greylisting
...
See why you may not want to run your own mail server for more information.
Maybe you could use an email provider instead? Google Suite is a great choice :)
There's an open-source solution
Mail-in-a-Box lets you become your own mail service provider in a few easy steps. It’s sort of like making your own gmail, but one you control from top to bottom.
Technically, Mail-in-a-Box turns a fresh cloud computer into a working mail server.

AWS SES + TLS: custom domain for mail servers

When messing around with different mail hosting options I noticed a very aggravating pattern with my Android phone. Neither the built-in mail app nor the gmail app supported email auto-configuration.
When using most mail services such as Namecheap, Zoho, Rackspace, etc. this became a real issue. I would enter my email address and password then instead of it just working like magic, it would invariably fail as it attempted to set the mail server to mail.example.com instead of mail.privateemail.com or smtp.zoho.com
I can configure a CNAME entry for my domain to redirect to these servers and successfully connect to mail.example.com.... up until I try to enable secure e-mail (STARTTLS or TLS wrapper). When I do this the domain name on the certificate does not match up to the domain name I am using to access and the whole thing fails.
Of course setting up my own mail server could be an option, but it could take months or years for my IP address to build up enough reputation to not get auto-blocked by major providers like Gmail or Yahoo. This whole past month DreamHost has been unable to send emails to any address owned by AT&T, which has been nightmarish to get resolved. Not wanting an issue like that, I would like to go with a big name for e-mail hosting.
While looking into Amazon SES to see if it would be easy to set up, I noticed this page on secure tunnels to AWS SES
I'm not super familiar with mail servers and I honestly have no idea what I'm reading on this page. Like I can follow the steps to install and configure this program and run it, but it doesn't accurately say what the purpose is of doing this. Am I right in believing that this might solve my SSL issue and allow me to send mail to mail.example.com without any issues? If so, is there any additional setup that I will require which is not adequately explained by this article?

my magento website can‘t use email function, maybe it is about the vps email setting? anyone can help me?

i'm running a new store on magento, the contact us show successfully sent email to me, but i didn't get any email. i'm using google email address, but for the vps setting i'm not sure how to set up it. as i'm using linux vps.
If you are using personal VPS hosting, you have to install email server or ask support to do that. The most popular one for Linux is Postfix. You can find a lot of information how to install postfix depend on Linux distrubution. I recommend you to install postfix and use mysql to configure such settings like email forwarding, user list, etc.

Wordpress - Contact Form 7 Not Sending to Certain Email

I am using Contact Form 7 with Wordpress, but I am experiencing an email compatibility issue.
I have the form setup to email to email#domain.ca, domain.ca being the domain of the website hosting the site. The email address exists and works great, however the Contact Form keeps failing on send.
If I change the email address to any of my Gmail or other accounts, it works fine.
I am looking for ideas or suggestions as to how I might debug this. Is it because the site is hosted on a shared hosting server but the mail server is in-house at the physical location?
Any ideas would be great.
Ended up being an MX Entry problem with the shared host.
I had to set the MX Entry to send mail to an external host instead of the internal mail servers (it didn't realize the mail server was external).
Problem solved and all is well.
EDIT: We have run into this issue multiple times now with the hosting.
Essentially, cPanel gives you an option to say that mail servers are external, but it often fails to deliver on actually making the change. We have to remove the mail servers and hardcode the external one in order to make it work properly and consistently.
Might be php or smtp mail restrictions at your hosting service. Try http://wordpress.org/extend/plugins/wp-mail-smtp/