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

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()?

Related

Unable to connect to the email server (pop3) with Gmail

I am trying to connect to a secure outgoing server(pop3 port) of my website to receive all emails to my Gmail inbox.
but in my web control panel, the name of the outgoing server is "centos-2gb-nbg1-4" without any domain name or domain suffix in end. I am unable to connect to the server with Gmail when I put the exact name(centos-2gb-nbg1-4) copied from web panel to Gmail. Is anything should be added before/after this outgoing server name before putting in gmail? like this: centos-2gb-nbg1-4.example.com ?
Your outgoing mail server is to send mail out, in your question above you are requesting to receive e-mail to your inbox, so you want to login to your cPanel of your website lookup your Mail settings for your server and look for "Incoming Mail Server" and Port. That is the value you need. To check outgoing, look up your DNS records within your CPanel, it usually is "somevalue.your-domain-name.com" (mail.example.com, or smtp.example.com). Your webhosting provider support team can help with specifics.

send/receive mail from OWIN self-host webapp with custom domain

I have a domain, a Console Application with OWIN self-host.
The Console app host on AWS EC2 server windows server 2012.
My mail feature of server is sending Verification Mail
I've google many owin mail send or receive infomation,
but all of them are smtp/pop3 on google or some other smtp/pop3 server.
Is it possible to do send / receive mail in a console with current ip or custom domain?
I've try method.
Use hMailServer:
No luck in this. can't send/receive any mail, and set gmail for add smtp and pop3,
but fail.
the error msg: "We were unable to locate the other domain. Please contact your other provider."
Use AWS SES:
Still fail on this.
AWS SES need vail domain with anyaccount#domain, but i have no mail feature on my server.
Use my gmail:
Connect gmail need SSL. I have no SSL.
And research hours for host ssl on OWIN self-host,
Is there other solution for this?
I set a DNS MX Record from my DNS provider.
Now,I can send/receive mail with hamilserver and gmail smtp/pop3.
not best solution, but my problem solved.

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

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.

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

SMTP authentication whitelist

I run a mail server on my web server, it has SMTP authentication enabled and I added my server's IP address to the whitelist, so no password is required to send out emails if they come from within the server. I did this to allow my web applications to use the SMTP service.
My question is can a spammer spoof a packet with my own IP address and bypass the SMTP authentication?
Emails sent from my email server often end up in the recipient's spam folder and I'm trying to figure out why. I send no more than 200 emails per month.
It isn't possible to spoof your address unless the attacker is between you and your server (which is very unlikely - he would have to be an ISP or to be able to overwatch and control your internet traffic). This is because after an attacker sends a connection request to your server, the server sends a packet to you that the attacker needs to have to be able to establish a connection: http://en.wikipedia.org/wiki/TCP_handshake#Connection_establishment
Try to look at the headers of a mail that gets into the spam folder and look for something that says that your servers IP is blacklisted or something like that.