Bluehost.com Web Hosting $6.95

local mail

This is a discussion on local mail within the Linux General forums, part of the Linux Forums category; Is there a way to have mail delivered to local users without running program like sendmail or postfix as a ...


Go Back   Usenet Forums > Linux Forums > Linux General

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 03-29-2008
blueparty
 
Posts: n/a
Default local mail

Is there a way to have mail delivered to local users without running
program like sendmail or postfix as a daemon. I'd like to use mail
command to send mail like:

mail -s test anyone@localhost < message.txt

or

mail -s test anyone < message.txt

I am running openSUSE 10.3.
I am not planning to send email away from the machine to other hosts.
Reply With Quote
  #2 (permalink)  
Old 03-29-2008
Dances With Crows
 
Posts: n/a
Default Re: local mail

blueparty staggered into the Black Sun and said:
> Is there a way to have mail delivered to local users without running
> [a] program like sendmail or postfix as a daemon[?]


If you want to have a machine deliver mail to users, that machine has to
run an MTA. It doesn't have to run a full MTA like exim or postfix; it
can run a simple, local-only MTA like ssmtp.

> I'd like to
> mail -s test anyone@localhost < message.txt
>
> I am running openSUSE 10.3. I am not planning to send email away from
> the machine to other hosts.


Install and confiugre ssmtp, and it should do what you need.

--
The early bird who catches the worm works for someone who comes in
late and owns the worm farm. --Travis McGee
My blog and resume: http://crow202.dyndns.org:8080/wordpress/
Matt G|There is no Darkness in Eternity/But only Light too dim for us to see
Reply With Quote
  #3 (permalink)  
Old 03-29-2008
Tom Newton
 
Posts: n/a
Default Re: local mail

On 2008-03-29, in
<slrnfusnnd.eok.danceswithcrows@crow202.dyndns.org > Dances With
Crows <danceswithcrows@usa.net> wrote:

> blueparty staggered into the Black Sun and said:
>
>> Is there a way to have mail delivered to local users without
>> running [a] program like sendmail or postfix as a daemon[?]

>
> If you want to have a machine deliver mail to users, that
> machine has to run an MTA. It doesn't have to run a full MTA
> like exim or postfix; it can run a simple, local-only MTA like
> ssmtp.
>
>> I'd like to mail -s test anyone@localhost < message.txt
>>
>> I am running openSUSE 10.3. I am not planning to send email
>> away from the machine to other hosts.

>
> Install and confiugre ssmtp, and it should do what you need.


Unless some serious work has been done on ssmtp since the last time
I looked over the docs, msmtp is much more versatile. It can handle
TLS/SSL authentications and connections. A lot of mail service
providers require them these days.

Tom

--
The Truth will set you free:
http://www.sethcenter.com

Reply With Quote
  #4 (permalink)  
Old 03-30-2008
blueparty
 
Posts: n/a
Default Re: local mail

On Mar 29, 5:23 pm, Dances With Crows <danceswithcr...@usa.net> wrote:
> blueparty staggered into the Black Sun and said:
>
> > Is there a way to have mail delivered to local users without running
> > [a] program like sendmail or postfix as a daemon[?]

>
> If you want to have a machine deliver mail to users, that machine has to
> run an MTA. It doesn't have to run a full MTA like exim or postfix; it
> can run a simple, local-only MTA like ssmtp.
>
> > I'd like to
> > mail -s test anyone@localhost < message.txt

>
> > I am running openSUSE 10.3. I am not planning to send email away from
> > the machine to other hosts.

>
> Install and confiugre ssmtp, and it should do what you need.
>



I remember that on old Red Hat 9 was possible to have local delivery
without daemon. Sendmail
have most likely been called by mail command as foreground process, I
am not sure. I remember I have
configured that in m4 file somehow, but it was long ago. It means that
Sendmail was involved, but I am sure
it was not running as a daemon.

Is it still possible ?

I am trying to send myself reminders from crontab. I can do it with
"mail -F file" command, but it is a bit clumsy.

B


Reply With Quote
  #5 (permalink)  
Old 03-30-2008
Dances With Crows
 
Posts: n/a
Default Re: local mail

