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/qmailctlThe 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/binSet Maildir as default mailbox type (./Mailbox for mbox type)
echo ./Maildir > /var/qmail/control/defaultdeliverySet some configuration (You can find more on http://www.lifewithqmail.com/lwq.html#configuration)
echo 255 > /var/qmail/control/concurrencyremoteecho 30 > /var/qmail/control/concurrencyincoming
echo 3 > /var/qmail/control/spfbehavior
echo postmaster > /var/qmail/control/bouncefrom
echo yourdomain.tld > /var/qmail/control/doublebouncehost
echo postmaster > /var/qmail/control/doublebounceto
echo 'MEDIUM:HIGH:!SSLv2:!MD5:!RC4:!3DES' > /var/qmail/control/tlsserverciphers
cd /var/qmail/control/
chmod 644 bouncefrom doublebouncehost doublebounceto concurrencyremote concurrencyincoming spfbehavior tlsserverciphers
Set maximum message size to be 8Mb
echo '8000000' > /var/qmail/control/databytesSet 30 seconds as timeout
echo 30 > /var/qmail/control/timeoutsmtpdAllows localhost to send mails
echo '127.:allow,RELAYCLIENT=""' >> /etc/tcp.smtpqmailctl 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.smtpqmailctl 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-rootecho 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
./config-fast host.domain.tld
You should have an answer like this :
Putting host.domain.tld into control/me...
Putting domain.tld into control/defaultdomain...
Putting domain.tld into control/plusdomain...
Putting host.domain.tld into control/locals...
Putting host.domain.tld into control/rcpthosts...
Now qmail will refuse to accept SMTP messages except to host.domain.tld.
Make sure to change rcpthosts if you add hosts to locals or virtualdomains!
Edit /var/qmail/control/locals and remove host.domain.tld
Users comments
If you have followed this entire guide, it's already the case.
Check expecially http://qmailrocks.thibs.com/outlook2007.php the part "Send e-mails through an authentificate connection on your server with SMTP-SSL"
I you want to adapt /etc/tcp.smtp, I think it's only
.:allow,RELAYCLIENT=""
(then modify /service/qmail-smtpd/run for the authentication)
Can Anyone give sample of tcp.smtp that can allow all IPs to send email through mail server with username password authentification
Thanks
Install QMAIL on Debian 11, work fine!
Thank you for the instructions, it helped a lot!
There was only one problem that I could not solve. When DENY_TLS=0 in /var/qmail/supervise/qmail-smtpd/run, smptd crashes
qmail-smtpd[2688]: segfault at beefa400 ip 00007f8341b4dff4 sp 00007ffc525acd40 error 4 in libssl.so.1.0.0[7f8341b11000+5e000]
For testing, I set DENY_TLS=1. Everything is fine in this mode. This is not critical for work, but maybe there is some workaround?