How to block sending mails?

Multi tool use
Multi tool use

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP











up vote
1
down vote

favorite












I want to block specific user from sending emails. I tried doing these things which did not help:



  1. Commented user in /etc/passwd

  2. Wrote passwd -l user and restarted sendmail service.

User can't receive mails - that's OK, but they still may send mails. I use Sendmail (port 25) and Dovecot (port 110 POP3).



Any ideas to block a user from sending mails?










share|improve this question



















  • 1




    The purported duplicate question is about a Posfix system. This question is about, as it says, a Sendmail system. It is not the same answer for both.
    – JdeBP
    Aug 8 at 10:09










  • Then it is not dupe.
    – peterh
    Aug 8 at 19:55














up vote
1
down vote

favorite












I want to block specific user from sending emails. I tried doing these things which did not help:



  1. Commented user in /etc/passwd

  2. Wrote passwd -l user and restarted sendmail service.

User can't receive mails - that's OK, but they still may send mails. I use Sendmail (port 25) and Dovecot (port 110 POP3).



Any ideas to block a user from sending mails?










share|improve this question



















  • 1




    The purported duplicate question is about a Posfix system. This question is about, as it says, a Sendmail system. It is not the same answer for both.
    – JdeBP
    Aug 8 at 10:09










  • Then it is not dupe.
    – peterh
    Aug 8 at 19:55












up vote
1
down vote

favorite









up vote
1
down vote

favorite











I want to block specific user from sending emails. I tried doing these things which did not help:



  1. Commented user in /etc/passwd

  2. Wrote passwd -l user and restarted sendmail service.

User can't receive mails - that's OK, but they still may send mails. I use Sendmail (port 25) and Dovecot (port 110 POP3).



Any ideas to block a user from sending mails?










share|improve this question















I want to block specific user from sending emails. I tried doing these things which did not help:



  1. Commented user in /etc/passwd

  2. Wrote passwd -l user and restarted sendmail service.

User can't receive mails - that's OK, but they still may send mails. I use Sendmail (port 25) and Dovecot (port 110 POP3).



Any ideas to block a user from sending mails?







sendmail






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Aug 8 at 10:05









slm♦

238k65491662




238k65491662










asked Aug 8 at 9:39









it dev

244




244







  • 1




    The purported duplicate question is about a Posfix system. This question is about, as it says, a Sendmail system. It is not the same answer for both.
    – JdeBP
    Aug 8 at 10:09










  • Then it is not dupe.
    – peterh
    Aug 8 at 19:55












  • 1




    The purported duplicate question is about a Posfix system. This question is about, as it says, a Sendmail system. It is not the same answer for both.
    – JdeBP
    Aug 8 at 10:09










  • Then it is not dupe.
    – peterh
    Aug 8 at 19:55







1




1




The purported duplicate question is about a Posfix system. This question is about, as it says, a Sendmail system. It is not the same answer for both.
– JdeBP
Aug 8 at 10:09




The purported duplicate question is about a Posfix system. This question is about, as it says, a Sendmail system. It is not the same answer for both.
– JdeBP
Aug 8 at 10:09












Then it is not dupe.
– peterh
Aug 8 at 19:55




Then it is not dupe.
– peterh
Aug 8 at 19:55










1 Answer
1






active

oldest

votes

















up vote
1
down vote













In Sendmail you can add this user to the /etc/mail/access database file (access.db) to disallow them from sending emails:



Put their address in the file /etc/mail/access:



user@my-domain.com REJECT


Then rebuild it:



$ makemap hash /etc/mail/access.db < /etc/mail/access


NOTE: From what I remember you may have to put several permutations of their email address in this file to stop them. so things like user@localhost, etc.



I do not have a sendmail setup handy, but you can typically use a Makefile command that's provided in newer implementations of sendmail.



For more controlling the sending/receiving via Sendmail you can do more specific controls like this in this file:



To:a1@server.vikas.com REJECT # Reject a1 user from recieving mails
From:a1@server.vikas.com REJECT # Reject a1 user from sending mails


References



  • How to enable/disable user's access to email (sendmail)