blueparty staggered into the Black Sun and said:
> Dances With Crows wrote:
>> blueparty staggered into the Black Sun and said:
>>> Is there a way to have mail delivered to local users without
>>> running [a] program like sendmail or postfix as a daemon[?]

>> If you want to have a machine deliver mail to users, that machine has
>> to run an MTA. It doesn't have to run a full MTA like exim or
>> postfix; it can run a simple, local-only MTA like ssmtp.
>>> I'd like to mail -s test anyone@localhost < message.txt
>>> I am running openSUSE 10.3. I am not planning to send email away
>>> from the machine to other hosts.

>> Install and confiugre ssmtp, and it should do what you need.

> I remember that on old Red Hat 9 was possible to have local delivery
> without [a] daemon. Sendmail have most likely been called by [the]
> mail command as [a] foreground process, I am not sure.


Practically every MTA has an executable called "sendmail":
mallory:~$ equery belongs /usr/sbin/sendmail
[ Searching for file(s) /usr/sbin/sendmail in *... ]
mail-mta/postfix-2.4.0 (/usr/sbin/sendmail)

....because so many things expect something called sendmail to be there.
ssmtp wouldn't necessarily have to run as a daemon since it's not
listening for external connections.

> configured that in m4 file somehow, but it was long ago. It means that
> Sendmail was involved, but I am sure it was not running as a daemon.


sendmail the MTA was not necessarily involved in anything. If you need
a real MTA, you should probably not use sendmail unless you're a
sendmail guru. If you don't need a real MTA, you should install ssmtp
as it's really easy to configure.

> Is it still possible ?


Yes. Install and configure ssmtp, like I said before.

--
This is my rifle, this is my GNU
This is for fighting, this is for $FOO! --AJS in ASR
My blog and resume: http://crow202.dyndns.org:8080/wordpress/
Matt G|There is no Darkness in Eternity/But only Light too dim for us to see
Reply With Quote
  #6 (permalink)  
Old 03-30-2008
Grant Edwards
 
Posts: n/a
Default Re: local mail

On 2008-03-30, Dances With Crows <danceswithcrows@usa.net> wrote:

> sendmail the MTA was not necessarily involved in anything. If you need
> a real MTA, you should probably not use sendmail unless you're a
> sendmail guru. If you don't need a real MTA, you should install ssmtp
> as it's really easy to configure.
>
>> Is it still possible ?

>
> Yes. Install and configure ssmtp, like I said before.


I recently switched from ssmtp to msmtp. It's just as
simple/easy to set up with the added advantage that you can
have per-user configurations and multiple smtp servers per
configuration (if you want). Since I have multiple e-mail
accounts, ssmtp just didn't cut it because of the single,
global configuration limited to a single smtp server.

--
Grant Edwards grante Yow! PEGGY FLEMMING is
at stealing BASKET BALLS to
visi.com feed the babies in VERMONT.
Reply With Quote
  #7 (permalink)  
Old 03-30-2008
Kees Theunissen
 
Posts: n/a
Default Re: local mail

blueparty wrote:
> On Mar 29, 5:23 pm, Dances With Crows <danceswithcr...@usa.net> wrote:
>> blueparty staggered into the Black Sun and said:
>>
>>> Is there a way to have mail delivered to local users without running
>>> [a] program like sendmail or postfix as a daemon[?]

>> If you want to have a machine deliver mail to users, that machine has to
>> run an MTA. It doesn't have to run a full MTA like exim or postfix; it
>> can run a simple, local-only MTA like ssmtp.
>>
>>> I'd like to
>>> mail -s test anyone@localhost < message.txt
>>> I am running openSUSE 10.3. I am not planning to send email away from
>>> the machine to other hosts.

>> Install and confiugre ssmtp, and it should do what you need.
>>

>
>
> I remember that on old Red Hat 9 was possible to have local delivery
> without daemon. Sendmail
> have most likely been called by mail command as foreground process, I
> am not sure. I remember I have
> configured that in m4 file somehow, but it was long ago. It means that
> Sendmail was involved, but I am sure
> it was not running as a daemon.


