Guide updated on 29th of December 2011

Configure Qmail


It's time to configure Qmail ...

Copy the script to its proper locations

cp /downloads/scripts/qmailctl /var/qmail/bin/qmailctl (View the script qmailctl)

Adapt script permission

chmod 755 /var/qmail/bin/qmailctl

The script /var/qmail/rc (View here) is no longer used.

In original qmailrocks installation guide, it was used in script send_run replaced by service-send-run (from John M.Simpson) in this guide.

Create needed symlinks

ln -s /var/qmail/bin/qmailctl /usr/bin

Set Maildir as default mailbox type (./Mailbox for mbox type)

echo ./Maildir > /var/qmail/control/defaultdelivery

Set some configuration (You can find more on http://www.lifewithqmail.com/lwq.html#configuration)

echo 255 > /var/qmail/control/concurrencyremote
echo 30 > /var/qmail/control/concurrencyincoming
echo 30 > /var/qmail/control/timeoutsmtpd
echo 3 > /var/qmail/control/spfbehavior
echo postmaster@yourdomain.tld > /var/qmail/control/bouncefrom
echo yourdomain.tld > /var/qmail/control/doublebouncehost
echo postmaster > /var/qmail/control/doublebounceto

cd /var/qmail/control/
chmod 644 bouncefrom doublebouncehost doublebounceto concurrencyremote concurrencyincoming spfbehavior

Set maximum message size to be 8Mb

echo '8000000' > /var/qmail/control/databytes

Allows localhost to send mails

echo '127.:allow,RELAYCLIENT=""' >> /etc/tcp.smtp
qmailctl cdb

If you use backup MX servers or if this server is acting as smart host for others, I advice you to add execute command :

echo 'OTHER-SERVER-IP:allow,RELAYCLIENT="",QS_SPAMASSASSIN="1"' >> /etc/tcp.smtp
qmailctl cdb

If you want to learn other available options, take a look on this sample.

Create mail aliases

echo some_address > /var/qmail/alias/.qmail-root
echo some_address > /var/qmail/alias/.qmail-postmaster
echo some_address > /var/qmail/alias/.qmail-mailer-daemon

Where some_address is the system user or email address you want these addresses aliased to

chmod 644 /var/qmail/alias/.qmail*

Final configuration

cd /usr/src/qmail/qmail-1.03
./config-fast YOUR_SERVER_NAME

Edit /var/qmail/control/locals and remove YOUR_SERVER_NAME

Configure Daemontools


Users comments
Sco - 10/11/2011 08:07

After testing bounces, the line:

echo postmaster@yourdomain.tld > /var/qmail/control/bouncefrom

seems it should just be:

echo postmaster > /var/qmail/control/bouncefrom

Thank you for your work.

Thibs - 17/10/2011 15:53

Hello Georgi,

I'm sure it's not an error in my tutorial.

Indeed you can see :

echo yourdomain.tld > /var/qmail/control/doublebouncehost
...
cd /var/qmail/control/
chmod 644 bouncefrom doublebouncehost doublebounceto concurrencyremote concurrencyincoming spfbehavior

So you MUST have those files

 

 

 

Georgi - 12/10/2011 14:44

Hi Thibs,

 

I'm trying your install and it seems there is a little mistake

chmod 644 bouncefrom doublebouncehost doublebounceto concurrencyremote concurrencyincoming spfbehavior

does return err:

ebounceto concurrencyremote concurrencyincoming spfbehavior
chmod: cannot access `doublebounceto': No such file or directory

Fix it in the tutorial.

 

Best!

Georgi

Thibs - 11/10/2011 09:49

@Monkey : indeed you're right !

Monkey - 10/10/2011 19:33

Not sure yey, but I think YOUR_SERVER_NAME should be "host.domain.tld".


Color Coded Qmail Installation Key
  Regular Black Text     Qmail installation notes and summaries by the author.
  Bold Black Text     Commands to be run by you, the installer.
  Bold/Regular Red Text    Vital and/or critical information.
  Regular Blue text     Denotes helpful tips and hints or hyperlinks.
  Regular Orange Text     Command line output.
  Bold/Regular green text     Denotes the contents of a file or script.