Koozali.org: home of the SME Server
Obsolete Releases => SME Server 9.x => Topic started by: brianr on September 15, 2017, 03:02:48 PM
-
A client of mine is using the email server in a "catchall" mode for reasons of his own.
However he / we want to specifically exclude email sent to a specific email address in his domain.
What is the best way to do it?
-
Looks like I need to use:badrcptto (qpsmtpd plugin)
So I need to edit
/var/service/qpsmtpd/config/badrcptto
Which is templated.
However the contents and anything else I can find does not help me with the format.
It contains:
<usual templage header>
! Sorry, bang paths not accepted here
@.*@ Sorry, multiple at signs not accepted here
^@ Invalid recipient address
% Sorry, percent hack not accepted here
# Format is pattern\s+Response - don't forget to tie the pattern if required
-
It looks to me like the existing templates for 'badrcptto' don't include any way for you to add content other than through with a custom fragment.
I'm guessing, but I think the code below will deny mail from both 'user@server.com', and 'anotheruser@anotherserver.com', and will deny email from 'anotheruser@anotherserver.com' with an SMTP error code of "Buzz Off!"
mkdir -p /etc/e-smith/templates-custom/var/service/qpsmtpd/config/badrcptto
cd /etc/e-smith/templates-custom/var/service/qpsmtpd/config/badrcptto
echo 'user@server.com
anotheruser@anotherserver.com Buzz Off!'> 20DenyMailFrom
signal-event email-update
-
It looks to me like the existing templates for 'badrcptto' don't include any way for you to add content other than through with a custom fragment.
I'm guessing, but I think the code below will deny mail from both 'user@server.com', and 'anotheruser@anotherserver.com', and will deny email from 'anotheruser@anotherserver.com' with an SMTP error code of "Buzz Off!"
mkdir -p /etc/e-smith/templates-custom/var/service/qpsmtpd/config/badrcptto
cd /etc/e-smith/templates-custom/var/service/qpsmtpd/config/badrcptto
echo 'user@server.com
anotheruser@anotherserver.com Buzz Off!'> 20DenyMailFrom
signal-event email-update
ok, I was not sure what the "response" bit was - but I see now - thanks.
However I am looking for something to reject email sent TO a particular email address - I think that is probably what you mean - but I'd like it confirmed before I start hacking the server.
-
Yes, you're right; sorry.
badrpctto blocks email going *to* the emails in /var/service/qpsmtpd/config/badrpctto
SYNOPSIS
deny connections to recipients in the badrcptto file
like badmailfrom, but for recipient address rather than sender
Depending on what you've done to convince the SME server to accept email to any recipient, you might simply need to create a user account for the email address you *don't* want in the catch-all, then set up that account to delete or forward whatever it receives.
-
Depending on what you've done to convince the SME server to accept email to any recipient, you might simply need to create a user account for the email address you *don't* want in the catch-all, then set up that account to delete or forward whatever it receives.
That actually makes the most sense - many thanks!
-
brianr
There is a db command to control user or group external visibility. I am not sure if you are trying to block a user who is in the catch all setup, so the command may or may not be what you want. I think you need to provide more details & tell us how the catch all is set up.
From the FAQ - Email (link at top of Forums)
db accounts setprop groupname/username Visible internal signal-event email-update
(replace groupname/username)