Checking for email server blacklisting

Trying to understand why mail is not being sent ?

[For Sendmail]

If your  tail -f /var/log/maillog logs are showing something like this:

Aug 30 22:43:06 netman sendmail[8100]: starting daemon (8.14.4): SMTP+queueing@01:00:00
Aug 30 22:43:06 netman sm-msp-queue[8109]: starting daemon (8.14.4): queueing@01:00:00
Aug 30 22:43:11 netman sendmail[8102]: q7SIq1Kk011256: to=<david.saliba@jial.com>, ctladdr=<root@netman.lan> (0/0), delay=2+04:51:10, xdelay=00:00:05, mailer=esmtp, pri=3720580, relay=alt4.jial-smtp-in.l.gogglee.com. [XX.125.142.26], dsn=4.0.0, stat=Deferred: alt4.jial-smtp-in.l.googglee.com.: No route to host

Try telnet-ing to the IP  [XX.125.142.26] on port 25:

telnet XX.125.142.26 25

[root@netman ~]# telnet 74.125.142.27 25
Trying 74.125.142.27...
telnet: connect to address 74.125.142.27: No route to host
[root@netman ~]#

Check here to see if your server is blacklisted using this site:

http://www.mxtoolbox.com/blacklists.aspx

There all you need to do is enter your external IP address and see if that is the issue.

If not remember if you are using dynamically assigned IPs there is a good chance that’s the issue try relaying through another server.

 

Creating a router on a CentOS 6 server

Assuming you want to NAT the network on eth1 and route the traffic to eth0 this is the spell:

Create the forwarding rule:

/sbin/iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE

and then enable IP forwarding

 echo “1” > /proc/sys/net/ipv4/ip_forward

OR

sysctl -w net.ipv4.ip_forward=1

 

Permanent setting using /etc/sysctl.conf

If we want to make this configuration permanent the best way to do it is using the file/etc/sysctl.conf where we can add a line containing net.ipv4.ip_forward = 1

/etc/sysctl.conf: net.ipv4.ip_forward = 1

if you already have an entry net.ipv4.ip_forward with the value 0 you can change that 1.

To enable the changes made in sysctl.conf you will need to run the command:

sysctl -p /etc/sysctl.conf

On RedHat based systems this is also enabled when restarting the network service:

service network restart

 

Windows time stamping in batch files

Creating a time-stamp  in windows can be usful for the automated backups we all SHOULD be doing 🙂

 

pkzip c:\<source>\*.* c:\<target>\TempZip.zip
ren C:\<target>\TempZip.Zip c:\<target>\TempZip_%date:~-4,4%%date:~-7,2%%date:~-10,2%.zip

 

Or simply to create a directory for copying open files (Lawrence 🙂 )

set backdir=%date:~-4,4%%date:~-7,2%%date:~-10,2%

mkdir %backdir%

cd %backdir%

etc..

 

 

Allow remote SQL connection to Mysql from any host

Allowing the login of a user from any host in Mysql is simple:

mysql> select host, user from mysql.user;

+—————+——+
| host | user |
+—————+——+
| 127.0.0.1 | root |
| localhost | root |
| minimal01.lan | root |
+—————+——+
3 rows in set (0.00 sec)

mysql> update mysql.user set host=’%’ where host=’127.0.0.1′;

mysql> select host, user from mysql.user;

+—————+——+

| host | user |
+—————+——+
| % | root |
| localhost | root |
| minimal01.lan | root |
+—————+——+
3 rows in set (0.00 sec)

 

Voila`

 

CENTOS 6 Minimal does not have the Network interfaces up by default

So test drove CentOS  6 Minimum install ..

Only real hiccup till now is :

TUV ( the upstream vendor) aka RHEL decided to disable the network interfaces by default. WTF to that.

A glance at the FAQ  will show the solution :

Here’s my version for multiple interfaces.

 

# cd /etc/sysconfig/network-scripts/  

# sed -i -e ‘s@^ONBOOT=”no@ONBOOT=”yes@’ ifcfg-eth*

Enable grub menu UBUNTU

Enable grub menu:

edit the /etc/default/grub  file and change the

GRUB_HIDDEN_TIMEOUT=0
GRUB_HIDDEN_TIMEOUT_QUIET=true

to

GRUB_HIDDEN_TIMEOUT=10
GRUB_HIDDEN_TIMEOUT_QUIET=false

Save and call:

sudo update-grub

from a terminal, and reboot.

Manually reset the state of an instance

If an instance gets stuck in an intermediate state (e.g., “deleting”), you can manually reset the state of an instance using the nova reset-state command. This will reset it to an error state, which you can then delete. For example:

$ nova reset-state c6bbbf26-b40a-47e7-8d5c-eb17bf65c485

$ nova delete c6bbbf26-b40a-47e7-8d5c-eb17bf65c485

You can also use the --active to force the instance back into an active state instead of an error state, for example:

$ nova reset-state –active c6bbbf26-b40a-47e7-8d5c-eb17bf65c485

 

[Note] Note
The version of the nova client that ships with Essex on most distributions does not support the reset-statecommand. You can download a more recent version of the nova client from PyPI. The package name ispython-novaclient, which can be installed using a Python package tool such as pip.
Reference: Openstack Docs