Posts Tagged ‘qmail’

Qmail connect(): No such file or directory

Your mailserver saying the following when people try to send email?

451 Mail server temporarily rejected message (#4.3.0)

Checked the qmail smtpd current log and seeing:

Qmail connect(): No such file or directory

In my case it was to do with Clam having got stuck, the following commands fixed it for me:

svc -d /service/clamd/
rm /tmp/clamd
svc -u /service/clamd

Enable Secondary SMTP Port

Okay, so this is a bit of a trick but will get the job done.

Lots of ISPs block outbound traffic on port 25 to stop spammers and the like. I recently had this problem and this is how I got around it.

If you’re running a Linux mail server with iptables then you can have it do some clever port forwarding and forward all traffic on say 9925 over to 25, thus ‘enabling’ a secondary SMTP port.

$iptables -t nat -A PREROUTING -t nat -p tcp -d SERVER_IP_HERE --dport 9925 -j DNAT --to SERVER_IP_HERE:25

Of course, don’t forget about any firewalls you need to allow 9925 through.

Removing items from Qmail's queue

Some pesky spammers filled your Qmail queue with crap? Here’s how to drop them from your outbound queue.

Stopping further spamming is up to you though ;-)

Stop Qmail

Edit the inittab to stop the supervise process starting Qmail up again once you stop it:
nano /etc/inittab
comment out ‘SV:123456:respawn:/command/svscanboot
init q

Drop bad senders from the queue

You can check the queue with:
qmailctl queue
But there’s likely to be a lot so you’ll probably want to pipe it into less.

You can remove specific addresses or whole domains:
qmail-remove -r -p @domain.com
or
qmail-remove -r -p spammer@domain.com

Restart Qmail

Undo your previous edits to inittab:
nano /etc/inittab
uncomment ‘SV:123456:respawn:/command/svscanboot
init q

To confirm it’s up and running again check the uptime of the qmail processes with:
qmailctl stat

Qmail Log Setup – Changing Max Size and Number Kept

Recently one of our mailservers was getting enough mail that the default Qmail log settings were only allowing us to retain logs for the last day or so because they were hitting the maximum size and quantity of logs.

Amending Qmail’s default log settings is quite easy, albeit a little cryptic.

logo Qmail Log Setup   Changing Max Size and Number Kept

Read more

Qmail and Wildcard Subdomains

We were working on a new email solution at work and it required wildcard subdomains to both be passed to the mailserver (via the MX) and then Qmail on the server accept them.

Read more

Return top