邮件删除脚本改进
哪位大侠帮忙看看这段脚本如果再进行优化的话该如何改进能提高执行效率呢?多谢多谢,不胜感激。
#!/bin/sh
#
if [ ! -d /home/mail/queue/mess ]
then
echo "exit"
exit
fi
cd /home/mail/queue
ls mess|while read msgdir
do
echo $msgdir
cd /home/mail/queue/mess/$msgdir
ls|while read ofl
do
fl=`head -20 $ofl | grep MAILER-DEAMON |grep -i From` \\并联分析,查找“来自发信人”“MAILER-DEAMON”的邮件
if [ x"$fl" != x ]
then
echo $ofl
if [ -f /home/mail/queue/info/$msgdir/$ofl ]
then
echo ----$ofl
rm -f $ofl
rm -f /home/mail/queue/info/$msgdir/$ofl
rm -f /home/mail/queue/remote/$msgdir/$ofl
rm -f /home/mail/queue/emsg/$msgdir/$ofl
rm -f /home/mail/queue/intd/$ofl
rm -f /home/mail/queue/pid/$ofl
rm -f /home/mail/queue/todo/$ofl
rm -f /home/mail/queue/bounce/$ofl
else
if [ -f /home/mail/queue/todo/$ofl ]
then
echo ----$ofl
rm -f $ofl
rm -f /home/mail/queue/info/$msgdir/$ofl
rm -f /home/mail/queue/remote/$msgdir/$ofl
rm -f /home/mail/queue/emsg/$msgdir/$ofl
rm -f /home/mail/queue/intd/$ofl
rm -f /home/mail/queue/pid/$ofl
rm -f /home/mail/queue/todo/$ofl
rm -f /home/mail/queue/bounce/$ofl
else
echo "reserve"
fi
fi
fi
done
done
exit
#!/bin/sh
#
if [ ! -d /home/mail/queue/mess ]
then
echo "exit"
exit
fi
cd /home/mail/queue
ls mess|while read msgdir
do
echo $msgdir
cd /home/mail/queue/mess/$msgdir
ls|while read ofl
do
fl=`head -20 $ofl | grep MAILER-DEAMON |grep -i From` \\并联分析,查找“来自发信人”“MAILER-DEAMON”的邮件
if [ x"$fl" != x ]
then
echo $ofl
if [ -f /home/mail/queue/info/$msgdir/$ofl ]
then
echo ----$ofl
rm -f $ofl
rm -f /home/mail/queue/info/$msgdir/$ofl
rm -f /home/mail/queue/remote/$msgdir/$ofl
rm -f /home/mail/queue/emsg/$msgdir/$ofl
rm -f /home/mail/queue/intd/$ofl
rm -f /home/mail/queue/pid/$ofl
rm -f /home/mail/queue/todo/$ofl
rm -f /home/mail/queue/bounce/$ofl
else
if [ -f /home/mail/queue/todo/$ofl ]
then
echo ----$ofl
rm -f $ofl
rm -f /home/mail/queue/info/$msgdir/$ofl
rm -f /home/mail/queue/remote/$msgdir/$ofl
rm -f /home/mail/queue/emsg/$msgdir/$ofl
rm -f /home/mail/queue/intd/$ofl
rm -f /home/mail/queue/pid/$ofl
rm -f /home/mail/queue/todo/$ofl
rm -f /home/mail/queue/bounce/$ofl
else
echo "reserve"
fi
fi
fi
done
done
exit
...全文
相关推荐
mailx邮件工具
**过滤和脚本支持**:`mailx`支持使用shell脚本或其他过滤器对邮件进行预处理或后处理,如使用`grep`、`awk`等工具筛选邮件。4.
python实现下载pop3邮件保存到本地
邮件命名方式:在最初的脚本中,邮件的命名方式是基于编号和文件大小的,这种命名方式不方便进行阅读和管理。为了改进这一点,作者尝试了基于发件人邮件地址进行命名的方法。4.
星原邮件列表程序 v3.0
**订阅者管理**:改进后的订阅系统可能允许用户更方便地添加、删除和管理订阅者,包括批量操作和导入导出功能。4.
SMTP、POP3收发邮件
**处理邮件**:可以执行DELE命令标记为删除,但实际删除通常在Quit命令执行时才发生。6. **断开连接**:最后使用QUIT命令结束会话并可能执行邮件的永久删除操作。
基于ASP的随缘网络邮件订阅系统ASP免费版.zip
例如,订阅信息可能会被存储在名为"subscribers"的表中,ASP脚本会用SQL语句来插入、更新或删除记录。


系统维护与使用区
