Operating System - Linux
1833154 Members
3828 Online
110051 Solutions
New Discussion

is it possible that email users havent login account.

 
SOLVED
Go to solution
Maaz
Valued Contributor

is it possible that email users havent login account.

hi Gurus

OS: rhel 3.0

I m running the sendmail server, all the default settings, and but by simply removing the following line
DAEMON_OPTIONS(`Port=smtp,Addr=127.0.0.1, Name=MTA')dnl

I have to create user accounts on my sendmail server, so that my email clients can send and
access mail(s). because mailbox is only created when user have login account at the server.

Is it possible that user doesnt have login account on the server, but user have its mail box on the sendmail server(i.e user can send/receive mails using the sendmail server without having login account) ?.

Regards
Maaz
13 REPLIES 13
xyko_1
Esteemed Contributor
Solution

Re: is it possible that email users havent login account.

Hi Maaz,

I think nologin solves your problem.

see man nologin

The only thing you have to do is to set the last field of passwd as /sbin/nologin for each mail only user.

regards,
Xyko
Steven E. Protter
Exalted Contributor

Re: is it possible that email users havent login account.

The user needs an account.

But you can prevent any and all logins, and still provide mail services to them.

Set the shell in /etc/passwd to:

/sbin/nologin


Then they can't log in, but can get their mail via web, imap, pop or other protocol just fine.

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
Steven E. Protter
Exalted Contributor

Re: is it possible that email users havent login account.

BTW, taking that line out of sendmail.mc will prevent you from providing web based email to your users.

Squirrelmail is a httpd add in tool that handles its mail traffic on loopback. This setting change may interfere with its operation.

Just something to think about.

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
Maaz
Valued Contributor

Re: is it possible that email users havent login account.

Dear Xyko, and SEP many Thanks for the great help.

Dear SEP, i havent any good knowledge of Sendmail (: but, even I dont know whats goal or purpose of this Line even.. but I once have heard that if this line, is present then sendmail doesnt work/accept mails from the email clients(from the network).
If u can plz le me know the purpose of this line ? and the benefits of squirrelmail

Regards
Maaz
Stuart Browne
Honored Contributor

Re: is it possible that email users havent login account.

Actually SEP, taking that line out makes Sendmail listen on all interfaces (0.0.0.0). The only reason for that line in the MC file is to restrict Sendmail to only listen on the Local interface.

SquirrelMail is a Web-based Mail software, which allows users to access their mail in a web browser instead of having to POP it off the server.

It just depends on how you want users to be able to access their mail.
One long-haired git at your service...
Steven E. Protter
Exalted Contributor

Re: is it possible that email users havent login account.

Prior post was made on the assumption that there were other lines like this:

DAEMON_OPTIONS(`Port=smtp,Addr=127.0.0.1, Name=MTA')dnl

With different Addr commands. I'd never actually experimented with taking all the lines out. Which to me sounds like a counter-intuitive thing to do. Under these circumstances it would be better to not run sendmail at all.

The DAEMON_OPTIONS command tells the sendmail daemon to listen on the Address indicated in the Addr directive. In this case that is loopback.

To control the interfaces that I allow inbound mail inbound, I have a statement for each allowed interface in the sendmail.mc file. That way sendmail will not listen on any other interfaces. Since my mail ip address is different than my web ip address or the server's primary ip address, this setup prevents spammers from trying to play games and get mail into the server or exploit security to force sendmail to relay.

Other things: Sendmail is a fascinating, secureable product. There is a ton to learn at http://www.sendmail.org

Thanks Stuart for the clarification. I always learn new things reading your posts.

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
Maaz
Valued Contributor

Re: is it possible that email users havent login account.

Thanks Dear Stuart and SEP.

sendmail server have multiple interfaces.
if i can add multiple lines in mc file like
DAEMON_OPTIONS(`Port=smtp,Addr=10.0.0.10, Name=MTA')dnl
DAEMON_OPTIONS(`Port=smtp,Addr=10.0.0.11, Name=MTA')dnl
DAEMON_OPTIONS(`Port=smtp,Addr=192.168.10.11, Name=MTA')dnl

Regards
Maaz
Stuart Browne
Honored Contributor

Re: is it possible that email users havent login account.

Yes, you can do it that way. That is what SEP does.

Incidentally, if you really want to have account-less pop/smtp mail, then look at a differen MTA (i.e. surgemail instead of sendmail).
One long-haired git at your service...
Steven E. Protter
Exalted Contributor

Re: is it possible that email users havent login account.

Yes,

Attaching a script to build the sendmail.cf file off the sendmail.mc file.

I should have mentioned earlier and therefor deserve no points for this post, that merely modifying the .mc file does nothing. You have to process it to put it into production.

The attached script does this processing.

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
Stuart Browne
Honored Contributor

Re: is it possible that email users havent login account.

The other thing you can do is rely upon the RH startup routines, or the inferstructure RH put in place for sendmail.

Whenever sendmail starts on a RH box (RH8 or newer), it steps through the following code:

echo -n $"Starting $prog: "
if test -x /usr/bin/make -a -f /etc/mail/Makefile ; then
make all -C /etc/mail -s > /dev/null
else
for i in virtusertable access domaintable mailertable ; do
if [ -f /etc/mail/$i ] ; then
makemap hash /etc/mail/$i < /etc/mail/$i
fi
done
fi
/usr/bin/newaliases > /dev/null 2>&1

Simply put, it runs a 'make' in the '/etc/mail' directory, which will re-build any CF files if an MC file has been updated.

it also forcibly re-makes any of the database files, and re-creates the alias database.

Basically, if you make a change and restart sendmail, the changes should come through without having to go to extra lengths.

If you just make a change to one of the databases, you can either do a 'make' in '/etc/mail' or do a 'service sendmail reload' (which will basically do that anyway, but it will also HUP sendmail).

Much fun.. ;)
One long-haired git at your service...
Stuart Browne
Honored Contributor

Re: is it possible that email users havent login account.

.. but I guess if 'make' isn't on the system, that doesn't help much ..

who has a system without make though?

(0 pts please)
One long-haired git at your service...
xyko_1
Esteemed Contributor

Re: is it possible that email users havent login account.

Maaz and others,

I don't use sendmail, so I can't help on the discussion right now.

But, if possible, I suggest to Maaz to look for Postfix. Postfix is very reliable, secure, has good performance, has a lot of documentation on the net and is easier to configure to me. redhat has the 2 options and a tool to switch from sendmail to postfix automaticaly when you has just finished the installation and didn't make any customization. I don't know if you run that tool now you will carry your customizations to postfix.

What does you think about that friends ?

regards,
xyko
Maaz
Valued Contributor

Re: is it possible that email users havent login account.

Thankx Dear All. SEP and Stuart, i m highly thankful to u, for the support.
Many Thanks for xyko for ur sugestion.

Regards
Maaz