Error compiling qmail-1.03: [qmail-remote.o] Error 1

November 8, 2009 linuxfix 2 comments

If you get the following error while compiling qmail-1.03

./compile qmail-remote.c
qmail-remote.c:36:25: openssl/ssl.h: No such file or directory
………………………..
………………………..
qmail-remote.c:590: warning: return type of `main’ is not `int’
make: *** [qmail-remote.o] Error 1

For debian try this
# apt-get install libssl-dev

Categories: Uncategorized Tags: , ,

Troubel with .docx?

September 13, 2009 linuxfix Leave a comment

Many of you may be using MS Office version older than 2007. The 2007 Office  has a trendy extension for .doc which is .docx and similarly .xlsx for excel documents and .pptx for powerpoint presentation.  Now what happens when you receive a document from someone in the new format and your old MS Office simply doesn’t know what to do. Well of course you can upgrade to Office 2007 but as a temporary, quick a, easy and cost-free solution you can download a converter from Microsoft’s site and install it in your computer and your done! Here is the link below:

Microsoft Office Compatibility Pack for Word, Excel, and PowerPoint 2007 File Formats

Here are the file details:
File Name: FileFormatConverters.exe
Version: 3
Date Published: 4/22/2009
Language: English
Download Size: 27.5 MB

A good place to find stock photo

September 13, 2009 linuxfix Leave a comment

I was looking for some still photos for a friends presentation and found this site pretty much helpful.

http://www.istockphoto.com/index.php

iStockphoto is the internet’s original member-generated image and design community. Find your inspiration on the world’s leading royalty-free stock destination. Search for over 4 million photographs, vector illustrations, video footage, audio tracks and Flash files.

The new debian (Lenny) repository list

June 10, 2009 linuxfix Leave a comment

The new debian (Lenny) repository lists are given below. You may replace the ‘fr’ with your nearby mirror country code.

deb http://ftp.fr.debian.org/debian/ lenny main
deb-src http://ftp.fr.debian.org/debian/ lenny main

deb http://security.debian.org/ lenny/updates main
deb-src http://security.debian.org/ lenny/updates main

deb http://volatile.debian.org/debian-volatile lenny/volatile main
deb-src http://volatile.debian.org/debian-volatile lenny/volatile main

Keep your Clamav updated using debian APT volatile

You can easily keep your debian Clamav updated by using apt-get. All you need to do is enter the volatile repository in your /etc/apt/source-list file. Please only use either etch/volatile or lenny/volatile with

deb http://volatile.debian.org/debian-volatile etch/volatile main contrib non-free
or
deb http://volatile.debian.org/debian-volatile lenny/volatile main contrib non-free

After adding the entry run:

# apt-get update

# apt-get install clamav-daemon

# apt-get install clamav-freshclam

Once all the installation is successfully done you may enter-

# freshclam

# clamd -V

to see everything is up2date. :)

Categories: Debian, Linux, Qmail Tags: , , ,

Apt-get update error: W: There is no public key available for the following key IDs:

April 21, 2009 linuxfix 1 comment

While running apt-get update or aptitude update you may come across the following error

W: There is no public key available for the following key IDs:
4D270D06F42584E6
W: You may want to run apt-get update to correct these problems

Run the following command to resolve this:

# apt-get install debian-archive-keyring

APT- Get Error – Dynamic MMap ran out of room

April 21, 2009 linuxfix Leave a comment

Put the following in  /etc/apt/apt.conf.d/70debconf

APT::Cache-Limit “141943904″;