That must have been a sendmail version prior to 8.12.0.
Version 8.12.0 was released on 2001/09/08. I don't know when 8.12.0
was included in Redhat.

> Is it still possible ?


No. At least not without seriously hacking the default configuration.

The problem with local mail delivery is that the sender doesn't
have access rights to the recipient's mailbox. To deliver a message
the "local delivery agent" -that is procmail on most linux systems-
_must_ run with the rights of the user receiving the message, and
_only_ that users rights. You don't even want a delivery agent to have
group rights to mailboxes (with the rights of group "mail" for instance)
as a user can specify external programs to be started by the delivery
agent when he/she receives a message (via his/her .procmailrc or
..forward files) which then would also have group access rights to other
users' mailboxes.

So somewhere in the process chain between message submission and message
delivery you need a process that is able to change its user id from the
senders' id to the recipient's id. Only root-owned processes can do
that.

Sendmail prior to version 8.12.0 was a "suid root" program. A normal
user could start sendmail to deliver a message and the started sendmail
would have full "root" rights. Sendmail would drop those rights before
the final delivery of the message. But sendmail would initially start
as a root-owned process invoked with a user supplied command line -
possibly including a user supplied configuration file.
As sendmail is a complex program, and the sendmail configuration is
almost a full featured script language, this clearly is a security risk.

Sendmail 8.12.0 changed this behavior. The sendmail binary isn't
"suid root" anymore. When a user invokes sendmail to deliver a message
the message is only handed over to a daemon process that _must_ be
running. That daemon is still a root-owned process, but it is guaranteed
to have been started with a command line and configuration file supplied
by root.

Sendmail still needs special group rights (via sgid) to access its
-protected from normal users- "mail submission queue directory".
On my Slackware 12.0 system with sendmail 8.14.1 this is implemented as:

~$ ls -ld /usr/sbin/sendmail /var/spool/clientmqueue
-r-xr-sr-x 1 root smmsp 692804 2007-06-10 07:16 /usr/sbin/sendmail*
drwxrwx--- 2 smmsp smmsp 4096 2008-03-28 22:45 /var/spool/clientmqueue/

Access to the submission queue is all that is gained by running as
a "sgid smmsp" process. Normally this queue will be empty when the
sendmail daemon is running and the system is not overloaded. So a
local user, trying to exploit possible bugs in sendmail, has very little
to gain compared to the old situation with a "suid root" sendmail
program.


Regards,

Kees.

--
Kees Theunissen.
Reply With Quote
  #8 (permalink)  
Old 03-30-2008
Dances With Crows
 
Posts: n/a
Default Re: local mail

Grant Edwards staggered into the Black Sun and said:
> On 2008-03-30, Dances With Crows <danceswithcrows@usa.net> wrote:
>>> Is it still possible ?

>> Yes. Install and configure ssmtp, like I said before.

> I recently switched from ssmtp to msmtp. It's just as simple/easy to
> set up with the added advantage that you can have per-user
> configurations and multiple smtp servers per configuration (if you
> want).


Interesting, and possibly useful. I haven't been keeping up with the
local-only MTAs since I have been running postfix for some time now.

--
There is not enough coffee in the world.
--TimC in ASR
My blog and resume: http://crow202.dyndns.org:8080/wordpress/
Matt G|There is no Darkness in Eternity/But only Light too dim for us to see
Reply With Quote
  #9 (permalink)  
Old 03-31-2008
blueparty
 
Posts: n/a
Default Re: local mail

On Mar 30, 5:12 pm, Dances With Crows <danceswithcr...@usa.net> wrote:
> blueparty staggered into the Black Sun and said:
>
> > Dances With Crows wrote:
> >> blueparty staggered into the Black Sun and said:
> >>> Is there a way to have mail delivered to local users without
> >>> running [a] program like sendmail or postfix as a daemon[?]
> >> If you want to have a machine deliver mail to users, that machine has
> >> to run an MTA. It doesn't have to run a full MTA like exim or
> >> postfix; it can run a simple, local-only MTA like ssmtp.
> >>> I'd like to mail -s test anyone@localhost < message.txt
> >>> I am running openSUSE 10.3. I am not planning to send email away
> >>> from the machine to other hosts.
> >> Install and confiugre ssmtp, and it should do what you need.

