Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 513068 - mail-mta/nullmailer-1.13-r4 : (1) nullmailer-send has wrong permission, (2) nullmailer-inject sets wrong permission
Summary: mail-mta/nullmailer-1.13-r4 : (1) nullmailer-send has wrong permission, (2) n...
Status: RESOLVED WORKSFORME
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Robin Johnson
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-06-12 19:46 UTC by d. paddy
Modified: 2014-12-15 07:40 UTC (History)
2 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description d. paddy 2014-06-12 19:46:02 UTC
Two problems preventing messages from being sent.

(1) Permission on nullmailer-send prevents it from being executed.

FIX:

#chgrp nullmail /usr/sbin/nullmailer-send

(2) Permission on message prevents nullmailer-send from sending it.

ls -l /var/nullmailer/queue/1402600668.28042 
-rw------- 1 nullmail sender 410 Jun 12 15:17 /var/nullmailer/queue/1402600668.28042

FIX: Change the code I guess... what is needed is for nullmailer-inject
     to install the message (i.e., 1402600668.28042) into /var/nullmailer/queue
     with permissions like so:

ls -l /var/nullmailer/queue/1402600668.28042 
-rw-rw---- 1 nullmail sender 410 Jun 12 16:00 /var/nullmailer/queue/1402600668.28042

That way nullmailer-send will actually send the message when invoked by sender.
Otherwise, sender must be root in order to send their message.

Expecting the message to be automagically sent is hopeless (that does not happen).
Comment 1 Justin Lecher (RETIRED) gentoo-dev 2014-06-14 19:07:47 UTC
I don't see the problem. I can send mails as a normal user with following groups

$ id justin
uid=2069(justin) gid=2069(justin) groups=2069(justin),10(wheel),18(audio),19(cdrom),27(video),35(games),80(cdrw),85(usb),100(users),101(colord),102(dropbox),250(portage),989(wireshark),992(realtime),998(vboxusers),2070(libvirt),2073(fw)


$ ll /usr/sbin/nullmailer-send
-rwxr-xr-x 1 root root 36K Mar 23 05:19 /usr/sbin/nullmailer-send*

It is already 755 so no need to go for grp=nullmail

ll /var/nullmailer/queue -d
drwxrwx--- 2 nullmail nullmail 4.0K Jun 14 21:02 /var/nullmailer/queue/

your directory has different permissions. Please check that first.
Comment 2 d. paddy 2014-06-21 11:23:28 UTC
The permissions are the same (and not the issue):
ll /usr/sbin/nullmailer-send
-rwxr-xr-x 1 root nullmail 39704 Jun 12 14:19 /usr/sbin/nullmailer-send

ll /var/nullmailer/queue -d
drwxrwx--- 2 nullmail nullmail 4096 Jun 19 09:07 /var/nullmailer/queue

The problem is messages get installed into the queue with permissions like so:
-rw------- 1 nullmail joe_user 411 Jun 21 06:57 1403348227.7046

Consequently, when joe_user attempts to send his mail...
joe_user> /usr/sbin/nullmailer-send
Rescanning queue.
Starting delivery, 1 message(s) in queue.
Can't open file '1403348227.7046'
Delivery complete, 1 message(s) remain.

...the result is that the message never gets sent:
joe_user> ls -l /var/nullmailer/queue
total 4
-rw------- 1 nullmail joe_user 411 Jun 21 06:57 1403348227.7046

However, if root changes permissions...
root> chmod 660 /var/nullmailer/queue/1403348227.7046
root> ls -l /var/nullmailer/queue
total 4
-rw-rw---- 1 nullmail joe_user 411 Jun 21 06:57 1403348227.7046

then when joe_user attempts to send his mail...
joe_user> /usr/sbin/nullmailer-send
Rescanning queue.
Starting delivery, 1 message(s) in queue.
Starting delivery: protocol: smtp host: smtp.gmail.com file: 1403348227.7046
smtp: Succeeded: 250 2.0.0 OK 1403349058 k66sm19384332yhg.39 - gsmtp
Sent file.
Delivery complete, 0 message(s) remain.

...the message does get sent:
joe_user> ls -l /var/nullmailer/queue
total 0

So joe_user cannot send his mail unless root changes permissions or root executes nullmailer-send or magic happens.  My conjecture is that magic happens for you, but not for me, since you can send mails as a normal user...

What does one do to enable such magic?
Comment 3 Justin Lecher (RETIRED) gentoo-dev 2014-07-06 11:29:03 UTC
Why don't you send your mails though /usr/bin/mail?
Comment 4 vose 2014-08-11 21:28:48 UTC
> Why don't you send your mails though /usr/bin/mail?

Not sure what you are getting at (it's been a long day, week, month, year...).

If you're hinting "don't use nullmailer, problem gone", then I suppose you have a point... but I'ld rather have nullmailer work without root intervention.

If you're hinting "here's a clue: getting things to work has something to do with /usr/bin/mail", then I (and others stumbling across this) do appreciate the hint... but explicit details would be nice ;)
Comment 5 Justin Lecher (RETIRED) gentoo-dev 2014-08-12 08:16:15 UTC
If you look for information on how to send mail from the shell on linux (e.g. google) you are getting pointed to a command named "mail". My question is, why don't you use this, but instead use nullmailer directly?