Hello Keith, Great idea ! I kind of (when I can) maintain the msmtpq script ; if ok with you will add your code to msmtpq and give you credit ... I'm swamped and the moment, however, and won't be able to get to it for a week or two ...
Thanks again for the input. Best wishes, Chris On Sat 29.Jan'11 at 13:00:24 -0500, Keith BOWES wrote: > One feature that I've felt is lacking in the queueing script is that > there's no way to know how many messages are queued without counting > them. I know, maybe I'm just weird for actually wanting to know how > many messages are in the queue, but I wrote a patch for it. If you guys > find it useful, then by all means include it. If not, I guess I'll put > it somewhere where people can download and apply it themselves if they > want. > > -- > Keith Bowes <http://zooplah.farvista.net/> > --- msmtpq.old 2010-08-14 23:15:22.000000000 -0400 > +++ msmtpq 2011-01-24 12:12:03.000000000 -0500 > @@ -242,20 +242,22 @@ > else # queue is empty > dsp '' 'mail queue is empty (nothing to send)' '' # inform user > fi > } > > ## display queue contents > display_queue() { > local M LST="$('ls' $Q/*.mail 2>/dev/null)" # list of mails in queue > + message_index=0 > > if [ -n "$LST" ] ; then # list has contents (any mails in queue) > for M in $LST ; do # cycle through each > - dsp '' "mail id = [ $(basename $M .mail) ]" # show mail id > + message_index=$(expr $message_index + 1) > + dsp '' "${message_index}. mail id = [ $(basename $M .mail) ]" > # show mail id > 'egrep' -s --colour -h '(^From:|^To:|^Subject:)' "$M" # show mail info > done > echo > else # no mails ; no contents > dsp '' 'no mail in queue' '' # inform user > fi > } > > @@ -382,17 +384,17 @@ > log -e "$?" "creating mail body file [ ${FQP}.mail ] : failed" # test > for error > send_mail "$@" # send the mail if possible, queue it > if not > ;; > msmtpq) # called as 'msmtpq' - queue management > mode > OP=${1:1} # trim off first char of OP > case "$OP" in # sort ops ; run according to spec > r) lock_queue ; run_queue ;; # run (flush) the queue > R) lock_queue ; select_mail -send ;; # send individual mail(s) > in queue > - d|'') display_queue ;; # display (list) all mail > in queue (defaykt) > + d|'') display_queue ;; # display (list) all mail > in queue (default) > p) lock_queue ; select_mail -purge ;; # purge individual > mail(s) from queue > a) lock_queue ; purge_queue ;; # purge all mail in queue > h) usage ;; # show help > *) usage "[ $OP ] is an unknown msmtpq option" ;; > esac > ;; > *) # invalid name > err "msmtpq can only be called as 'msmtpq' or 'msmtpQ'"\ > ------------------------------------------------------------------------------ > Special Offer-- Download ArcSight Logger for FREE (a $49 USD value)! > Finally, a world-class log management solution at an even better price-free! > Download using promo code Free_Logger_4_Dev2Dev. Offer expires > February 28th, so secure your free ArcSight Logger TODAY! > http://p.sf.net/sfu/arcsight-sfd2d > _______________________________________________ > msmtp-users mailing list > [email protected] > https://lists.sourceforge.net/lists/listinfo/msmtp-users ------------------------------------------------------------------------------ Special Offer-- Download ArcSight Logger for FREE (a $49 USD value)! Finally, a world-class log management solution at an even better price-free! Download using promo code Free_Logger_4_Dev2Dev. Offer expires February 28th, so secure your free ArcSight Logger TODAY! http://p.sf.net/sfu/arcsight-sfd2d _______________________________________________ msmtp-users mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/msmtp-users