Qmail error: 421 unable to read controls (#4.3.0)

April 18, 2009 linuxfix Leave a comment

While upgrading to the John Simpson’s new combined patch for qmail or doing a fresh install you may see the following error after replacing the old smtpd-run file with the Simpson’s new run file.

root@test# telnet localhost 25
Trying 127.0.0.1…
Connected to localhost.
Escape character is ‘^]’.
421 unable to read controls (#4.3.0)
Connection closed by foreign host.

This is due to some default settings in the smtpd  run file which you have downloaded from the jms’s site. If you look at the file at /services/qmail-smtpd/run file using any editor you will find the following defult settings as shown below. Give special attention to the red marked area below and make sure the smtp.cdb file,validrcptto & qmailscnner settings are in place. Adjust your smtp.cdb settings first. Chances are you are not using validrcptto options, in that case comment out that part by putting # sign in front. And remove hash sign for your appropriate qmailscnner setup.  Its always a good idea to read the options in detalis and have a good understanding of each one.

http://qmail.jms1.net/scripts/service-qmail-smtpd-run.shtml

###############################################################################
#
# options for tcpserver/sslserver

IP=unset
PORT=25
SSL=0
SSL_CERT=”$VQ/control/servercert.pem”
SMTP_CDB=”/etc/tcp/smtp.cdb”
MAX=30

# these require the “tcpserver limits” patch for ucspi-tcp, available here:
# http://linux.voyager.hr/ucspi-tcp/

#MAXLOAD=750
#MAXCONNIP=2
#MAXCONNC=5
#DIEMSG=”421 $LOCAL Service temporarily unavailable”

# my newer version of the tcpserver limits patch allows you to specify
# individual DIEMSG values for each policy.
# http://qmail.jms1.net/ucspi-tcp/

#DIEMSG_MAXLOAD=”421 $LOCAL Server busy, try again later.”
#DIEMSG_MAXCONNIP=”421 $LOCAL Too many connections from your IP.”
#DIEMSG_MAXCONNC=”421 $LOCAL Too many connections from your network.”

###############################################################################
#
# options for programs which run before qmail-smtpd

#RBLSMTPD_PROG=”rblsmtpd”
#RBL_GOOD=”"
#RBL_BAD=”zen.spamhaus.org dnsbl.njabl.org dnsbl.sorbs.net bl.spamcop.net”

#GREYLIST=”jgreylist”

#JGREYLIST_DIR=”$VQ/jgreylist”
#JGREYLIST_NOREV=1
#JGREYLIST_BY_IP=0
#JGREYLIST_HOLDTIME=120
#JGREYLIST_LOG=1
#JGREYLIST_LOG_PID=1
#JGREYLIST_LOG_SMTP=0
#JGREYLIST_TIMEOUT=60
#JGREYLIST_LIMIT=0

#RECORDIO=”recordio”

###############################################################################
#
# options for qmail-smtpd itself

SMTPD=”qmail-smtpd”
#SMTPGREETING=”$LOCAL NO UCE”
#GREETDELAY=30
#DROP_PRE_GREET=1
FORCE_TLS=0
DENY_TLS=0
MFCHECK=3
#MAXRCPT=100
#RELAYREJ=1
QMAILSMTPD_LOG_MAIL=1
QMAILSMTPD_LOG_RCPT=1
#QMAILSMTPD_HELP_VERSION=1

###############################################################################
#
# options pertaining to the AUTH command.

AUTH=0
REQUIRE_AUTH=0
ALLOW_INSECURE_AUTH=0

# if using the AUTH_CDB method
#AUTH_CDB=”$VQ/control/auth.cdb”

# if using the CHECKPW method
CHECKPW=~vpopmail/bin/vchkpw
TRUE=`which true`

# to change the environment whenever somebody authenticates
#AUTH_SET_MFCHECK=0
#AUTH_SET_MAXRCPT=0
#AUTH_SET_DATABYTES=0
#AUTH_SET_SPFBEHAVIOR=1
#AUTH_SET_VALIDRCPTTO_LIMIT=10
#AUTH_SET_VALIDRCPTTO_LOG=1
#AUTH_SET_SPF_LOG=1
#AUTH_SET_RELAYREJ=0
#AUTH_SET_VALIDRCPTTO_CDB=”"
#AUTH_SET_QMAILSMTPD_LOG_MAIL=1
#AUTH_SET_QMAILSMTPD_LOG_RCPT=1
#AUTH_SET_QMAILSMTPD_HELP_VERSION=1

###############################################################################
#
# options pertaining to the “validrcptto.cdb” mechanism.
# see http://qmail.jms1.net/patches/validrcptto.cdb.shtml for details.

VALIDRCPTTO_CDB=”$VQ/control/validrcptto.cdb”
VALIDRCPTTO_LIMIT=10
VALIDRCPTTO_LOG=2

###############################################################################
#
# options pertaining to the SPF mechanism.

SPFBEHAVIOR=3
SPF_LOG=1
SPF_BLOCK_PLUS_ALL=1

###############################################################################
#
# options pertaining to the Domainkeys mechanism.
# this requires an add-on patch.

#DOMAINKEYS=0
#DKVERIFY=DEfGhIJK
#AUTH_SET_DKSIGN=/etc/domainkeys/%/default

###############################################################################
#
# options for programs which run after qmail-smtpd

# if you are using simscan…

#QMAILQUEUE=”$VQ/bin/simscan”
NOP0FCHECK=1
#SIMSCAN_DEBUG=0
#SIMSCAN_DEBUG_FILES=0

# if you are using qmail-scanner, un-comment ONE of these lines.

#QMAILQUEUE=”$VQ/bin/qmail-scanner-queue”
#QMAILQUEUE=”$VQ/bin/qmail-scanner-queue.pl”

Upgrading from Debian 4 to Debian 5 (lenny) using apt-get

April 16, 2009 linuxfix Leave a comment

Add the following sources to your current /etc/apt/sources.list file

##############################################################################
# STABLE:
#
#deb http://ftp.debian.org/debian/ stable main contrib non-free
#deb-src http://ftp.debian.org/debian/ stable main contrib non-free
#deb http://security.debian.org/ stable/updates main contrib non-free
#deb-src http://security.debian.org/ stable/updates main contrib non-free

##############################################################################
# TESTING:
#
# ALWAYS USE “testing”. This is the best option (–> system is always uptodate)
# For ntfs-3g and gcc-multilib etc. “testing” is needed
#
deb http://ftp.debian.org/debian/ testing main contrib non-free
deb-src http://ftp.debian.org/debian/ testing main contrib non-free
deb http://security.debian.org/ testing/updates main contrib non-free
deb-src http://security.debian.org/ testing/updates main contrib non-free

##############################################################################
# UNSTABLE:
#
# sun-java5 packages are in the unstable distribution:
#deb http://ftp.debian.org/debian/ unstable non-free
#deb-src http://ftp.debian.org/debian/ unstable non-free

Use the following commands to upgrade.

#apt-get update
#apt-get dist-upgrade

If your distribution is not using a 2.6 kernel your upgrade may fail.
In that case you will need to upgrade your kernel first to a 2.6 version one and then proceed with the upgrade.

Updating qmailrocks/Qmail installation using John Simpson’s combined Patch

April 7, 2009 linuxfix Leave a comment

This article is largely based on these following sites. I haven’t invented anything  new here, just arranged in a way I found myself helpful.

http://www.qmailrocks.org/http://goodcleanemail.com/

http://qmail.jms1.net/

http://toribio.apollinare.org/qmail-scanner/

Upgrading from a qmailrocks installation

Before you continue on, there are 2 things you need to know about. First you should check out John Simpson’s “Upgrading from qmailrocks” page which is at   http://qmail.jms1.net/upgrade-qmr.shtml

Second, when you do the upgrade from qmailrocks to Johns combined patch, smtp-auth will not work with plain text passwords. Its better having a migration plan setup ahead of time so this doesn’t upset anyone. If you really need a smtp server setup with plain-text passwords, setup another box to do smtp only. There are many other patches included in Johns Combined patch that will enhance your server’s performance and security.

For details go to:

http://qmail.jms1.net/patches/combined-details.shtml

Download the new qmail-smtpd/run file so we can get it prepared and ready to go. PLEASE NOTE: We are *NOT* going to replace the run file until AFTER we patch the system first. Changing the file won’t take very long after we run the patch.

# cd /service/qmail-smtpd/

# cp run bak_run

# wget http://qmail.jms1.net/scripts/service-qmail-smtpd-run

# vi service-qmail-smtpd-run

Now the list of available options for service-qmail-smtpd-run is listed below

http://qmail.jms1.net/tls-auth.shtml

If you want to accept messages on port 25 and also allow users to send mail via TLS, use the following options:

IP=X.X.X.X (Substitute your own IP address. Do not leave this set to 0 without a good reason.)

PORT=25 (Set the port number we will be listening on.) SSL=0 (Do not run an SSL-only service.)

FORCE_TLS=0 (Refuse to accept mail from clients who have not done STARTTLS.)

DENY_TLS=0 (Do not refuse to process the STARTTLS command.)

AUTH=1 (Allow the AUTH command after STARTTLS has been completed.)

REQUIRE_AUTH=0 (Refuse to accept mail from clients who have not done AUTH.)

Now that we have the qmail-smtp/run file prepared, we need to download the current version of the patch from:

http://qmail.jms1.net/patches/combined-details.shtml

For example:

# cd ~root

# wget http://qmail.jms1.net/patches/qmail-1.03-jms1.7.07.patch

Now download the qmail source and extract it

# cd ~root

# wget http://cr.yp.to/software/qmail-1.03.tar.gz

# tar xvzf qmail-1.03.tar.gz # cd qmail-1.03

# patch < ../ qmail-1.03-jms1.7.07.patch

Once the patch is complete we are ready to compile qmail with all the new enhancements. Please make sure there are no messages in the qmail queue when you stop qmail below. The output of qmailctl stat will tell you if there are any local/remote messages in the queue. THIS IS VERY IMPORTANT!! When you stop qmail and run make or make setup check, it may tell you if something is running. If it is, it is safe to kill it.

# make

# qmailctl stop

# ps ax | grep qmail-send (if it’s still running, wait a few seconds and try it again)

# ps ax | egrep qmail-send …

# make setup check

Before we start qmail again, we now need to copy over the new qmail-smtpd/run file:

# cd /service/qmail-smtpd/

# cp service-qmail-smtpd-run run

# chmod 755 run

We will also replace the qmail-smtpd/log/run file with a new one as well

# cd /service/qmail-smtpd/log

# wget http://qmail.jms1.net/scripts/service-any-log-run

# cp run bak_run

# cp service-any-log-run run

# chmod 0600 bak_run

# chmod 755 run

Before we start qmail, we need to make sure TLS works with vpopmail so lets run the following:

#chmod 6711 ~vpopmail/bin/vchkpw

Setting up the tcpserver access files (optional)

# mkdir -m 755 /etc/tcp # cd /etc/tcp

# wget http://goodcleanemail.com/files/fbsd/etc-tcp-makefile

# mv etc-tcp-makefile Makefile

Creating the smtp file At this point it should be ready to go; all you need to do is create the “smtp” file, containing the normal access control list. It may look something like this:

127.:allow,RELAYCLIENT=”" :allow

Run

# make

Ok, everything is set to start so let’s start qmail.

# qmailctl start

# svc -u /service/*

# qmailctl stat

Important note:  Don’t forget to check http://qmail.jms1.net/upgrade-qmr.shtml

Here are two important problems I faced

1. Permissions on SSL .pem files

You may get error like this: “454 TLS not available”

The ownership and permissions of the cert.pem files should look like as shown below.

# cd /var/qmail/control
# ls -laF *.pem
-rw-r—– 1 root qmail 2142 Jun 24 2004 clientcert.pem
-rw-r—– 1 root nofiles 2142 Jun 24 2004 servercert.pem

2. Problem with the “locals” file

Error: 553 Sorry, that domain isn’t in my list of allowed rcpthosts

This one isn’t so much a difference as it is an outright incorrect step in the qmailrocks documents. On this page in the qmailrocks setup instructions you will find an instruction which tells you to run the command

# ./config-fast your_fqdn_hostname (ex: ./config-fast mail.mydomain.com)

The config-fast script that you’re running is not designed to be used on a pure-virtual system (like what qmailrocks builds.) The name you enter as your_fqdn_hostname above will end up being placed in the /var/qmail/control/locals file. However, if that name will later be used as the name of a domain in vpopmail, it should not be listed in the locals file.

The problem develops later on. If a given domain name is listed in both locals and virtualdomains (where it must be listed in order for vpopmail to use it) then the listing in locals takes precedence, and mail sent to that domain will try to be delivered to system userid’s which have the same names as the mailboxes.

The solution is to remove the domain name from the locals file. In fact, if all of your mailboxes are managed through vpopmail, the locals file should be empty.

Note, however, that even if the locals file is empty, it must still exist. Otherwise, the contents of the /var/qmail/control/me file will be treated as if the locals file contained it.

Just make sure here that the /service/qmail-smtpd and /service/qmail-smtpd/log ones are up for more than one second. If not, take a look at the log file

# tai64nlocal < /service/qmail-smtpd/log/main/current

Other than that, you are good to go! You now need to tell your users to send smtp via TLS. If you want to setup smtp via SSL, You need to setup a separate service. Take a look at

http://goodcleanemail.com/index.php?option=com_content&task=view&id=73&Itemid=25

Or setup SMTP with TLS on a separate service:

http://goodcleanemail.com/index.php?option=com_content&task=view&id=47&Itemid=25

If you want to enable validrcptto, take a look at the following URLs

http://qmail.jms1.net/patches/validrcptto.cdb.shtml

http://qmail.jms1.net/scripts/mkvalidrcptto.shtml

If you would like to enable jgreylist, follow this website:

http://qmail.jms1.net/scripts/jgreylist.shtml

Vpopmail installation with pop-b4-smtp and no clear password

Download the latest vpopmail source file from

http://www.inter7.com/index.php?page=vpopmail

Run the following commands to untar it first then configure and install it.

# tar jxf vpopmail-5.4.27.tar.bz2

# ./configure –enable-logging=p –enable-roaming-users –disable-clear-passwd

# make && make install-strip

If you get error like vchkpw-smtp: vpopmail user not found; check attributes/permission: Try:

# chmod ug+s /home/vpopmail/bin/vchkpw

Qmailadmin installation

Download the latest version of qmailadmin source from

http://www.inter7.com/index.php?page=qmailadmin

Run the following commands to untar it first then configure and install it.

# tar -zxf qmailadmin-1.2.12.tar.gz

#./configure –enable-cgibindir=/var/www/cgi-bin –enable-htmldir=/var/www/

# make && make install-strip

Qmailscanner 2.05 installation

Download a complete patched distribution (q-s-2.05st-20080728.tgz) from

http://toribio.apollinare.org/qmail-scanner/download/q-s-2.05st-20080728.tgz

For complete configuration options and examples check

http://toribio.apollinare.org/qmail-scanner/

Configure

# ./configure --domain DOMAIN-NAME \
               --admin antivirus \
               --admin-description "Antivirus DOMAIN-NAME" \
               --add-dscr-hdrs yes \
               --dscr-hdrs-text "X-Antivirus-DOMAIN-NAME" \
               --ignore-eol-check yes \
               --redundant yes \
               --max-zip-size 80000000 \
               --max-unpacked-files 2000 \
               --virus-to-delete yes \
               --settings-per-domain yes \
               --sa-maxsize 512000 \
               --sa-quarantine 2.1 \
               --sa-delete 4.2 \
               --sa-reject yes \
               --sa-subject "SPAM *** " \
               --sa-delta 0.5 \
               --sa-alt yes \
               --sa-debug yes \
               --sa-report yes \

Install

Make an install.sh script with the following and run it. It will replace your old qmailscanner.pl file in /var/qmail/bin directory. So you may like to take a backup of your old qmailscanner.pl file before running this.

mkdir -p /var/spool/qscan

mkdir -p /var/spool/qscan/quarantine/viruses/tmp /var/spool/qscan/quarantine/viruses/cur /var/spool/qscan/quarantine/viruses/new

mkdir -p /var/spool/qscan/quarantine/spam/tmp /var/spool/qscan/quarantine/spam/cur /var/spool/qscan/quarantine/spam/new

mkdir -p /var/spool/qscan/quarantine/policy/tmp /var/spool/qscan/quarantine/policy/cur /var/spool/qscan/quarantine/policy/new

mkdir -p /var/spool/qscan/working/tmp /var/spool/qscan/working/cur /var/spool/qscan/working/new

mkdir -p /var/spool/qscan/archive/tmp /var/spool/qscan/archive/cur /var/spool/qscan/archive/new

cp quarantine-events.txt /var/spool/qscan/

chown -R qscand:qscand /var/spool/qscan/

cp qmail-scanner-queue.pl /var/qmail/bin/qmail-scanner-queue.pl

chown qscand:qscand /var/qmail/bin/qmail-scanner-queue.pl

chmod 4755 /var/qmail/bin/qmail-scanner-queue.pl

/var/qmail/bin/qmail-scanner-queue.pl -z

/var/qmail/bin/qmail-scanner-queue.pl -g