[SOLVED] How to restrict some uses to send mail to outside domains
Linux - GeneralThis Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Glad to see it worked
But please note that vksingh@example.com is not a valid useranme for /etc/passwd. If you want to use the same username with different domains, you go with /etc/mail/virtusertable:
Yes , you are right but all naming convenstion handle by virtual min be default it is really a greate software developed by webmin i am using Virtualmin GPL.
Thanks a lot for all of your help. If you do not mind could you please reply on my other thread in LQ for quota / auto responder issue if possible
Yes , you are right but all naming convenstion handle by virtual min be default it is really a greate software developed by webmin i am using Virtualmin GPL.
Thanks a lot for all of your help. If you do not mind could you please reply on my other thread in LQ for quota / auto responder issue if possible
Thanks a lot and Great Day!
Hi Again,
I tested many thing for this restriction and it is working until i use simple name like "vksingh". I tested with 2 domains and when i use "vksingh.example" or "vksingh.sample" it does not work. Is there any limitation that i cant use long name / domain name or if use "vksingh.k" it works.
Please suggest me on this how to use username convention in this scenario.
Feb 22 16:12:23 smtp sm-mta[5429]: o1MEBqui005429: ruleset=check_rcpt, arg1=XXX@gmail.com, relay=localhost [127.0.0.1], reject=551 5.1.8 sorry luser your boss does not like you
Feb 22 16:12:32 smtp sm-mta[5429]: o1MEBqui005429: from=vksingh.example@domain.com, size=0, class=0, nrcpts=0, proto=SMTP, daemon=MTA, relay=localhost [127.0.0.1]
I have tested 2 times. One with just vksingh.example in /etc/mail/intern.only and the other with vksingh.example@domain.com
I have tested 2 times. One with just vksingh.example in /etc/mail/intern.only and the other with vksingh.example@domain.com
Thanks for reply again.
When i choose /etc/mail/intern.only lets say "vksingh" it works always but when i choose virtualmin user vksingh.example and vksingh.sample domain as two differnet domain i created with the same user name like vksingh@example.com and vksingh@sample.com with the help of virtualmin via webmin. I have to choose naming convetion which comes by default via virutalmin have to choose <user-name>.<domain-name>.
That is
cat /etc/mail/intern.only
vksingh.example
if wants to block vksingh only at example.com
but does not work in my case.But works vksingh only and stop mail for vksingh user for both domain?? Do not know why i can not use virtualmin full user name in intern.only file??
If you get time could you please look at Virtualmin then i think i would more clear on my point. It is very useful and simple to create / manage multiple domain in Sendmail.
Thanks Anyways you give me excellent settings for this one.
Last edited by mail4vijay; 02-22-2010 at 09:01 AM.
Well I've just tested again the rules using your setup and they work as expected:
1. With both vksingh.example and vksingh.sample in /etc/mail/intern.only none can send email
2 With just vksingh.example in /etc/mail/intern.only, the user vksingh.example cannot send while the other vksingh.sample can.
I don't know what virtulamin does to setup virtual users, but in sendmail they are defined in /etc/mail/virtusertable, where you map an email address to a username:
And as I told you above the rules can distinguish between those 2 usernames.
I guess you restart sendmail after changing /etc/mail/intern.only.
Could you post the relevant part of maillog to see if we can get something
Well I've just tested again the rules using your setup and they work as expected:
1. With both vksingh.example and vksingh.sample in /etc/mail/intern.only none can send email
2 With just vksingh.example in /etc/mail/intern.only, the user vksingh.example cannot send while the other vksingh.sample can.
I don't know what virtulamin does to setup virtual users, but in sendmail they are defined in /etc/mail/virtusertable, where you map an email address to a username:
And as I told you above the rules can distinguish between those 2 usernames.
I guess you restart sendmail after changing /etc/mail/intern.only.
Could you post the relevant part of maillog to see if we can get something
Group has nothing to do with this problem and most likely the same goes for virtualmid. May I ask why do you need one group for each user?
Anyway I cannot tell what's wrong, but you can test using the email addresses in /etc/mail/intern.only
For me this woks too.
When i use vksingh only in intern.only file it works and i am using two different group because i created virtual servers from virtualmin and its automatically add master group for the respective domain so that
it shows like below. I think that group name creating some problem?
Code:
ls -ld /home/ozone-india/homes/vksingh
drwxr-xr-x 4 vksingh.example example 4096 Feb 23 14:34 /home/ozone-india/homes/vksingh
Last edited by mail4vijay; 02-23-2010 at 04:10 AM.
Well I tell you once again that group has nothing to do with this.
Sendmail checks the username and if it finds it in intern.only, it forbids mail to external domains.
Check the logs to see what is the difference between the 2 cases, i.e. when it allows and when it forbids external mail
Well I tell you once again that group has nothing to do with this.
Sendmail checks the username and if it finds it in intern.only, it forbids mail to external domains.
Check the logs to see what is the difference between the 2 cases, i.e. when it allows and when it forbids external mail
Yes you are 100% right , Now this time i did restart the box and now it is accepting my settings for all type of users.
Thanks so much for taking care of this for sure.
Great Day!
I came across this thread and it was just what I was looking for. I've tried it and it works like a charm when I'm sending email, but the user is also blocked when receiving email from an external domain, is this correct? If so, is there a way around this?
I like to block only the outgoing email, not the incoming email.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.