share|improve this answer




















  • Is it necessary to rebuild it? I am a little frightened to use makemap command
    – it dev
    Aug 8 at 10:22










  • I seem to remember that restarting the sendmail service did this as well. But yeah you typically have to rebuild these files in order for sendmail to use them. BTW I just reinstalled sendmail on CentOS 7 and it does still come with a make command, so you should be able to run that if your setup has it. If you're pensive to do this, back up the whole /etc/mail dir 1st.
    – slm♦
    Aug 8 at 10:23







  • 1




    Good old sendmail...I prefered to deal with it editing .mc files...it would be interesting understanding the problem of the user, blocking users in sendmail wont prevent users/malware scripts form sending email/spam via TCP/25 if the infra-structure allows it.
    – Rui F Ribeiro
    Aug 8 at 10:48










  • @slm, may I only restart sendmail service after REJECTING user in access file? Will it help?
    – it dev
    Aug 8 at 11:13










  • @itdev - my suggestion was to try doing a restart after adding REJECT entry to see if it triggers a rebuild of access.db, but I'm 90% sure that you have to rebuild these manually using either rehash or the make command.
    – slm♦
    Aug 8 at 11:15










Your Answer







StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "106"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);

else
createEditor();

);

function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
convertImagesToLinks: false,
noModals: false,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);



);













 

draft saved


draft discarded


















StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f461242%2fhow-to-block-sending-mails%23new-answer', 'question_page');

);

Post as a guest






























1 Answer
1






active

oldest

votes








1 Answer
1






active

oldest

votes









active

oldest

votes






active

oldest

votes








up vote
1
down vote













In Sendmail you can add this user to the /etc/mail/access database file (access.db) to disallow them from sending emails:



Put their address in the file /etc/mail/access:



user@my-domain.com REJECT


Then rebuild it:



$ makemap hash /etc/mail/access.db < /etc/mail/access


NOTE: From what I remember you may have to put several permutations of their email address in this file to stop them. so things like user@localhost, etc.



I do not have a sendmail setup handy, but you can typically use a Makefile command that's provided in newer implementations of sendmail.



For more controlling the sending/receiving via Sendmail you can do more specific controls like this in this file:



To:a1@server.vikas.com REJECT # Reject a1 user from recieving mails
From:a1@server.vikas.com REJECT # Reject a1 user from sending mails


References



  • How to enable/disable user's access to email (sendmail)





share|improve this answer




















  • Is it necessary to rebuild it? I am a little frightened to use makemap command
    – it dev
    Aug 8 at 10:22










  • I seem to remember that restarting the sendmail service did this as well. But yeah you typically have to rebuild these files in order for sendmail to use them. BTW I just reinstalled sendmail on CentOS 7 and it does still come with a make command, so you should be able to run that if your setup has it. If you're pensive to do this, back up the whole /etc/mail dir 1st.
    – slm♦
    Aug 8 at 10:23







  • 1




    Good old sendmail...I prefered to deal with it editing .mc files...it would be interesting understanding the problem of the user, blocking users in sendmail wont prevent users/malware scripts form sending email/spam via TCP/25 if the infra-structure allows it.
    – Rui F Ribeiro
    Aug 8 at 10:48










  • @slm, may I only restart sendmail service after REJECTING user in access file? Will it help?
    – it dev
    Aug 8 at 11:13










  • @itdev - my suggestion was to try doing a restart after adding REJECT entry to see if it triggers a rebuild of access.db, but I'm 90% sure that you have to rebuild these manually using either rehash or the make command.
    – slm♦
    Aug 8 at 11:15














up vote
1
down vote













In Sendmail you can add this user to the /etc/mail/access database file (access.db) to disallow them from sending emails:



Put their address in the file /etc/mail/access:



user@my-domain.com REJECT


Then rebuild it:



$ makemap hash /etc/mail/access.db < /etc/mail/access


NOTE: From what I remember you may have to put several permutations of their email address in this file to stop them. so things like user@localhost, etc.



I do not have a sendmail setup handy, but you can typically use a Makefile command that's provided in newer implementations of sendmail.



For more controlling the sending/receiving via Sendmail you can do more specific controls like this in this file:



