Test SMTP AUTH using Telnet

Here is how to test SMTP authentication with telnet using terminal and openssl in Darwin or Linux:

  1. Get your user and password in base64 encoded strings (you need them in base64 because the server wants them to be like that)
    # echo 'myuser' | openssl base64
    # echo 'mypassword' | openssl base64
  2. Open a telnet conneciton susing port 25:
    # telnet myserver.domain.com 25
  3. Greet the server
    # EHLO myserver.domain.com
  4. Tell the server you want to authenticate
    # AUTH LOGIN
  5. The server now asks you in a base64 encoded string to enter user. Enter the encoded string you received for 'myuser' in point 1
  6. The server now asks you for the password, again in a base64 encoded string. Enter the encoded password received from point 1
  7. You should see a message now with authentication succeeded or authentication failed

Ensim 10.x/CentOS 5.10: upgrade MySQL 5.0 to 5.5

Hello,

as you may have noticed, CentOS 5.10 has stopped upstream updates for its stock MySQL version which is stuck at version 5.0.95. They have added MySQL 5.5 now to their repository but these packages are installed in different locations and have other startup-scripts then the default stock version, so that they can be run at the same time, but that's not very compatible with Ensim and its database management. Therefore I wrote a small upgrade script which removes MySQL 5.0 and installs 5.5, taking care of Ensim's database structure. Here are some script requirements:

  • python 2.4+ installed
  • EPEL and IUS repositories installed
  • all stock mysql55 packages excluded in yum (found in /etc/yum.repos.d/CentOS-Base.repo)

Here how to do the upgrade:

  1. download my script and place it wherever you want and unzip it
  2. check if all requirements above are fulfilled
  3. launch my script with: python /path/to/upgrade_ensim_mysql.py
  4. edit /etc/virtualhosting/filelists/mysql.sh and add following lines to it:
    N:S,rpm:mysql55
    N:S,rpm:mysql55-server
    N:S,rpm:mysql55-libs
    N:S,rpm:mysqlclient15
  5. edit /etc/init.d/mysqld and remove the parameters –skip-bdb and –skip-innodb
  6. now restart your mysql server as usual and do an ensim maintenance

For all the admins who are sceptic about user programmed scripts, here is what it basically does:

  • backup old needed files
    /etc/my.cnf
    /etc/init.d/mysqld_app_init
    complete mysql dump to /root/mysql_backup.sql
  • removes mysql5.0 packages without their dependencies
  • installs needed mysql55 packages
  • unlinks all symlinks and relinks the databases
    this step is needed because mysql50 supported database names with "-" in it, mysql55 doesn't, thus the "-" is replaced by "@002d" in the symbolic link
  • upgrades all database using mysql_upgrade
Ensim MySQL Upgrader (439 downloads )

Sendmail: 5.6.0 DSN data format error

I had a problem with a local webserver when sending out email through php to an internet mail server which accepted only valid domain names resolvable by dns. You can masquerade the local domain/server name by enabling following lines in /etc/mail/sendmail.mc

MASQUERADE_AS(`mydomain.com')dnl
FEATURE(`masquerade_envelope')dnl
FEATURE(masquerade_entire_domain)dnl

and recompile your sendmail.cf:

# m4 /etc/mail/sendmail.mc > /etc/mail/sendmail.cf