On Tue, 12 May 2015 09:36:17 +0000
Alex PADOLY <apado...@padoly.besaba.com> wrote:

>  
> 
> Hi, 
> 
> Thank you for your answer, 
> 
> The messages are is a local mail
> spool.

Well, use "find", "grep" or any other tool as appropriate to locate the
file you want and delete it.

What are you trying to do, apart from delete a file? You need a way to
identify the message that you want to delete, eg by date/timestamp,
message content, etc. If the messages are stored in maildir or mh
format, then it is simply a question of locating the message you want
to delete by using the appropriate tool.

If you can identify it by timestamp, then "find" can do everything you
need. If you need to scan the contents to find, for instance, a certain
string in the message, then perl or grep could be useful.

Check out the GNU package "mailutils", maybe it can help you achieve
what you want to do. It has a tool called "readmsg", that can "extract
selected messages from a mailbox" - maybe that would be a good place to
start. It also has "movemail" -- "extract selected messages from a
mailbox", maybe it can delete as well as move - read the man page.

Oh, and please don't top post.

Petter

> Le 2015-05-12 09:18, Petter Adsen a écrit : 
> 
> > On Mon,
> 11 May 2015 16:58:09 +0000
> > Alex PADOLY <apado...@padoly.besaba.com>
> wrote:
> > 
> >> Hi, How I can do to delete message without use email
> client, more I would like to do that with cronjob.
> > 
> > That all depends
> on where the message in question is stored. It is
> > quite impossible to
> tell you more with this little context and
> > information.
> > 
> > The
> message could be in a local mail spool, like /var/mail, it could be
> > in
> a subdir of your home directory, it could be on a remote IMAP
> > server,
> or it could be stored in a database. These are just the first
> > things I
> can think of off the top of my head.
> > 
> > Petter
> 
>  


-- 
"I'm ionized"
"Are you sure?"
"I'm positive."

Attachment: pgpUH_VPC1RHk.pgp
Description: OpenPGP digital signature

Reply via email to