Discussion:
Mail sent to users that don't read mail?
(too old to reply)
Knute Johnson
2024-12-03 21:57:41 UTC
Permalink
Virtual server running Debian 12

sendmail 8.17.1.9
dovecot 2.3.19.1

I've gotten some email to some odd/system users on my server, dovecot,
smmsp, list, www-data and _apt for example. The emails are all spam.
The mail ends up creating a file in /var/mail for that user. Is there a
way to stop those users from accepting mail? Other than just listing
them in the /etc/mail/access file? All of the users have UIDs less than
mine which is 1000. Any way to restrict mail to users with a UID less
than 1000? Or any other suggestions?
--
Knute Johnson
Bjørn Mork
2024-12-04 11:33:33 UTC
Permalink
Post by Knute Johnson
I've gotten some email to some odd/system users on my server, dovecot,
smmsp, list, www-data and _apt for example. The emails are all
spam. The mail ends up creating a file in /var/mail for that user. Is
there a way to stop those users from accepting mail? Other than just
listing them in the /etc/mail/access file? All of the users have UIDs
less than mine which is 1000. Any way to restrict mail to users with
a UID less than 1000? Or any other suggestions?
I usually put system users into /etc/mail/aliases. Along with other
real/virtual accounts which aren't used for direct mailbox access.
Some of these aliases are forwarded to mail reading accounts. Others
are simply redirected to /dev/null. YMMV

You could obviously also do that with a ~/.forward file for the real
users, but my personal preference is to collect this into a single
alias db.



Bjørn
Claus Aßmann
2024-12-04 16:29:11 UTC
Permalink
Post by Knute Johnson
Is there a
way to stop those users from accepting mail? Other than just listing
Many... aliases, virtusertable, MailboxDatabase, UserDatabaseSpec, ...
Post by Knute Johnson
them in the /etc/mail/access file? All of the users have UIDs less than
mine which is 1000. Any way to restrict mail to users with a UID less
than 1000? Or any other suggestions?
You could write a script to generate that list.

Make sure you have exceptions for system accounts which are aliased
to actual users for various purposes.
--
Note: please read the netiquette before posting. I will almost never
reply to top-postings which include a full copy of the previous
article(s) at the end because it's annoying, shows that the poster
is too lazy to trim his article, and it's wasting the time of all readers.
Knute Johnson
2024-12-09 21:05:04 UTC
Permalink
Post by Knute Johnson
Virtual server running Debian 12
sendmail 8.17.1.9
dovecot 2.3.19.1
I've gotten some email to some odd/system users on my server, dovecot,
smmsp, list, www-data and _apt for example.  The emails are all spam.
The mail ends up creating a file in /var/mail for that user.  Is there a
way to stop those users from accepting mail?  Other than just listing
them in the /etc/mail/access file?  All of the users have UIDs less than
mine which is 1000.  Any way to restrict mail to users with a UID less
than 1000?  Or any other suggestions?
Thanks Bjorn an Claus for you answers! Some aliases are probably the
simplest answer for now.
--
Knute Johnson
Loading...