<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN"> <HTML> <HEAD> <META NAME="GENERATOR" CONTENT="SGML-Tools 1.0.9"> <TITLE>Linux Mail-Queue mini-HOWTO: Delivering e-mail</TITLE> <LINK HREF="Mail-Queue-5.html" REL=next> <LINK HREF="Mail-Queue-3.html" REL=previous> <LINK HREF="Mail-Queue.html#toc4" REL=contents> </HEAD> <BODY> <A HREF="Mail-Queue-5.html">Next</A> <A HREF="Mail-Queue-3.html">Previous</A> <A HREF="Mail-Queue.html#toc4">Contents</A> <HR> <H2><A NAME="s4">4. Delivering e-mail</A></H2> <P>E-Mail delivery can be invoked by issuing the command "sendmail -q". For those who are interested in what sendmail actually does, "sendmail -q -v" will give a more verbose version of the delivery process. <P>It is very convenient to automate the process of e-mail delivery. A tool commonly used for this process is cron. <P> <H2><A NAME="ss4.1">4.1 How to have e-mail delivered at special times.</A> </H2> <P>Edit your crontab: <P> <BLOCKQUOTE><CODE> <PRE> crontab -e </PRE> </CODE></BLOCKQUOTE> <P>Add lines of the form: <P> <BLOCKQUOTE><CODE> <PRE> 05 18-23,0-7 * * Mon,Tue,Wed,Thu,Fri /usr/sbin/sendmail -q 05 * * * Sat,Sun /usr/sbin/sendmail -q </PRE> </CODE></BLOCKQUOTE> <P>Please refer to the crontab man page (available through "man 5 \ crontab") for further information. I think the format is pretty obvious. The example crontab entries shown above send e-mail (if, and only if, e-mail is available from the queue) 5 minutes after an hour on weekdays, starting at 6:05 pm, and stopping at 7:05 am. On weekends, e-mail is delivered 5 minutes after an hour, starting at 12:05 pm on Saturday, and stopping 11:05 pm on Sunday. <P>As a dial-on-demand user, it is sometimes desirable to have your system collect your e-mail via the POP3 protocol at certain times of the day. You could therefore add an entry similar to the following to your crontab: <P> <BLOCKQUOTE><CODE> <PRE> 0 21 * * * popclient -3 -u <your pop3 user name goes here> -p <put your password here> -o /var/spool/mail/<the user on your system that should receive the collected e-mail> <mailhost.somedomain.com> </PRE> </CODE></BLOCKQUOTE> <P>Of course, this should all go on a single line. <P>Then, save the file and leave the editor. The crontab should now be installed. <P> <P> <HR> <A HREF="Mail-Queue-5.html">Next</A> <A HREF="Mail-Queue-3.html">Previous</A> <A HREF="Mail-Queue.html#toc4">Contents</A> </BODY> </HTML>