0

I have a requirement (SpamAssassin 'training') to archive (or delete) two user's (users are junkmail and notjunkmail) inboxes at a given time every day if there is anything in them.

Can anyone help me with a script to do such a thing and where to put it and how to get launchd to fire it off at 6am every morning? I can figure out the launchd stuff; it's the moving of messages from inbox to, say, archive that is stumping me.

Script needs to run on the Server as these "users" will likely never log in.

Mac OS X Server 10.6 (soon to be upgraded to 10.7 if that matters)

Thanks!

Meltemi
  • 559
  • 2
  • 11
  • 23

2 Answers2

0

If you are running POP3 or IMAP for your server, getmail might solve your problem:

Configure it to fetch the mail from the IMAP server and put it into a folder which you can delete (or keep) afterwards.

Then call this from either a cron or launchd job at the desired time.

Sven
  • 97,248
  • 13
  • 177
  • 225
-1

Sounds like a job for Automater (in your Utilities folder)! I don't have a Mac any longer, so I can't help you any further, but Automator would be worth checking out!

Brett A.
  • 158
  • 9
  • Hmm, I think Automator needs the user to be logged in for the Applescript to run...and if run as, say, a logged in admin user it won't be able to "see" into other user's inboxes to move the messages around. But if someone knows how to make this work I'm open to suggestion. – Meltemi Nov 18 '11 at 19:33