To:a1@server.vikas.com REJECT # Reject a1 user from recieving mails
From:a1@server.vikas.com REJECT # Reject a1 user from sending mails


References



  • How to enable/disable user's access to email (sendmail)





share|improve this answer




















  • Is it necessary to rebuild it? I am a little frightened to use makemap command
    – it dev
    Aug 8 at 10:22










  • I seem to remember that restarting the sendmail service did this as well. But yeah you typically have to rebuild these files in order for sendmail to use them. BTW I just reinstalled sendmail on CentOS 7 and it does still come with a make command, so you should be able to run that if your setup has it. If you're pensive to do this, back up the whole /etc/mail dir 1st.
    – slm♦
    Aug 8 at 10:23







  • 1




    Good old sendmail...I prefered to deal with it editing .mc files...it would be interesting understanding the problem of the user, blocking users in sendmail wont prevent users/malware scripts form sending email/spam via TCP/25 if the infra-structure allows it.
    – Rui F Ribeiro
    Aug 8 at 10:48










  • @slm, may I only restart sendmail service after REJECTING user in access file? Will it help?
    – it dev
    Aug 8 at 11:13










  • @itdev - my suggestion was to try doing a restart after adding REJECT entry to see if it triggers a rebuild of access.db, but I'm 90% sure that you have to rebuild these manually using either rehash or the make command.
    – slm♦
    Aug 8 at 11:15












up vote
1
down vote










up vote
1
down vote









In Sendmail you can add this user to the /etc/mail/access database file (access.db) to disallow them from sending emails:



Put their address in the file /etc/mail/access:



user@my-domain.com REJECT


Then rebuild it:



$ makemap hash /etc/mail/access.db < /etc/mail/access


NOTE: From what I remember you may have to put several permutations of their email address in this file to stop them. so things like user@localhost, etc.



I do not have a sendmail setup handy, but you can typically use a Makefile command that's provided in newer implementations of sendmail.



For more controlling the sending/receiving via Sendmail you can do more specific controls like this in this file:



To:a1@server.vikas.com REJECT # Reject a1 user from recieving mails
From:a1@server.vikas.com REJECT # Reject a1 user from sending mails


References



  • How to enable/disable user's access to email (sendmail)





share|improve this answer












In Sendmail you can add this user to the /etc/mail/access database file (access.db) to disallow them from sending emails:



Put their address in the file /etc/mail/access:



user@my-domain.com REJECT


Then rebuild it:



$ makemap hash /etc/mail/access.db < /etc/mail/access


NOTE: From what I remember you may have to put several permutations of their email address in this file to stop them. so things like user@localhost, etc.



I do not have a sendmail setup handy, but you can typically use a Makefile command that's provided in newer implementations of sendmail.



For more controlling the sending/receiving via Sendmail you can do more specific controls like this in this file:



To:a1@server.vikas.com REJECT # Reject a1 user from recieving mails
From:a1@server.vikas.com REJECT # Reject a1 user from sending mails


References



  • How to enable/disable user's access to email (sendmail)






share|improve this answer












share|improve this answer



share|improve this answer










answered Aug 8 at 10:11









slm♦

238k65491662




