Help - Search - Members - Calendar
Full Version: Redirect to /dev/null
The Planet Forums > Control Panels > Plesk
Squire
Hoping someone has an easy solution for this one...

I have a couple of client email addy's which apparently signed up for every list on the planet. Then they killed those email addresses.

So now the server is trying to bounce that email back, which is of course going to a nonexistant address. And just sits there trying to be delivered. And it's a pain to have to remember to go in and clean the queue of these double bounces.

My idea was to set up a special email address to which all of the original email to these couple of addresses are redirected to, and have this special email address dump the mail into /dev/null. Not even sure how to do that with Qmail, but I used to do this with sendmail so I assume it's at least possible.

Any wisdom out there? Any suggestions on better/easier ways to handle email sent to these no-longer-valid local addresses?

Thankee!

Squire
NightHawk
QUOTE
Originally posted by Squire
Hoping someone has an easy solution for this one...

I have a couple of client email addy's which apparently signed up for every list on the planet.  Then they killed those email addresses.

So now the server is trying to bounce that email back, which is of course going to a nonexistant address.  And just sits there trying to be delivered.  And it's a pain to have to remember to go in and clean the queue of these double bounces.

My idea was to set up a special email address to which all of the original email to these couple of addresses are redirected to, and have this special email address dump the mail into /dev/null.  Not even sure how to do that with Qmail, but I used to do this with sendmail so I assume it's at least possible.

Any wisdom out there?  Any suggestions on better/easier ways to handle email sent to these no-longer-valid local addresses?

Thankee!

Squire


sure...just do this:
##substitue domain.com with your customers domain.tld
##substitue badmailname with the mailname of the bounce addy

cd /var/qmail/mailnames/domain.com/
vi .qmail-badmailname
#insert this:
| /dev/null
#end of insert
icon_mad.gif (to exit and save from vi)

then just forward all the "crap" email to badmailname@domain.com ..and it will automagically disappear.

hope that helps cool.gif
Squire
Thanks for the reply NightHawk! I should have known it would be you replying since you know these Plesk servers inside out.

I think I should have been a bit more exacting in my question because I don't have a .qmail-badmailname file. I'm running Plesk 5.05 RPM version FYI.

I do have something similar located at /var/qmail/mailname/domain.tld/badmailname/.qmail It has the following in it:

| true
./Maildir/

I tried inserting your suggestion of | /dev/null in this file, but got an error message in the maillog when trying to send a test mail to my "spam" address. The maillog error was:

delivery 269: deferral: /bin/sh: /dev/null: Permission denied/

So I assume I'm trying to alter the wrong file. Any other bones you can throw my way?

Squire
NightHawk
QUOTE
Originally posted by Squire
Thanks for the reply NightHawk!  I should have known it would be you replying since you know these Plesk servers inside out.

I think I should have been a bit more exacting in my question because I don't have a .qmail-badmailname file.  I'm running Plesk 5.05 RPM version FYI.

I do have something similar located at  /var/qmail/mailname/domain.tld/badmailname/.qmail  It has the following in it:

| true
./Maildir/

I tried inserting your suggestion of | /dev/null in this file, but got an error message in the maillog when trying to send a test mail to my "spam" address.  The maillog error was:

delivery 269: deferral: /bin/sh: /dev/null: Permission denied/

So I assume I'm trying to alter the wrong file.  Any other bones you can throw my way?

Squire


Actually, the problem is you can't have the user in the plesk cp when you do this. So do this:

1) delete badmailname from the plesk cp under mail in the domain domain.tld.

2) vi /var/qmail/mailname/domain.tld/.qmail-badmailname , and insert | /dev/null in that file.

That should do the trick, as there should be no problem writing to /dev/null as it has the following permissions by defualt:
crw-rw-rw- 1 root root 1, 3 Jan 30 05:24 /dev/null
Ales
A simpler solution is to create a new email address trough Plesk, for example null@yourdoman.com, than leave all the checkboxes empty (don't select mailbox, redirect, etc.).

This will create an address that won't stream your e-mail nowhere, it will dissapear into the void... If you look at the .qmail file, you'll see a simple
CODE
| true
in there. That's all it takes.

Than just redirect the addresses that you want to null to null@yourdomain.com. You could also set this address to be the default catch-all for the domains server-wide.
Squire
What a wonderfully simple solution! Now why didn't I think of trying that. icon_biggrin.gif

Thanks Ales and Nighthawk! Much appreciated.

Squire
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2009 Invision Power Services, Inc.