> > I remember that on old Red Hat 9 was possible to have local delivery
> > without [a] daemon. Sendmail have most likely been called by [the]
> > mail command as [a] foreground process, I am not sure.

>
> Practically every MTA has an executable called "sendmail":
> mallory:~$ equery belongs /usr/sbin/sendmail
> [ Searching for file(s) /usr/sbin/sendmail in *... ]
> mail-mta/postfix-2.4.0 (/usr/sbin/sendmail)
>
> ...because so many things expect something called sendmail to be there.
> ssmtp wouldn't necessarily have to run as a daemon since it's not
> listening for external connections.
>
> > configured that in m4 file somehow, but it was long ago. It means that
> > Sendmail was involved, but I am sure it was not running as a daemon.

>
> sendmail the MTA was not necessarily involved in anything. If you need
> a real MTA, you should probably not use sendmail unless you're a
> sendmail guru. If you don't need a real MTA, you should install ssmtp
> as it's really easy to configure.
>
> > Is it still possible ?

>
> Yes. Install and configure ssmtp, like I said before.
>

Well, it didn't work. Perhaps I should try little harder (version
2.61). I compiled it from
source...

B
Reply With Quote
  #10 (permalink)  
Old 03-31-2008
blueparty
 
Posts: n/a
Default Re: local mail

On Mar 30, 5:12 pm, Dances With Crows <danceswithcr...@usa.net> wrote:
> blueparty staggered into the Black Sun and said:
>
> > Dances With Crows wrote:
> >> blueparty staggered into the Black Sun and said:
> >>> Is there a way to have mail delivered to local users without
> >>> running [a] program like sendmail or postfix as a daemon[?]
> >> If you want to have a machine deliver mail to users, that machine has
> >> to run an MTA. It doesn't have to run a full MTA like exim or
> >> postfix; it can run a simple, local-only MTA like ssmtp.
> >>> I'd like to mail -s test anyone@localhost < message.txt
> >>> I am running openSUSE 10.3. I am not planning to send email away
> >>> from the machine to other hosts.
> >> Install and confiugre ssmtp, and it should do what you need.

> > I remember that on old Red Hat 9 was possible to have local delivery
> > without [a] daemon. Sendmail have most likely been called by [the]
> > mail command as [a] foreground process, I am not sure.

>
> Practically every MTA has an executable called "sendmail":
> mallory:~$ equery belongs /usr/sbin/sendmail
> [ Searching for file(s) /usr/sbin/sendmail in *... ]
> mail-mta/postfix-2.4.0 (/usr/sbin/sendmail)
>
> ...because so many things expect something called sendmail to be there.
> ssmtp wouldn't necessarily have to run as a daemon since it's not
> listening for external connections.
>
> > configured that in m4 file somehow, but it was long ago. It means that
> > Sendmail was involved, but I am sure it was not running as a daemon.

>
> sendmail the MTA was not necessarily involved in anything. If you need
> a real MTA, you should probably not use sendmail unless you're a
> sendmail guru. If you don't need a real MTA, you should install ssmtp
> as it's really easy to configure.
>
> > Is it still possible ?

>
> Yes. Install and configure ssmtp, like I said before.
>


As I said, I compiled ssmtp from source.

Tried to mail a massage to local user with -v option. It complained
that there is no /usr/sbin/sendmail.
There is a symlink /lib/sendmail -> sendmail, it seems to point to
itself. Don't know what it is supposed to do.

Tried to symlink /usr/sbin/sendmail to ssmtp binary. After issuing
mail command, it complained that it can't connect
to port 25. I thought that it is supposed to be a local delivery, with
no sockets involved. Tried to comment out mailhub config entry, no
luck. Tried to set it to localhost, does not help.

I don't understand what is ssmtp supposed to do, but if it just
appends to /var/spool/mail files, like I need it to,
the binary should be suid root, or it must be executed via sudo. None
of it seems to be the case. So, I guess,
ssmtp does something else.....

B
Reply With Quote
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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 Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT +1. The time now is 05:42 AM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0