238k65491662











  • Is it necessary to rebuild it? I am a little frightened to use makemap command
    – it dev
    Aug 8 at 10:22










  • I seem to remember that restarting the sendmail service did this as well. But yeah you typically have to rebuild these files in order for sendmail to use them. BTW I just reinstalled sendmail on CentOS 7 and it does still come with a make command, so you should be able to run that if your setup has it. If you're pensive to do this, back up the whole /etc/mail dir 1st.
    – slm♦
    Aug 8 at 10:23







  • 1




    Good old sendmail...I prefered to deal with it editing .mc files...it would be interesting understanding the problem of the user, blocking users in sendmail wont prevent users/malware scripts form sending email/spam via TCP/25 if the infra-structure allows it.
    – Rui F Ribeiro
    Aug 8 at 10:48










  • @slm, may I only restart sendmail service after REJECTING user in access file? Will it help?
    – it dev
    Aug 8 at 11:13










  • @itdev - my suggestion was to try doing a restart after adding REJECT entry to see if it triggers a rebuild of access.db, but I'm 90% sure that you have to rebuild these manually using either rehash or the make command.
    – slm♦
    Aug 8 at 11:15
















  • Is it necessary to rebuild it? I am a little frightened to use makemap command
    – it dev
    Aug 8 at 10:22










  • I seem to remember that restarting the sendmail service did this as well. But yeah you typically have to rebuild these files in order for sendmail to use them. BTW I just reinstalled sendmail on CentOS 7 and it does still come with a make command, so you should be able to run that if your setup has it. If you're pensive to do this, back up the whole /etc/mail dir 1st.
    – slm♦
    Aug 8 at 10:23







  • 1




    Good old sendmail...I prefered to deal with it editing .mc files...it would be interesting understanding the problem of the user, blocking users in sendmail wont prevent users/malware scripts form sending email/spam via TCP/25 if the infra-structure allows it.
    – Rui F Ribeiro
    Aug 8 at 10:48










  • @slm, may I only restart sendmail service after REJECTING user in access file? Will it help?
    – it dev
    Aug 8 at 11:13










  • @itdev - my suggestion was to try doing a restart after adding REJECT entry to see if it triggers a rebuild of access.db, but I'm 90% sure that you have to rebuild these manually using either rehash or the make command.
    – slm♦
    Aug 8 at 11:15















Is it necessary to rebuild it? I am a little frightened to use makemap command
– it dev
Aug 8 at 10:22




Is it necessary to rebuild it? I am a little frightened to use makemap command
– it dev
Aug 8 at 10:22












I seem to remember that restarting the sendmail service did this as well. But yeah you typically have to rebuild these files in order for sendmail to use them. BTW I just reinstalled sendmail on CentOS 7 and it does still come with a make command, so you should be able to run that if your setup has it. If you're pensive to do this, back up the whole /etc/mail dir 1st.
– slm♦
Aug 8 at 10:23





I seem to remember that restarting the sendmail service did this as well. But yeah you typically have to rebuild these files in order for sendmail to use them. BTW I just reinstalled sendmail on CentOS 7 and it does still come with a make command, so you should be able to run that if your setup has it. If you're pensive to do this, back up the whole /etc/mail dir 1st.
– slm♦
Aug 8 at 10:23





1




1




Good old sendmail...I prefered to deal with it editing .mc files...it would be interesting understanding the problem of the user, blocking users in sendmail wont prevent users/malware scripts form sending email/spam via TCP/25 if the infra-structure allows it.
– Rui F Ribeiro
Aug 8 at 10:48




Good old sendmail...I prefered to deal with it editing .mc files...it would be interesting understanding the problem of the user, blocking users in sendmail wont prevent users/malware scripts form sending email/spam via TCP/25 if the infra-structure allows it.
– Rui F Ribeiro
Aug 8 at 10:48












@slm, may I only restart sendmail service after REJECTING user in access file? Will it help?
– it dev
Aug 8 at 11:13




@slm, may I only restart sendmail service after REJECTING user in access file? Will it help?
– it dev
Aug 8 at 11:13












@itdev - my suggestion was to try doing a restart after adding REJECT entry to see if it triggers a rebuild of access.db, but I'm 90% sure that you have to rebuild these manually using either rehash or the make command.
– slm♦
Aug 8 at 11:15




@itdev - my suggestion was to try doing a restart after adding REJECT entry to see if it triggers a rebuild of access.db, but I'm 90% sure that you have to rebuild these manually using either rehash or the make command.
– slm♦
Aug 8 at 11:15

















 

draft saved


draft discarded















































 


draft saved


draft discarded














StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f461242%2fhow-to-block-sending-mails%23new-answer', 'question_page');

);

Post as a guest













































































CrTNpUyhe44Ft3C,J6Bcx FEF1CIWlUYBmQ6DYW RRK4KXdpad66ASA GMH8N02vgrZ4fBG2,pIkQ
4gtmD,ZgZ6EtU,BlNi6mKD9M34uIclP Gxa,djSN4,DQXXgRZ dmqCM2,UNQHLRRjV,s2TV

Popular posts from this blog

How to check contact read email or not when send email to Individual?

How many registers does an x86_64 CPU actually have?

Displaying single band from multi-band raster using QGIS