MXRecord error when running diagnostics on hMailServer - hmail-server

I have downloaded and installed hmailserver. I want to run it on my local machine and want to send email using a local web application which is also running on my local machine. My web application couldn't send email (got error - couldn't connect to mydomain:25) and thus I thought to first run hmailserver's diagnostic tool to test things.
But when I run diagnostics on it, I see the error:
Test: Collect server details
hMailServer version: hMailServer 5.6.7-B2425
Database type: MSSQL Compact
Test: Test IPv6
IPv6 support is available in operating system.
Test: Test outbound port
SMTP relayer not in use. Attempting mail.hmailserver.com:25...
Trying to connect to host mail.hmailserver.com...
Trying to connect to TCP/IP address 5.189.183.138 on port 25.
Received: 220 mail.hmailserver.com ESMTP.
Connected successfully.
Test: Test backup directory
ERROR: Backup directory has not been specified.
Test: Test MX records
Trying to resolve MX records for mydomain.com...
ERROR: MX records for domain mydomain.com could not be resolved
Test: Test local connect
Connecting to TCP/IP address in MX records for local domain domain mydomain.com...
ERROR: MX records for local domain mydomain.com could not be resolved
Test: Test message file locations
Relative message paths are stored in the database for all messages.
Test: Test IP range configuration
No problems were found in the IP range configuration.
To be honest, I don't know what MX Record is and how to set it up. Things I have done so far are:
Installed hmailserver (obviously!)
Added a domain (mydomain.com)
Added an account in mydomain.com (signup#mydomain.com)
In settings->Protocols ->SMTP, I added localhost in Delivery of email ->Localhostname section
In c:\Windows\System32\Drivers\etc\hosts file, I added entry 127.0.0.1 mydomain.com #for play application
When I run netstat -a, I see that hmailserver is listening on port 25 (I tested it using net stop hmailserver and net start hmailserver)
Proto Local Address Foreign Address State
TCP 0.0.0.0:25 DESKTOP-6PLQOLJ:0 LISTENING[/list]
Have I made a mistake?

This Error Message is shown if your Windows Operating system DNS-Resolver Service points to an DNS-Server which doesn't know anything or cannot forward the Query to the DNS-Server in charge for the specified Domain and its MX-Record.
In short terms: Without having your DNS-Domain correctly configured, hMailServer (or any other SMTP-Server) can't work.

Related

CentOS 7 vsftpd keeps rejecting PhpStorm FTP Connection

I recently installed vsftpd on a server at my home for local development utilizing CentOS7. I went through the setup, and enabled passive mode, set up my ports, put my port forwarding on in my router, and then when I go to connect through PhpStorm, it rejects the connection.
I'm not sure what's going on, I've tried enabling Anonymous login, using a user, root. Nothing seems to work. Please let me know any information I can add.
The result from Test Connection is as follows:
Connection to '10.0.0.110' failed.
Connection to FTP server on "10.0.0.110" rejected.
Here are results from a FileZilla attempt.
Status: Connecting to 10.0.0.110:40000...
Status: Connection established, waiting for welcome message...
Response: 500 OOPS: failed to open xferlog log
ile:/var/log/vsftpd/vsftpd.log
Error: Critical error: Could not connect to server
Alright, so here is the answer, after looking in to what #LazyOne posted. I needed to change permissions as the first step. chmod 644 / 755 for files / dirs.
After that, I added in a listen_port=40000 to my vsftpd.conf file.
Then, I added in port_enable, pasv_address=<my internal ip address for my server> and lastly, pasv_addr_resolve=NO, as I have a static IP on my server.
I also added additional ports to the passive settings 40000-40500, as I've read this will allow multiple connections and will solve another error I was having.
After all of this, I opened up the ports in my server firewall-cmd --add-port=40000-40500/tcp --permanent, and added port forwarding in my router to allow this.
After all was said and done, I was finally able to connect to my FTP.
Hopefully this will help someone.

I am not able to connect to mysql server running on Google Compute engine from another instance using internal IP

I located the /etc/mysql/my.cnf file
I changed the bind-address
first to 0.0.0.0 I received a '111 Connection refused'
then I changed it to the instance I am trying to connect to It still says '111 Connection refused'
the firewall rule allows connection on port 3306 using internal ip so I dont know the problem. Thanks
It seems that you have already taken the necessary steps to connect to MySQL server from GCE your instance. Based on the Stackoverflow case here the recommendation to resolve this problem is to comment this line below (add # at the beginning of the line) in your my.cnf file:
skip-networking
Once done you need to restart MySQL service
sudo service mysql restart
On the GCP side, if you have allowed the IP ranges you want to use with the specified port(3306), it should work fine.
You can also use “nmap” command to verify if port 3306 is open on your GCE instance with MySQL installed.
GCP provides CloudSQL which is a managed MySQL instance. You can access CloudSQL from your GCE VM using private address. This feature reached beta recently. This link provides detailed information about using private IP to connect to your Cloud SQL instances.
Before configuring a Cloud SQL instance to use private IP, you need some steps to be taken. This document provides step by step instructions for configuring an instance to use private IP.
You can use 'netstat -tunlp | grep 3306' command to verify that the MYSQL process is running on port 3306.
This error can also occur when mysql user account does not accept connections from any IP addresses. It may still use localhost parameter to connect to the server. I would recommend adding a user with remote access or granting existing user access to remote sources. You can see this: link for the similar issue and follow the steps recommended there to resolve.

Unable to connect to Mysql from Django app - AWS, EC2, RDS

I am having trouble connecting to my RDS MySQL Database.
My current Set up:
Django 1.9+
AWS - Launched an EC2 Instance (Amazon Linux). Launched an RDS instance of MySQL (5.6.7). I created a Virtual PC (VPC) for the EC2 instance and RDS instance, and in that group created several security rules so the EC2 instance could connect to the MySQL RDS. Below are the security rules I use and associate with the VPC.
Inbound Rules: (Type, Protocol, Port Range, Source)
1. Http , TCP, 80 , 0.0.0.0/0
2. SSH , TCP, 22 , <homePC address>/32
3. HTTPS, TCP, 443, 0.0.0.0/0
4. MYSQL/Aurora, TCP, 3306, source (my created security group)
Nginx - Serving my content redirecting from port 80 to port 443. I created SSL certificates in order to make my site secure. I correctly served my Django application, and the static files. Nginx serves everything great!
Previously I was able to connect to my RDS instance. I did not set up an elastic IP at that point in time, as it took some time to transfer my domain over to Route53 (amazons DNS). I successfully was able to transfer it, and associate it with my EC2 instance and even start my application
The problems -
First Problem I cannot connect to the RDS from my EC2 instance. I have checked my django settings file and the secret file (the one that feeds my settings file with sensitive information which I keep out of version control). Here are examples of my settings for the mysql connection - I changed them obviously
"DATABASE_NAME":"myDatabase",
"DATABASE_USERNAME": "myUsername",
"DATABASE_PASSWORD": "myPassword123",
I double checked the username and password in the RDS console, and even reset the password.
After I went ahead and activated my virtual environment and attempted to connect.
python manage.py dbshell
My Error was
ERROR 1045 (28000): Access denied for user 'myUsername'#'<private IP address from Elastic IP>' (using password: YES)
Notive the user name is not what I utilized in the settings. It changed. I feel this is the root cause of the problem, but am unsure why Django would change my username in such a manner.
Second Problem - I also try to connect to the database directly using mysql. I double check my endpoint, username and password are correct, but also run into trouble connecting.
Note - As I said, I was able to connect in both manners listed above before acquiring my IP address. Thus my troubles are configuring security rules to allow a permanent IP address, and being unable to use TCP connect to use the Mysql client to log in.
Thanks in advance.

How to set mysql_protocol_tcp in Objective C Mysql client

I downloaded Karl Kraft's MySQL source and libraries and built a mysql client lib for iOS 6. It worked beautifully the very first time on the local mysql database. Even handled blob data nicely.
The next step was to port forward to a remote database. After downloading various libraries and tearing out my hair, I went looking for a packaged solution.
I downloaded Chilkat's SSH Tunnel library (free 30 day trial -- and $149 -- worth it all). That worked the first time too. It was a pleasure after days and daze of not building, not linking, not compiling, not finding symbols for i386 blah blah blah!!
OK, so here is the kicker. I now want to work with a remote database. When I did the 3306 ssh port forward through ssh port 22 to 3306 on a database machine behind the firewall. Now I turn off mysqld, and my host is localhost port 3306. I have a slight problem with mysql.
The default start of the client on a UNIX/MAC machine is looking for a socket connection on localhost.
I get the following error:
Error: Can't connect to local MySQL server through socket '/tmp/mysql.sock' (38)
I need a TCP protocol start option for mysql. With a command line, it is easy --protocol=TCP.
With the iOS client lib, it is not readily apparent. I did a search and in the mysql.h we have the mysql_protocol_type and the constants MYSQL_PROTOCOL_DEFAULT, MYSQL_PROTOCOL_TCP etc etc.
The missing knowledge that I have, is how to set the option programatically in Objective C.
There is a server object that just defines the parameters (server, name, ports, username, password) and the next object is a connection object that calls mysql_init(). Does anyone have any clues on how to do this?
BTW: Karl Kraft and the guy from ChilKat should have their blood preserved for posterity. They saved me a lot of time.
Thanks in advance.
Took me a while to figure this out. With the MySQL client, if you specify connection to 'localhost', it tries to connect with a UNIX socket at either /tmp/mysql.sock or /var/lib/mysql.sock. However if you specify localhost as 127.0.0.1, then it connects with a TCP protocol equivalent to --protocol=TCP.

sqldeveloper and cpanel

i can't access my website mysql db from sqldeveloper.
in cpanel there is an option (Remote Database Access Hosts) which allows one to add IP addresses that can access the db. I have entered my ip address and i have used the % wildcard.
so for instance if my ip address was 12.34.56.78, i have entered my ip address as:
1 - 12.34.56.78
2 - 12.34.56.%
3 - 12.%.%.%
in sqldeveloper i have downloaded and added the mysql third party jdbc driver .jar file (mysql-connector-java-5.1.13-bin.jar).
i have the right user name, password, hostname and port.
so, if my website domain was called www.mysite.com and my username was user, the username i would use in sqldeveloper would be mysite_user.
and the hostname would be www.mysite.com.
the port i am told via cpanel is 3307.
i bow to any superior knowledge if my assumptions are incorrect.
any help would be appreciated
-- edit --
oh yeah, the error message I get (pretty important!) in sqldeveloper is
Status : Failure - Test failed: Communications link failureThe last packet sent successfully to the server was 0 milliseconds ago. The driver has not received any packets from the server.
-- end edit --
I do the same via cPanel but after i connect to my host via SqlYog community edition...
Uniqe differce is the port, i use the standard 3306 port instead a custom port.
Try if it connect: http://code.google.com/p/sqlyog/
It turns out that i did need to use port 3306 but more importantly, my web host needed to make a change on their firewall.
i managed to connect using mysite.com, username, password and port 3306.
thanks #Achilleterzo for your help in the meantime