Sendmail problem

Use this forum for questions regarding installation, upgrading and configuration of OpenEMM

Moderator: moderator

Dittrich
Posts: 11
Joined: Fri Aug 18, 2006 12:29 pm
Location: Germany

Sendmail problem

Post by Dittrich »

Hi there,

I installed OpenEMM successfully but I am not able to send any mails. The mail log says:

Code: Select all

localhost sendmail[15355]: k7IBK70Z015355: SYSERR(root): gatherq: cannot open "/home/openemm/var/spool/ADMIN": Operation not permitted
The sendmail process is running as root (as expected) and the whole /home/openemm directoy tree is world read and writeable. Sendmail is not running chrooted.

Can you give me any hints on where the problem might be located.

EDIT: my system is SuSe Linux 10.1, I installed the latest tarball.

Thanks in advance
TD
ud
Posts: 154
Joined: Thu Aug 17, 2006 9:56 am
Location: Munich, Germany
Contact:

Post by ud »

Does the directory exist? (ls -ld /home/openemm/var/spool/ADMIN)
Is it accessable? (cd /home/openemm/var/spool/ADMIN)
Is there any error/warning during startup of OpenEMM?

If this does not help, feel free to post again!

-- ud
Dittrich
Posts: 11
Joined: Fri Aug 18, 2006 12:29 pm
Location: Germany

Post by Dittrich »

ud wrote:Does the directory exist? (ls -ld /home/openemm/var/spool/ADMIN)
Is it accessable? (cd /home/openemm/var/spool/ADMIN)
Is there any error/warning during startup of OpenEMM?

Code: Select all

# ls -ld /home/openemm/var/spool/ADMIN
drwxrwxrwx 2 openemm openemm 4096 2006-08-18 16:09 /home/openemm/var/spool/ADMIN
# cd /home/openemm/var/spool/ADMIN
# pwd
/home/openemm/var/spool/ADMIN
EDIT: partent dirs of this all have chmod 755 set (unchanged from tarball).

Starting OpenEMM brings the following:

Code: Select all

# OpenEMM.sh start
Start /home/openemm/bin/scripts/bav-update.py .. done.
Start /home/openemm/bin/scripts/bav-trigger.py .. done.
Start /home/openemm/bin/scripts/bavd.py .. done.
Start /home/openemm/bin/bav -L INFO .. done.
Start /home/openemm/bin/scripts/update.py bounce account .. done.
Start /home/openemm/bin/scripts/pickdist.py .. done.
Stopping obsolete sendmail processes:   done.
Starting sendmails:   listener  client queue Warning: Cannot use HostStatusDirectory = .hoststat: No such file or directory
 admin queue Warning: Cannot use HostStatusDirectory = .hoststat: No such file or directory
 mail queue Warning: Cannot use HostStatusDirectory = .hoststat: No such file or directory
 done.
Start /home/openemm/bin/scripts/slrtscn.py .. done.
Resin httpd start at Fri Aug 18 16:17:48 CEST 2006
Content of /var/log/mail produces by this startup:

Code: Select all

Aug 18 16:17:48 localhost sendmail[23435]: starting daemon (8.13.6): queueing@00:15:00
Aug 18 16:17:48 localhost sendmail[23436]: k7IEHmtl023436: SYSERR(root): gatherq: cannot open "/home/openemm/var/spool/QUEUE": Operation n
ot permitted
Aug 18 16:17:48 localhost sendmail[23435]: unable to write pid to /var/run/sendmail.pid: file in use by another process
Aug 18 16:18:48 localhost sendmail[23519]: k7IEImWq023519: SYSERR(root): gatherq: cannot open "/home/openemm/var/spool/ADMIN": Operation n
ot permitted
The last error message then is scrolling over and over in the log.

The program smctrl has rights as described in the install document...

Code: Select all

# ls -l /home/openemm/bin/smctrl
-rwsr-sr-x 1 root root 9620 2006-08-03 13:38 /home/openemm/bin/smctrl
.. and the sendmail processes are started as root:

Code: Select all

root     23426  0.0  0.1   6380  1932 ?        Ss   16:17   0:00 sendmail: accepting connections
root     23429  0.0  0.1   6032  1688 ?        Ss   16:17   0:00 sendmail: Queue runner@00:05:00 for /var/spool/clientmqueue
root     23432  0.0  0.1   6040  1688 ?        Ss   16:17   0:00 sendmail: Queue runner@00:01:00 for /home/openemm/var/spool/ADMIN        
root     23435  0.0  0.1   6032  1684 ?        Ss   16:17   0:00 sendmail: Queue runner@00:15:00 for /home/openemm/var/spool/QUEUE        
ud
Posts: 154
Joined: Thu Aug 17, 2006 9:56 am
Location: Munich, Germany
Contact:

Post by ud »

Looks good so far, up to ...
Dittrich wrote: Starting OpenEMM brings the following:

Code: Select all

# OpenEMM.sh start
Start /home/openemm/bin/scripts/bav-update.py .. done.
Start /home/openemm/bin/scripts/bav-trigger.py .. done.
Start /home/openemm/bin/scripts/bavd.py .. done.
Start /home/openemm/bin/bav -L INFO .. done.
Start /home/openemm/bin/scripts/update.py bounce account .. done.
Start /home/openemm/bin/scripts/pickdist.py .. done.
Stopping obsolete sendmail processes:   done.
Starting sendmails:   listener  client queue Warning: Cannot use HostStatusDirectory = .hoststat: No such file or directory
 admin queue Warning: Cannot use HostStatusDirectory = .hoststat: No such file or directory
 mail queue Warning: Cannot use HostStatusDirectory = .hoststat: No such file or directory
 done.
Start /home/openemm/bin/scripts/slrtscn.py .. done.
Resin httpd start at Fri Aug 18 16:17:48 CEST 2006
Have you made the changes to sendmail as described in INSTALL (chapter 5) file? Please make sure, that there is a line:

Code: Select all

undefine(`confHOST_STATUS_DIRECTORY')dnl
in your /etc/mail/linux.mc file. If you have changed the file, please follow the further steps for sendmail modifications!

If this doesn't help, you can try gather details on what sendmail is doing by using

Code: Select all

strace -p 23435 -o /tmp/sendmail.log
(replace 23435 with the current PID of running sendmail on ADMIN or QUEUE queue.)

You can stop strace after a while and look at the created logfile (or copy relevant information to a followup post :D )

-- ud
Dittrich
Posts: 11
Joined: Fri Aug 18, 2006 12:29 pm
Location: Germany

Post by Dittrich »

Hmmm okay I must confess I didn't do any of these changes as they are titled:
To use the dynamic bounce management system of OpenEMM, some modifications are required by the superuser: :?

And for first test I did not need the dynamic bounce management.

I'll do that immediately and report the changes.
Dittrich
Posts: 11
Joined: Fri Aug 18, 2006 12:29 pm
Location: Germany

Post by Dittrich »

Result: this got me rid of the "Warning: Cannot use HostStatusDirectory = .hoststat: No such file or directory" message.

Still the error in the mail log remains :(

Code: Select all

Aug 18 17:21:28 localhost sendmail[26487]: k7IFLS1t026487: SYSERR(root): gatherq: cannot open "/home/openemm/var/spool/ADMIN": Operation not permitted
Dittrich
Posts: 11
Joined: Fri Aug 18, 2006 12:29 pm
Location: Germany

Post by Dittrich »

Sorry for the posting flood :? and before I forget it:
Thanks ud for your help!

strace yields the following result (these are the lines I consider relevant, maybe some more information is needed, if so please tell me.)

Code: Select all

26400 clone(child_stack=0, flags=CLONE_CHILD_CLEARTID|CLONE_CHILD_SETTID|SIGCHLD, child_tidptr=0xb7ae46f8) = 26734
[...]
26734 open(".", O_RDONLY|O_NONBLOCK|O_LARGEFILE|O_DIRECTORY) = -1 EPERM (Operation not permitted)
As far as I can see the clone should produce another root process, right? So why doesn't it have permission to open the dir?

EDIT: homes are not mounted or something, just my plain workstation with SuSe out of the box.
ud
Posts: 154
Joined: Thu Aug 17, 2006 9:56 am
Location: Munich, Germany
Contact:

Post by ud »

This looks strange to me. May I ask you to do some more steps in hope to find the problem?

1.) Have a look in your sendmail spool directories:

Code: Select all

ls -la /home/openemm/var/spool/ADMIN
ls -la /home/openemm/var/spool/QUEUE
ls -la /var/spool/mqueue
ls -la /var/spool/clientqueue
2.) Start (again) sendmail with strace using this command as root:

Code: Select all

strace -s 256 -o /tmp/sendmail.log /usr/sbin/sendmail -OQueueDirectory=/home/openemm/var/spool/QUEUE -q
Gzip the resulting logfile and send it please to support(at)openemm.org

TIA,
-- ud
ud
Posts: 154
Joined: Thu Aug 17, 2006 9:56 am
Location: Munich, Germany
Contact:

Post by ud »

After some mailexchange, Mr. Dittrich found the solution, thanks here for this description! To enable sendmail access to the OpenEMM directories on a SuSE system using AppArmor edit the file /etc/apparmor.d/usr.sbin.sendmail and add these lines:

Code: Select all

  /home/openemm/var/spool/ADMIN            rwl,
  /home/openemm/var/spool/ADMIN/*          rwl,
  /home/openemm/var/spool/QUEUE/           rwl,
  /home/openemm/var/spool/QUEUE/*          rwl, 
then start /etc/init.d/boot.apparmor reload to activate these changes.

-- ud
Post Reply