LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (https://www.linuxquestions.org/questions/programming-9/)
-   -   bash script, for deleting a specefic mail (https://www.linuxquestions.org/questions/programming-9/bash-script-for-deleting-a-specefic-mail-134869/)

sn0wman 01-14-2004 05:55 PM

bash script, for deleting a specefic mail
 
Im on a big mail server, over 14000 users, sometimes i need to delete just one mail from a specefic account.

Is there any easy way to make a script for this in bash?. so i don't need to empty their whole emaildb.

Exim and sendmail are used for mail.

david_ross 01-15-2004 12:54 PM

Probably.

What format do you store messages in?

Under what criteria do you want to delete messages?

sn0wman 01-15-2004 03:40 PM

mbox

david_ross 01-15-2004 03:47 PM

Quote:

Originally posted by david_ross
Under what criteria do you want to delete messages?

sn0wman 01-15-2004 03:53 PM

oh sorry, didn read the whole past message ;))

Let's say customer X calls, "A mail is blocking all my other mails", the customer is behind 56k6 modem and the mail he's trying to get is about 7mb or more.

I already have tools to lookup wich ordernumber #1 #2 etc. the mail is, but now i wan't a easy way to delete it.

like a script

delmail analoguser2003 #4

all mboxes are under /var/mail/<user>/mail

david_ross 01-16-2004 01:32 PM

You don't really need a script - just run:
echo d 5 | mail -f /path/to/mbox

Where you want to delete message 5 from the mbox file "/path/to/mbox".

If it was me though I think I'd just tell the user to delete it without downloading the message.

sn0wman 01-16-2004 02:40 PM

Users are stupid :)

Thanks for the tip, i shall make an php gui for it, so our users can use that.

david_ross 01-16-2004 02:57 PM

Why not just get them to telnet to port 110?

If they are using windows (works under wine too) popcorn is a great gui email client program for this type of problem.

sn0wman 01-16-2004 06:20 PM

Well, i doubt they know what telnet is.


All times are GMT -5. The time now is 12:06 PM.