Mail/Csh script/resend mail

Mail/Csh script/resend mail

Post by The Shriminat » Sun, 14 Jan 1996 04:00:00



I would appreciate deeply if anyone of you know if there is such
C-shell script which will hold off all the incoming mail from a
certain "From:" address sent to a user between 10:00 PM to 7:30 AM
(next day) and resend them back to the same user next day at 7:31 AM.

Bascically here's the flow:


  mv ~/mail/pending/mail.1 ~/mail/pending/mail.1+1      
  Save newmail to ~/mail/pending/mail.1
endif

Next I'll have another script which runs in cron, and looks for the
existence of the ~/mail/pending/mail.* and resends them back to the
$USER one by one till each of 'em is delivered when $TIME = 7:31 AM

Any pointers, sugegstions are most welcome and maybe sent to

Many Many Thanks.

--

 
 
 

Mail/Csh script/resend mail

Post by stanislav shalun » Sun, 14 Jan 1996 04:00:00




   [...]  C-shell script which will hold off all the incoming mail from a
   certain "From:" address sent to a user between 10:00 PM to 7:30 AM (next
   day) and resend them back to the same user next day at 7:31 AM.

I would make procmail store incoming mail (under arbitrarily complex
conditions) onto an mh folder, then all cron script will do is trivial

foreach message in (/that/mh/folder/*)
        cat $message | /usr/lib/sendmail -oi -t
        rm -f $message
end

(you should check for errors before unlinking files with email!).

Will that work?  Any caveats?  I think that using mh folders simplifies
life greatly here: no locking necessary.
--

PGP key fingerprint = 62367EA3D4D01D88E021F40A0D938E12 | public key on www page
Opinions that might have been represented here are just mine, not anyone else's