How to configure an Internet mail server to use with IIS website - email

I am looking for a little direction to my problem. Short story, I have a website hosted on a web server. I pay a yearly subscription. This year I am planning on taking it off and hosting it internally. I already backed up, restored, and installed all necessary components (on Windows BTW with IIS, PHP, and MySQL). The site works great internal and by IP address externally through a firewall. (IP address for now until my web host subscription expires, then I will forward and register DNS).
But now this is my problem, my website has email functionality which works on my providers server. I want to install a local mail server for my website that will wind up sending and receiving emails through my website. I am lost here. No sure which path I should take. I have installed and used Exchange 2003 in the past just for internal domains, nothing for internet AND internet.
Anyone with ideas, links, suggestions? I see that IIS does support SMTP virtual servers, is this a possible route? If so, what about POP3 or IMAP (incoming) server solutions?
Thanks
Edit
---Update On Situation---
So far I have configured a local exchange server that works with my local webserver. I then created a CNAME in my web host DNS zone for my IP address. I created a simple subdomain for my site redirected to my home web server. Everything works great, internal email through Exchange 2003 from website on IIS, redirected DNS names, almost there. Now I just need to create Internet Mail functionality in Exchange. Went through the Exchanges wizard to "open system" for Internet mail, created new SMTP connector and ....nothing for external mail test. Failed! Thought everything was configured properly. I also tried to open all ports on firewall, 25 and 110.

I'd recommend using something like PostMarkApp to send transactional email from the website, and use hosted email (Google Apps for Domains) for your email. Its a pain to run a real mail server.

Link to Exchange Internet mail SMTP connector configuration:
Configure Exchange Internet Mail SMTP Connector
Well, I did figure it out. I was on the right path and everything was working but I just configured my client wrong and my ISp blocked port 25, duh. CHanged port to unused 366. But here is a little tip for anyone that may need to figure this out in the future.
1)Setup install IIS with default SMTP and NNTP virtual servers.
2)Install Exchange into organization. Internal naming convention doesn't really make a difference between internal to externally if you are behind a firewall. Basically this means you don't have to create a seperate zone in DNS if using this for a seperate domain hosted elsewhere. Hope this didn't confuse anyone.
3)Right click on server name in Exchange System Manager and go to Internet Mail Wizard
4)If you want your clients to hold a different domain email address than your internal you can setup in exchange through
Exchange System Manager >> Recipients >> Recipient Policies
Then add a Masquerade in Default SMTP Virtual Server
5)Have a gmail Internet SMTP connector set to smtp.gmail.com as smart host with a gmail email account settings and TLS checked
6)Default SMTP VS set with outbound port 587 and TLS checked
If you need to change SMTP ports too, don't forget to change not just firewall but also inside Exchange.

Related

Sending mail using GCP on private network

More than a simple question-answer, this is more of a recommendation post. Want to see what ideas I have to work with. I am working on porting my company's work to the cloud (GCP) Most of this work is in the form of a pipeline. I'd like to notify completion via email.
The company I work for has a private network. And so the only way to use their mail config is to send it through their internet, and so, cannot use their SMTP-config from GCP.
What's the best way around this?
I'm looking into creating a VPN between GCP and our local network, however, that may not be possible (IT restrictions)
Do I have any other options?
EDIT
What an SMTP Relay work? This guy.
By default, Compute Engine allows outbound connections on all ports but port 25,so if you need to send an email from the instance you have to use port 465 or 587.
GCP explecitely recomends using other third-party tools such as SendGrid, Mailgun, and Mailjet because they offer a free tier package, you can skip all that and connect your instance to Gmail SMTP Relay Service. You will need a Google Account to connect (gmail or Gsuite).
Instructions to configure the Google Account are HERE , I tested sending emails from my MySQL server and Debian 9

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?

A way to forward or intercept smtp mail request to localhost?

Wondering if we have options for a failing smtp mail at "localhost" after changing DNS host.
The problem setup is this:
SMTP mail is being sent from a server, with mail being configured on the server itself. Originally, server was host of DNS domain as well as web app.
Using JavaMail, a request is sent to "localhost" without any authentication
The DNS settings have changed, server hosting web app is no longer the "from" email address
The Java web app cannot be modified and is still sending to "localhost"
Question: Do we have any options?
I'd like to intercept the "localhost" smtp mail request and forward it along to our domain's mail server, with new credentials, but am unsure if that is possible. A stand-alone script to watch for those requests?
We did receive the suggestion to edit our DNS settings on the new hosting and add "MX" and "A" records, but that would require a change of source code, which is not an option at this time.
Thanks!
If there's no SMTP server running on localhost, and you just want to redirect mail to another mail server without authentication, you could use a simple "proxy/tunnel" using something like the "netcat" program.
If there is an SMTP server running on localhost, you might be able to configure it to forward all messages to your other mail server.
Otherwise, is it possible to change the properties used by JavaMail in your web app, without changing the source code? For example, do the properties come from a file or from System.getProperties()?

Connect Outlook 2010 from a Exchange Account from a different domain

