LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This 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


Reply
  Search this Thread
Old 02-18-2010, 03:59 AM   #16
mail4vijay
Member
 
Registered: Oct 2009
Location: Delhi
Distribution: CentOS , RHEL
Posts: 214

Original Poster
Rep: Reputation: 33

Quote:
Originally Posted by bathory View Post
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:
Code:
vksingh@example.com vksing
vksingh@example.net vksingg
Regards
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!
 
Old 02-22-2010, 07:45 AM   #17
mail4vijay
Member
 
Registered: Oct 2009
Location: Delhi
Distribution: CentOS , RHEL
Posts: 214

Original Poster
Rep: Reputation: 33
Quote:
Originally Posted by mail4vijay View Post
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.
 
Old 02-22-2010, 08:29 AM   #18
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 13,163
Blog Entries: 1

Rep: Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032
I does work for me:
Quote:
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
 
Old 02-22-2010, 08:59 AM   #19
mail4vijay
Member
 
Registered: Oct 2009
Location: Delhi
Distribution: CentOS , RHEL
Posts: 214

Original Poster
Rep: Reputation: 33
Quote:
Originally Posted by bathory View Post
I does work for me:

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.
 
Old 02-22-2010, 09:40 AM   #20
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 13,163
Blog Entries: 1

Rep: Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032
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:
Code:
vksingh@example.com vksingh.example
vksingh@sample.com vksingh.sample
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
 
Old 02-22-2010, 11:54 AM   #21
mail4vijay
Member
 
Registered: Oct 2009
Location: Delhi
Distribution: CentOS , RHEL
Posts: 214

Original Poster
Rep: Reputation: 33
Quote:
Originally Posted by bathory View Post
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:
Code:
vksingh@example.com vksingh.example
vksingh@sample.com vksingh.sample
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
Code:
grep -i vksingh /etc/passwd
vksingh.example:x:503:502::/home/example/homes/vksingh:/dev/null
vksingh.sample:x:505:504::/home/sample/homes/vksingh:/dev/null
> grep -i vksingh /etc/mail/virtusertable
vksingh@example.com	vksingh.example
vksingh@sample.com	vksingh.sample
> grep -i 502 /etc/group
example:x:502:apache
> grep 504 /etc/group
sample:x:504:apache
> cat /etc/mail/intern.only
vksingh.example
Code:
Feb 22 22:09:07 mailserver procmail[23106]: Enforcing stricter permissions on "/var/mail/vksingh.sample"
Feb 22 22:09:07 mailserver procmail[23106]: Error while writing to "/var/log/procmail.log"
Feb 22 22:09:07 mailserver sendmail[23105]: o1MGd7RN023102: to=<vksingh@sample.com>, delay=00:00:00, xdelay=00:00:00, mailer=local, pri=31031, dsn=2.0.0, stat=Sent
Feb 22 22:15:25 mailserver sendmail[23320]: o1MGjPEW023320: from=vksingh@example.com, size=442, class=0, nrcpts=1, msgid=<1266857125.23313@example.com>, relay=root@localhost
Feb 22 22:15:25 mailserver sendmail[23321]: o1MGjPM2023321: from=<vksingh@example.com>, size=574, class=0, nrcpts=1, msgid=<1266857125.23313@example.com>, proto=ESMTP, daemon=MTA, relay=localhost.localdomain [127.0.0.1]
Feb 22 22:15:25 mailserver sendmail[23320]: o1MGjPEW023320: to=rajmail2@gmail.com, ctladdr=vksingh@example.com (0/0), delay=00:00:00, xdelay=00:00:00, mailer=relay, pri=30442, relay=[127.0.0.1] [127.0.0.1], dsn=2.0.0, stat=Sent (o1MGjPM2023321 Message accepted for delivery)
Feb 22 22:15:29 mailserver sendmail[23325]: o1MGjPM2023321: to=<rajmail2@gmail.com>, ctladdr=<vksingh@example.com> (503/502), delay=00:00:04, xdelay=00:00:04, mailer=relay, pri=120574, relay=[x.x.x.x] [x.x.x.x], dsn=2.0.0, stat=Sent (OK)
Still i am able to send out mail if i use full username?? Some thing related to group settings comes with Virtualmin??

Last edited by mail4vijay; 02-22-2010 at 12:00 PM.
 
Old 02-22-2010, 01:08 PM   #22
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 13,163
Blog Entries: 1

Rep: Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032
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
Quote:
vksingh@example.com
vksingh@sample.com
For me this woks too.
 
Old 02-23-2010, 03:08 AM   #23
mail4vijay
Member
 
Registered: Oct 2009
Location: Delhi
Distribution: CentOS , RHEL
Posts: 214

Original Poster
Rep: Reputation: 33
Quote:
Originally Posted by bathory View Post
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.
 
Old 02-23-2010, 03:36 AM   #24
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 13,163
Blog Entries: 1

Rep: Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032
Hi,

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
 
Old 02-23-2010, 04:27 AM   #25
mail4vijay
Member
 
Registered: Oct 2009
Location: Delhi
Distribution: CentOS , RHEL
Posts: 214

Original Poster
Rep: Reputation: 33
Quote:
Originally Posted by bathory View Post
Hi,

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!
 
Old 04-02-2010, 04:24 AM   #26
cor9957
LQ Newbie
 
Registered: Dec 2006
Location: IJmuiden, the Netherlands
Distribution: CentOS, Fedora, Ubuntu
Posts: 24

Rep: Reputation: 10
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.
 
  


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 On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Restrict user to send mail jeesun Linux - Server 12 10-14-2009 04:40 AM
how to restrict a user to send mails only to 3 email IDs in postfix mail server sharath41 Linux - Server 1 07-04-2008 03:40 PM
sendmail - how to send mail from multiple domains? neocontrol Linux - Server 1 05-14-2007 02:18 AM
Outlook can not send mail to external domains fhejazi General 7 09-08-2006 02:48 PM
Sendmail: How can I avoid some users send mail to outside domains? lordphantom82 Linux - Software 0 11-16-2004 07:23 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 01:16 PM.

Main Menu
Advertisement
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
Open Source Consulting | Domain Registration