procmail testing

Rick Stevens ricks at alldigital.com
Wed Jan 22 23:20:36 UTC 2014


On 01/22/2014 02:44 PM, Robert Moskowitz issued this missive:
>
> On 01/22/2014 02:09 PM, Ed Greshko wrote:
>> On 01/22/14 23:37, Robert Moskowitz wrote:
>>> So you are correct that the formail is needed, as the reader does not
>>> have a date to show on displaying the message.  It does use the date
>>> in the first 'From ' line for the list of messages, and that mislead
>>> me yesterday.
>>>
>>> But I am having a problem of how to specify this:
>>>
>>> CRONDARGS=-m "formail -a "Date: `date`" | /usr/bin/procmail -f cron"
>>>
>>> The quoting is wrong.  How do I get the quoting right for this arg list?
>>>
>> I would "cheat".
>>
>> I would put formail -a "Date: `date`" | /usr/bin/procmail -f cron in a
>> bash script called "mailme" in /usr/local/bin and then set
>>
>> CRONDARGS=-m /usr/local/bin/mailme
>>
>> Worked fine here....  Don't forget, of course, to make mailme executable.
>
> Works!  Thanks!
>
> I have one more item to work out.  It seems that on my servers, I have a
> timestamp in the email of when the cron job started, not ended.  This is
> interesting, as some of my cron jobs can take over an hour.  I have to
> look more into this before I can call success on this project.

If the cron job fires off a detached process (e.g. with a "nohup" or
"&" at the end), then as far as cron is concerned its job is done and
out goes the email.

You'd need to modify the job that cron runs to send out the email when
it's complete. Yes, it's bitten me in the past.
----------------------------------------------------------------------
- Rick Stevens, Systems Engineer, AllDigital    ricks at alldigital.com -
- AIM/Skype: therps2        ICQ: 22643734            Yahoo: origrps2 -
-                                                                    -
-          When all else fails, try reading the instructions.        -
----------------------------------------------------------------------


More information about the users mailing list