









|
[Date Prev][Date Next]
[Chronological]
[Thread]
[Top]
[NMLUG] automatic mail delete?
havoc wrote:
> I'm hoping to find a solution that I can have the server blow them away
> without ever downloading them from /var/spool/mail/user, which is a
> single file.
>
Well, mail files are single monolithic files containing all the messages
in a full mailbox. If you want to do this, you should use Maildir
delivery, which stores each message in a separate file, then use
find /home/scan/Maildir/{cur,new} -mtime -7 -print0 | xargs -0 rm
since maildir mail files have funny characters in their name that -exec
probably won't like very much.
However, this requires using mail servers that support maildir format.
Postfix definitely does, as does courier-IMAP, so i suggest those.
> This is for a mailbox I created called "scan" (which is short for "spam
> can), which I use for creating accounts on sites I would like to get
> information from, but not receive all of their junk mail.
>
> j
>
> Michael Maddex wrote:
>
>> If you are talking about separate user files, you could try something
>> like this:
>>
>> # find /var/spool/mail -mtime -X -exec rm {} \;
>>
>> where 'X' is your 'X days old' and '\;' is part of the syntax. You
>> can use the
>> '-i' or '-f' argument to 'rm' if appropriate. See man find for more
>> info.
>>
>> Hope this helps.
>>
>> havoc said:
>>
>>> what command would I run to delete messages older than X days old in my
>>> mail spool?
>>>
>>> thanks,
>>> jody
>
>
>
|
|