1829556 Members
1861 Online
109992 Solutions
New Discussion

Re: Sendmail

 
Choppa Kumar
Occasional Advisor

Sendmail

can some help me how to generate a script file to move the mails from queue to specified path automatically .
3 REPLIES 3
Senthilmurugan
Frequent Advisor

Re: Sendmail

Hello Choppa Kumar,

Use the following commands

#mkdir /tmp/mymailqueue
#mv /var/spool/mqueue/* /tmp/mymailqueue

This will move all your mail queue to the /tmp/mymailqueue Directory. You can also specify your own directory

Put it in the crontab.

#crontab -e


There you specify

30 10 * * * mv /var/spool/mqueue/* /tmp/mymailqueue


This will move the mail queue every day at 10:30 AM

Regards,
Senthil Murugan

Muthukumar_5
Honored Contributor

Re: Sendmail

Mail queues are stored on /var/spool/mqueue/* directory there. You can view the queued mail's as,

mailq

Try to move the content's /var/spool/mqueue directory to your path with script as,

mkdir 700 /tmp/mailqueue
while true;
do

mv /var/spool/mqueue/* /tmp/mailqueue/.

# sleep time for 10 hours
sleep 36000

done

or as simple use cronjob for this.

Easy to suggest when don't know about the problem!
Choppa Kumar
Occasional Advisor

Re: Sendmail

Thanks ton