Click to See Complete Forum and Search --> : Deny a specific user mail (sendmail)


finnyhut
09-30-2002, 04:47 AM
I'm trying to setup a user without a mail account (or its account disabled for that matter). I'm running sendmail. How can I achieve this?



P.S. The bigger problem is that I'm trying to setup a user that has ftp access only, I already managed to disable ssh by changing the default /bin/bash in /etc/passwd to /bin/nossh, which is a self made (almost) empty bash. Now the only problem left is that the ftp user still has a mail account....argh.

finnyhut
09-30-2002, 07:07 AM
Well I finally got somewhere, I added a .forward to the user's homedir with the following content:

|"exit 67"

This causes mail to be bounced:

----- The following addresses had permanent fatal errors -----
|"exit 67"
(reason: User unknown)
(expanded from: <joost@myserver.nl>)

----- Transcript of session follows -----
550 5.1.1 |"exit 67"... User unknown


Is there any way to clean this error message up? I really don't like people seeing the exit 67 command in the bounce mail....

jumpedintothefire
09-30-2002, 08:57 AM
If your using /etc/mail/access for control, I believe that all you need to do is:

user@domain.com REJECT
or maybe:
user@domain.com ERROR:550 Mailbox disabled for this recipient

finnyhut
09-30-2002, 09:41 AM
I'm afraid that doesn't work, because addresses listed in /etc/mail/access are source addresses (ie. from), what I want to do is disable the mail of a local user (ie to)....

jumpedintothefire
09-30-2002, 04:56 PM
Funny, it works for me.....

finnyhut
09-30-2002, 05:07 PM
You are right, but for it to function that way FEATURE(`blacklist_recipients') should be in the sendmail.mc, which I didn't know.