I'll try to be clearest as possible as I think this is not a usual situation. If you need more details, please say it.
I work on a company that has an Exchange Server. They provide a laptop which is on company domain and I can connect in Outlook just fine with my company e-mail. If I go home with my company laptop I can connect via VPN to company domain and connect to Outlook just fine as well.
We have a webmail which we can use in ANY untrusted computer on browser, something like webmail.mycompany.com and I just need to put my username and password to connect.
I also have an Android smartphone which is not on domain as well and I can configure it to connect to my company Exchange mail.
However I work on a remote server which is not on company domain (I can't change the domain on the remote server) and I'm trying to configure Outlook on the remote server unsuccessfully...
I'm very confused and wondering:
If I can connect via VPN to my company Exchange mail on Outlook anywhere as long as I have internet access on my company laptop
I can connect to my company Exchange mail on a webmail on browser on any computer (not on company domain) providing username and password.
I can connect to my company Exchange mail on my Android smartphone (not on company domain) by providing the Exchange mail server, username, domain and password.
Question: Is it possible to connect to Outlook in a different domain on a remote server with the information I have?
Thank you!
If an Exchange server is published correctly with ActiveSync enabled, then an device that supports ActiveSync should be able to connect to it. I am contracted out to 4 partner organisations during the week, 1 orgs email is Exchange Online, the others are local exchanges, one each of 2007, 2010, 2013.
I can easily hook up my email accounts to each of these from my phones, outlook 2010 at home (not connected to the domain or VPN) and outlook 2013 in the office (that is domain connected). (For 2 of these orgs my first job was to correctly publish their exchange farm for their employees)
You mentioned a VPN tunnel, if you have to establish a VPN to connect to the exchange then it sounds like it has not been correctly published externally, possibly by design.
The first thing you should do is talk to your Exchange Admin and ask them to confirm or publish the Autodiscover and ActiveSync related services for the exchange you wish to connect to externally, it's quite secure by default and has been designed to be used in this way so you shouldn't get much resistance on this front.
If you are the admin, or just playing along at home, then your next stop should be the Microsoft Connectivity Analyzer https://testconnectivity.microsoft.com , previously testexchangeconnectivity.com... that uses the same protocols that outlook and mobile devices use to connect to MS Exchange, this includes Exchange Online.
If the connectivity analyzer can connect, but your client can't then download the client analyzer from the "client" tab in the connectivity analyzer site. The error prompts are really informative and help to improve your understanding of how the Exchange platform works
Outlook 2010 can only add one domain connected Exchange service at a time, but it can have many activeSync compatible services connected no worries at all. Follow the test results on the connectivity analyzer site described above for guidance, the two most common issues that I come across are:
You primary email alias may not match the autodiscover service. For instance user#email.com might belong to an exchange that is published as 'electronicemail.com' In this case you need to make sure you connect to the exchange service as 'user#electronicemail.com' your default replay to address as configured in exchange will still work as user#email.com, but outlook doesn't know about these details untile after it has established a connection to the exchange server via the autodiscover service.
The other common issue is that the autodiscover service is not contactable externally or does not resolve correctly when you are external. (this happens a lot with Small Business Server and Essential Business server) In these cases you can sometimes make some quick edits to your c:\windows\system32\drivers\etc\hosts file to direct outlook to the right server IPaddress to configure the account. If you add a hosts entry for autodiscover.yourEmailDomainName.whateveritis into your hosts file this can often get around issues caused by the organisations public DNS not being configured for exchange.
Note that the hosts solution above can work in many instances for both of these issues

Mail server redirect to another server

I have a site, which has a server with "Parallels Plesk Panel" installed. I want to send an email from that site a "Contact Us" message to info#domain.com email.
The problem is that this email was already created by one of the programmers using the google mail system (apparently you can create accounts there with a domain name different from gmail.com).
So now, the server rejects my message, telling me that it can't find an email with this name. It works fine when I send to any other domain, but when sending to the same one, it fails. I've created another email info2#domain.com and sent emails there and it works.
My question now is, how do I send emails to the existent info#domain.com which is already created in gmail without making the server block me. One of the options I saw at this panel is to redirect the request for that email to another mailing system (and to specify its IP). Maybe that would help if I would to put there gmails IP?
Thanks.
EDIT:
Using my contact us form I am sending an email to info#domain.com. I get an SMTP error 550, can't find the mail box. When sending to anything but #domain.com it works. When adding that email to my server, it is also fine.
Now, the previous programmer already created info#domain.com, but not with our plesk panel, but using gmail server. Apparently, using gmail you can create an email of the type info#domain.com and not just info#gmail.com. The obvious problem is then that I try to send to this email. It sees that the server is domain.com and tries to find it there (same domain as the site from which I send the message). It fails and gives me the 550 error.
I want the server to send the email with that message to info#domain.com which is actually on gmail.
if I understand correctly, your problem is that two servers think they host the maildomain: your plesk server and gmail.
solution: disable local mail delivery for that domain on the plesk server and make sure plesk can correctly resolve the mx records of that domain , runing dig mx +short domain.com on the plesk server should return a google owned hostname, not the local hostname.
I don't own a plesk server, so I can't tell how how exactly to disable the mail domain, but a quick google search returns: http://www.serveridol.com/2011/03/16/disabling-email-service-for-a-domain-in-plesk/
http://search.yahoo.com/search?p=email+form+service&ei=UTF-8&fr=chr-greentree_ff&type=827316
try a remote email form service. most hosting companies' mail servers are local. to do this, you would have to make your own .htaccess file which contains php.ini mail server settings. i THINK this is correct. you can install php yourself to see what those settings are.
this is something you will probably have to do through the web hosting control panel.
and by the way, XHTML is served up as HTML unless you configure the server to serve XHTML up as XHTML. so use HTML when possible unless you know how to do that. here's how.
http://jesusnjim.com/web-design/setup-test-server.html