To the list as well...
-------- Forwarded Message -------- Subject: Re: archivemail default setup Date: Sat, 22 Oct 2016 13:00:00 +0000 From: Stephan Beck <sb...@secure.mailbox.org> Reply-To: sb...@secure.mailbox.org To: Mark Fletcher <mark2...@gmail.com> Hi Mark, Mark Fletcher: > Hello again > > A little while back I installed archivemail on Jessie, to delete mail > from my local mailbox when it is more than a month old. > > The command I am running is: > > archivemail --output-dir=/home/mark/Mail/ -d 31 --delete /var/mail/mark > > My mailbox is in /var/mail/mark. I didn't choose to put it there, that > is where it went when the system was installed. I am not sure if that is > thanks to the default settings of exim4, mutt, or something else. > > Now /var/mail is owned by root:mail and had access 775. /var/mail/mark > is owned by mark:mail and has permissions 660. > > Whenever I ran archivemail as mark, it was complaining that it did not > have write access to /var/mail (it wanted to write a lock file) and then > proceeded to say it was deleting 0 messages. > > The oldest messages in my mail folder are dated September 18th and as > such should have been deleted by now. They are not being because, I > suppose, of the failure to write the lock file. > > When I run archivemail as root it complains that I am not the owner of > the mailbox and refuses to do anything. You may use the setgid command option (on /var/mail) in order to achieve that any new file created there (and the directory /var/mail/mark is just a file like that) has its group ownership set to the group owner of the directory (which should be "mail") rather the group ownership of the file's creator. ls -l /var/mail (as root) chmod g+s /var/mail Then you have to add user mark to the mail group: (as root) adduser mark mail (effective upon next login) If you then start /usr/bin/archivemail as user mark (who as a member of the group "mail" has r/w access to all files in /var/mail/mark) it should have access to the files. > > It seems that if the mailbox is in the default out-of-the-box place then > archivemail can't use it properly. It seems like archivemail is > expecting my mailbox (its input) to be in a folder to which I will have > write access. It seems to me that a package should ship with default > assumptions that can be met by the other packages in the distro. > > Now, I have got away from the error by making /var/mail world-writable, > but I don't like that solution. Is there a better one? Will I have to > move my mailbox to a different location, eg my home directory, and if so > how do I safely do that in a way that won't break anything (I am using > exim4 and mutt and I don't know what other infrastructure might be > involved that would care, for example I keep hearing about something > called procmail but don't know if that is actually involved in handling > mail on my system) To see where the binary is located: echo $(which procmail) Yes, procmail is probably involved as Mail Delivery Agent (MDA), locally delivering the mail from the MTA (exim4) to your local mail account mark. You might check this setting in the appropriate exim4 conf file. My 2 cents Stephan