Default POP3 mailbox

sitestreet

Verified User
Joined
Jan 19, 2005
Messages
40
I've read a number of posts about the default mailbox created with all accounts using the account name as the alias. Ideally I'd like no mailboxes created and purely let the customer add any if they're needed - we have a number of people who don't use them at all, just forwarding.

BUT, one customer's account name is the same as the domain name (well, most are) and this has been guessed by a spam harvester and they're getting bombarded by mail into this mailbox. They don't want POP3 at all, in fact they don't want to receive mail at all to this domain, but we can't prevent mail going into this default mailbox.

The biggest problem is their diskspace is now used up which means they can't FTP and site mods. I increase their space to allow it and more mail appears using up the surplas again. And their bandwidth usage is HUGE as a result.

This is now becoming a pretty serious problem which needs resolving rather quickly.

If someone could tell me how I can completely disable the default POP3 account and just bounce mail back as 'user unknown' like the catchall is set to do I'd be very grateful.

DA - Could we have the facility to not give a default mailbox to new accounts in a future release? On cheaper hosting plans we offer one mailbox but as they often don't want the username as the alias we've had to allow two mailboxes and tell them to ignore the first one. Not ideal.

Many thanks.
 
Hello,

All you need to do is remove the username alias from the /etc/virtual/domain.com/aliases file.

If you want to do that for all new domains, then create a /usr/local/directadmin/scripts/custom/domain_create_post.sh script exactly as follows (no replacements):
Code:
#!/bin/sh
echo "*: :fail:" > /etc/virtual/${domain}/aliases
exit 0;
The script basically just overwrites the file making it only contain a catchall (which bounces all emails), and which will remove the system alias. Once saved, make sure the script is chmod 755.

John
 
All you need to do is remove the username alias from the /etc/virtual/domain.com/aliases file.

I'm not sure that's fixed it.
I also would like to block email to [email protected]
After removing the username alias, the DA control panel still shows this entry:
[email protected] -> username
This would still leave "sitestreet" problem intact - the username mailbox would still fill up with spam because the spammers are sending mail to [email protected]
Am I right or have I missed something?
 
I've now implemented the solution DA suggested but haven't yet checked to see the effect it has had. I still have the mailbox there, and showing in DA, so I'd say it's only a half-fix. Can I remove the mailbox completely and DA show no mailboxes? Otherwise the customer will get confused as to why a mailbox is there but not receiving any mail.

The absolute ideal solution would be to do away with the default mailbox altogether and just let us create one if it's needed and give it whatever alias we choose at the time.
 
I've just been speaking to the customer and had a sudden thought...

As they don't use email whatsoever on this account, what if I just set the MX record for the domain to a non-existant server or to nothing at all? I'm concerned that about 1gb of bandwidth is being consumed every couple of days just by spam mail coming in and the server bouncing it back. If it didn't reach the server in the first place then we wouldn't have the problem.

Can anyone confirm this as a reasonable solution? And what I should put in the MX record to accomplish it without any adverse effect on anything else?

Many thanks

Jon
 
I should not have doubted DA Support!
It does work! Although the rule
[email protected] -> username
is still visable in the control panel, email is now being "failed".
It's true this is slightly misleading for the novice end user and it would be nice to remove this entry alltogether from the control panel so it's obvious that no mail is getting through.
 
It appears to be working for me too. No more mail is going into the mailbox.

How can I delete the contents of the mailbox without either knowing the password to it or logging in and manually deleting each email or screen full? There is likely to be many thousands of emails.....

I would normally delete the mailbox and recreate it but as it's the default one, I can't!

Is there an easy way using SSH?
 
Last edited:
How can I delete the contents of the mailbox without either knowing the password to it or logging in and manually deleting each email or screen full? There is likely to be many thousands of emails.....

Login SSH as root
Delete the file
/var/spool/mail/{username}

That should do it.
 
Thanks cprompt. Does this delete the mailbox or just the contents? Would there be any repercussions?
 
It wont remove the mailbox as it's just the spool file for that account. If it ever receives mail again, the file would be recreated by the system.
 
Excellent. I've deleted the file and DA now reports the mailbox as empty and the diskspace used by the account should drop considerably tomorrow morning when the data is updated.

Thanks for your help.

Jon
 
All email to the default address is bouncing back correctly but it's still going into the mailbox, or at least a copy of the error reply is. The spool file is increasing at about 1mb a minute...

How can this be stopped?

Help! :o
 
Actually, it appears the emails are getting through addressed to [email protected]

How can I stop this too? I can't find any files in the /etc/virtual/servername.com folder so there isn't an aliases file.

This is starting to get out of hand.

How can I stop mail going to the server in the first place? My earlier post suggests changing the MX record as no email facilities are required for this account.

Please help!
 
How can I stop this too? I can't find any files in the /etc/virtual/servername.com

You can put an aliases file in that directory although officially DA don't recommend it. It will work though.
Add the the line:

username: :fail:

and see if that works.
 
Thanks again cprompt. I've actually removed the MX record from the zone file so hopefully email just won't get to the server in the first place.

This (if what I've done works and is allowed) has highlighted a serious problem though with this default mailbox. If the user want just one email address then I couldn't remove the MX record like I have.

Please can DA think about removing the default mailbox?

;)
 
Actually, I've just done a dnsreport.com on the domain and it says that most servers will try to send to the A record if an MX record doesn't exist so I don't think removing the MX is actually going to make any difference. Is there a server I can point it to which is a 'dummy' server? I don't want to pass mail onto another server!
 
The thing about the default mailbox is that it is more than just that. It's an actual user account on your server rather than a virtual mail account under Direct Admin. It's unlikely DA could remove that default account for this reason, as then your user would have no way to login to DA.
[email protected] will always be a valid email destination for this reason, you just have to manage it via the aliases files.
 
Thanks for all your help.

I've done as you suggested and put

username: :fail:

into an aliases file in the servername folder. What will happen to all the other usernames? Will they get through by default as they're not listed or will I find that none will now this file is there?
 
The others shouldn't be affected and don't forget this folder is for aliases to the servername only. No one should really be using your servername as a mail domain in the first place.
 
True. I just spotted than Cron messages seem to go to the username@servername address.

Anyway, I've done as you suggested so will watch and see if it sorts it.

Thanks again.
 
Back
Top