LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices

Reply
 
Search this Thread
Old 07-30-2002, 11:17 PM   #1
Gavin
Member
 
Registered: Aug 2001
Location: Australia
Distribution: Fedora
Posts: 32

Rep: Reputation: 15
Disabling mail accounts


I am running sendmail on Suse 7.0. Every user set up on the server automatically has a mail account @mydomain. Is it possible to disable these mail accounts to reject the message as an "unknown user".

Any help would be appreciated.

Thanks
Gavin
 
Old 07-31-2002, 12:48 AM   #2
sarin
Member
 
Registered: May 2001
Location: India, Kerala, Thrissur
Distribution: FC 7-10
Posts: 354
Blog Entries: 2

Rep: Reputation: 34
There is a sendmail option to black list user. For this your sendmail.cf file should be compiled with feature(`blacklist_recipients'). Read the readme file that comes with sendmail-cf directory ( in RH7.2 it is in /usr/share/sendmail-cf don't know about suse7.0 and particular version of sendmail )
--Sarin
 
Old 07-31-2002, 09:41 AM   #3
SkahlaN355A
LQ Newbie
 
Registered: Jul 2002
Distribution: homebrew
Posts: 5

Rep: Reputation: 0
this is what i got in my sendmail.conf file:


R$* < @$*$=K . > $* $#error $@ 5.1.3 $: "Your domain is banned from our mail system due to acceptable usage policy violations."
R$* < @$*$=K > $* $#error $@ 5.1.3 $: "Your domain is banned from our mail system due to acceptable usage policy violations."

# check for junk domain/spammers
Sjunk
# lookup domain in database
R$*<@$+> $:$1<@$(junk $2$)>
# exists? return
R$*<@$*@JUNK> $@$1<@$2@JUNK>
# lookup address in database
R$*<@$+> $:$1<@$(junk $1@$2 $:$2$)>
# exists? return
R$*<@$*@JUNK> $@$1<@$2@JUNK>
# remove one subdomain, try again
R$*<@$-.$-.$+> $: $>junk $1<@$3.$4>

Scheck_mail
# don't check these
R<$*@$=w> $@ ok shortcut
# idea from Steven Schultz
R<> $: <$n @ $(dequote "" $&{client_name} $) >

# remove at least the dot...
R<$*@$*.> <$1@$2>
R$* $: $>3 $1 canonify
R$- $@ ok
# no host without a . in the FQHN ?
R$*<@$->$* $#error $@ 5.1.8 $: 551 invalid host name $2, ask our administrator to check your mail system configuration.
# lookup IP address (reverse mapping available?)
R$*<@[$-.$-.$-.$-]>$* $: $1 < @ $[ [ $2.$3.$4.$5 ] $] > $6
# copy the result of the lookup
R$* $:$1 $| $1
# now remove the dot
R$* $| $*<@$*.>$* $: $1 $| $2<@$3>$4
# and check the database
R$* $| $*<@$*>$* $: $1 $| $>junk $2<@$3>
# match: return given error code (rhs of map)
R$* $| $*<@$*@JUNK>$* $#error $@ 5.7.1 $: $3
# restore original value (after canonicalization by ruleset 3)
R$* $| $* $: $1
# this is dangerous! no real name
# (see RFC 1123,sections 5.2.2 and 5.2.18)
R$*<@$*$~P>$* $#error $@ 5.1.8 $: 551 unresolvable host name $2$3, ask your administrator to check your site's name server setup.

Scheck_rcpt
# first: get client address
R$+ $: $(dequote "" $&{client_addr} $) $| $1
R0 $| $* $@ ok client_addr is 0 for sendmail -bs
R$={LocalIP}$* $| $* $@ ok from here
# next: get client name
R$* $| $+ $: $(dequote "" $&{client_name} $) $| $2
R $| $* $@ ok no client name: directly invoked
#R$- $| $* $@ ok for those without full DNS...
R$*$=w $| $* $@ ok from here
R$*$={LocalNames} $| $* $@ ok from allowed system
# now check other side
R$* $| $* $: $>3 $2
# remove local part
R$*<@$+.>$* $: $>remove_local $1<@$2.>$3
# still something left?
R$*<@$+>$* $#error $@ 5.7.1 $: 551 we do not relay. Use another site to relay mail.

Sremove_local
# remove RelayTo part (maybe repeatedly)
R$*<@$*$={RelayTo}.>$* $>3 $1 $4
R$*<@$=w.>$* $: $>remove_local $>3 $1 $3
 
Old 08-01-2002, 11:55 AM   #4
Ionized
Member
 
Registered: Jul 2002
Location: Chicago Suburbs
Distribution: Slackware 8.0
Posts: 51

Rep: Reputation: 15
Quote:
Originally posted by SkahlaN355A
this is what i got in my sendmail.conf file:
......
Wow, that's amazing. heh. I thought mail checking like that was usualy done with procmail or something. Anyway, the thing you should use to block certain email addresses is:
FEATURE(`access_db', `hash -T<TMPF> /etc/mail/access')dnl
FEATURE(`blacklist_recipients')dnl

with this, you can create an /etc/mail/access file and put in it the usernames you want to block:
username@domain.com Error: Name does not exist (or whatever)

After you create the file, you need to use makemap to create the actual database file:
makemap hash /etc/mail/access.db < /etc/mail/access

hope that helps
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
qmail -- new accounts can't receive mail, but old accounts can b:z *BSD 1 07-13-2005 01:42 AM
Virtual mail accounts objorkum Linux - Networking 1 09-18-2004 06:38 AM
Same E-mail on different accounts joeman3429 Fedora 1 07-26-2004 06:51 AM
disabling user accounts via command line n1wil Linux - Security 3 07-25-2003 06:11 PM
MAIL Accounts WeaSiL Linux - Newbie 2 12-13-2000 11:36 PM


All times are GMT -5. The time now is 01:14 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration