[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#5326: mailagent's file locking doesn't work; file permission wrong



Package: mailagent
Version: 3.44-6


1) /usr/bin/mailagent should be executable, so that you can type
   "mailagent -I" from the command line to get initial configuration,
   as the documentation suggests.

2) Mailagent fails to lock my system mailbox.  This causes delays.
   With logging level set to 20, the log is included below, along with
   other relevant information.

   I can get mailagent to work without errors if I change these empty
   variables (that is, set to '') in the mailagent script as follows:

------------- mailagent begin
# Want to lock mailboxes with flock ?
$lock_by_flock = 'true';

# Only use flock() and no .lock file
$flock_only = 'true';
------------- mailagent end


I do not understand file locking, and I have no idea whether this
allows less than the safest level of locking.  I just tried it and it worked.

  Here are the relevant permissions on the mailbox:

  drwxr-xr-x  12 root     root         1024 Aug 17 12:22 var/
  drwxr-xr-x  12 root     root         1024 Sep 19 14:59 spool/
  drwxrwsr-t   2 mail     mail         1024 Nov  7 20:42 mail/
  -rw-rw----   1 swift    mail         2332 Nov  7 23:06 swift

  Here is the information on the process that gives the log:

~> ps lxw
    F    UID   PID  PPID PRI NI  SIZE   RSS WCHAN      STAT TTY   TIME COMMAND
100000   501 10974 10973   2  0  3448  2932 sigsuspen  S     ?    0:01 perl -S mailagent /home/swift/.mailagent-stuff/spool/queue/qm10972 

Indeed, I have UID 501

~> more /etc/passwd | grep swift
swift:s7fyMl0qDrv4c:501:

Info on perl:

Source: perl
Version: 5.003-2

~> type perl
perl is /usr/local/bin/perl
~> ls -l /usr/local/bin/perl
lrwxrwxrwx   1 root     root           13 Jan 23  1996 /usr/local/bin/perl -> /usr/bin/perl*
~> ls -l /usr/bin/perl
-rwxr-xr-x   2 root     root       476742 Jul  1 13:58 /usr/bin/perl*


Finally, here is the mailagent log:

96/11/07 23:09:38 filter[10972]: performing additional checks on /home/swift/.mailagent
96/11/07 23:09:38 filter[10972]: checking directory /home/swift
96/11/07 23:09:38 filter[10972]: file /home/swift/.mailagent seems to be secure
96/11/07 23:09:38 filter[10972]: starting processing
96/11/07 23:09:38 filter[10972]: hostname is aleph
96/11/07 23:09:38 filter[10972]: reading mail
96/11/07 23:09:38 filter[10972]: got mail (452 bytes)
96/11/07 23:09:38 filter[10972]: mail in /home/swift/.mailagent-stuff/spool/queue/Tm.10972
96/11/07 23:09:38 filter[10972]: mailagent lock in /home/swift/.mailagent-stuff/spool/perl.lock
96/11/07 23:09:38 filter[10972]: QUEUED [qm10972] 452 bytes
96/11/08 04:09:40 mailagent[24]: got the right to process mail
96/11/08 04:09:40 mailagent[24]: building default rules
96/11/08 04:09:41 mailagent[24]: parsing mail
96/11/08 04:09:41 mailagent[24]: FROM Matthew Swift <swift@bu.edu>
96/11/08 04:09:41 mailagent[24]: ABOUT test
96/11/08 04:09:41 mailagent[24]: analyzing mail
96/11/08 04:09:41 mailagent[24]: in mode 'INITIAL' for ALL
96/11/08 04:09:41 mailagent[24]: selector 'All' on '<1,->', pattern '/^Subject: [Cc]ommand/'
96/11/08 04:09:41 mailagent[24]: matching '/^Subject: [Cc]ommand/' on 'All' (<1,->) was false
96/11/08 04:09:41 mailagent[24]: applied '/^Subject: [Cc]ommand/' on 'All' (<1,->) was false
96/11/08 04:09:41 mailagent[24]: rule #1: direct All failed
96/11/08 04:09:41 mailagent[24]: matching summary rule #1: failed
96/11/08 04:09:41 mailagent[24]: NOTICE no match, leaving in mailbox
96/11/08 04:09:41 mailagent[24]: XEQ (LEAVE)
96/11/08 04:09:41 mailagent[24]: starting LEAVE
96/11/08 04:09:41 mailagent[24]: starting SAVE /var/spool/mail/swift
96/11/08 04:10:21 mailagent[24]: WARNING could not lock /var/spool/mail/swift
96/11/08 04:10:21 mailagent[24]: WARNING was unable to get any lock on /var/spool/mail/swift
96/11/08 04:10:21 mailagent[24]: ERROR could not save mail in /var/spool/mail/swift
96/11/08 04:10:21 mailagent[24]: DUMPED in /var/spool/mail/swift
96/11/08 04:10:21 mailagent[24]: FILTERED [qm10972] 0 bytes
96/11/07 23:10:21 filter[10973]: mailagent ok
96/11/08 04:10:23 mailagent[24]: mailagent continues
96/11/08 04:10:23 mailagent[24]: mailagent exits

--
TO UNSUBSCRIBE FROM THIS MAILING LIST: e-mail the word "unsubscribe" to
debian-devel-REQUEST@lists.debian.org . Trouble? e-mail to Bruce@Pixar.com


Reply to: