• If you are still using CentOS 7.9, it's time to convert to Alma 8 with the free centos2alma tool by Plesk or Plesk Migrator. Please let us know your experiences or concerns in this thread:
    CentOS2Alma discussion

How to disable bounce messages.

Q

Quachee

Guest
As far as i can tell from searching this board and other qmail sites, the 10,000's of emails in my queue at the moment are actually bounce messages. Although the information i can find by searching is ambiguous and sketchy. This is how I understand the process.

1. QMail recieves an incoming mail from spammer to [email protected]. It accepts the mail because it is a valid domain hosted by the server

2. The randomname user in the address is not valid and so QMail bounces the email back to the return path address which is usually an invalid address as well, so the bounce message ends up in the queue for a week and thus they start to build up and clog the queue.

Right now i understand that i can set a bounceall for all invalid usernames to a black hole address, however i have a LOT of servers hosting a LOT of domains and it is a big job to do this, not to mention the fact that if any of my customers turn it off again the problem will re-occur. And

Surely there is a way to stop QMail from generating bounce messages at all, or better still, to generate an error at the RCPT TO: prompt during SMTP transaction instead of accepting the bad mail. There is something called RCPTCHECK kicking around, but it seems dreadfully complicated to setup. Bouncing to black holes and/or disabling bounce messages is all well and good, but it's still wasting the server's bandwidth by accepting the mail in the first place.
 
You did not mention the Plesk version you are using, but if you have 7.5.3, then you can set each domain mail preference to 'Reject' mail to unknown users.

1. Per Domain basis: You can go into Mail Preferences and set it to 'Reject'. This may still be quicker than setting up an addon script module on multiple servers (referring to your post about RCPTCHECK). Select multiple domains, then click on 'Group Operations'

2. Actually write a mysql command to set it in the database for all domains, then you just have to put it into a cronjob to run occasionally to reset all domains, this would be to handle clients/domain admins who turn it off when they feel like it. But it might anger some clients who use catchall accounts for this, since it will defeat the use of catchall accounts.

Database: psa
Table: Parameters
Fields:
- 'id' is the domain id
- 'parameter' = 'nonexist_mail'
- 'value' = 'reject'

2. Qmail control files: are located in /var/qmail/control. Many of them are not created by default, you would have to create the ones which do not exist. More information can be found either at their website, or by using 'man qmail-control'

http://www.qmail.org
http://www.qmailrocks.org

'doublebounceto' create this file with a single line consisting of either the email address you want them to be sent to, or just a # character.

'queuelifetime' contains a numerical value corresponding to the number of seconds that messages should remain in the queue before being considered undeliverable and removed from the queue. Default is 604800 seconds.

'rejectnonexist' is a zero byte file, created by using touch. On a fresh test server, it appears that Plesk creates this file in /var/qmail/control when the 'Reject' option is selected. I can find no other reason for this file being present, nor is it in any Qmail.org docs...hmmm, needs further verification.

'bouncehost' and 'bouncefrom'
If a message is permanently undeliver-
able, qmail-send sends a single-bounce notice back to
the message's envelope sender. The notice is From:
bouncefrom@bouncehost, although its envelope sender is
empty.
You could set these to a unique email address, then use a script to search the queue for messages containing this unique address and delete them.

WARNING: qmail-send reads its control files only when it
starts. If you change the control files, you must stop and
restart qmail-send. Exception: If qmail-send receives a
HUP signal, it will reread locals and virtualdomains.

Hope this helps, or at the very least generates some possibilities.
 
Well the sql idea i never thought of, should be the quickest answer. Brilliant.

With regard to the catchall, so long as the customer sets the catchall to a valid address there won't be a problem. and i can cron periodically to reset the values to reject incase anyone turns it back to bounce.
 
On my servers, every other night they run a backup, and at the end of that backup I have qmhandle clear the queue. I figure that at 2am, any emails that are still in the queue that it can't force deliver, then they don't need to be there. This keeps my servers from having thousands of emails just sitting there.
 
bounce & reject

I have 7.1.4 plesk. tryed to make a changes but it's still not working.

It's accepting any email on listed domain. :(

how it make on plesk 7.1.4 that he check account ?
 
Back
Top