On 02/01/10 16:34, Tim wrote:
> I am trying to start kmail via cron but I can't get kmail to start, here is 
> what
> cron looks like
>
> Well here is a list of my cron jobs
>
> m...@titan:~$ crontab -l
> # Delete old thumbnails
> 0 1 * * 1 $find ~/.thumbnails -type f -atime +10 -exec rm {} \;
> # spam learn
> 5 1 11 * * sa-learn --showdots --ham --dir /home/mit/Mail/hants/cur
> # Spam learn
> 5 0 11 * * sa-learn --showdots --spam --dir /home/mit/Mail/spam/cur
> # Stop kmail
> 0 5 * * * killall -9 kmail
> # start kmail
> 15 5 * * * /usr/bin/kmail --check
> # This file was written by KCron. Copyright (c) 1999, Gary Meyer
> # Although KCron supports most crontab formats, use care when editing.
> # Note: Lines beginning with "#\" indicates a disabled task.
>
> On the start Kmail line I have tried the following wording
>
> kmail
> "kmail"
> 'kmail'
> /usr/bin/kmail
> kmail -caption "%c" %i %m (this is the command from the start menu kmail icon)
>
> Basicly kmail is killed at 5:00am everyday and I want kmail to start again at
> 5:15am everyday, but kmail won't start.
>
> I am using KDE 3.5.10 and Kmail 1.9.9 on Mepis 8 (Debian Lenny)
>
> The reason for this is that my PC runs 24\7 and I collect from several e-mail
> accounts, but sometime on of them goes awol and I won't get no mail through.
> But when I close down kmail or reboot and then restart kmail there is a deluge
> of mail from this particular box
>
> Any suggestion??
>
> Tim
>
>
>    
Hi Tim-

I was waiting for someone clever to answer, but they haven't, so I'll 
have a go.

Annoyingly for you, I'm going to say that I think you're trying to solve 
the wrong problem.  This route is going to be painful - firstly, 
starting an X11 program from cron and trying to attach it to the running 
server and the current session is going to be hard.  Also, killing kmail 
with -9 is likely to cause you problems in the future because it won't 
have time to clean up (a SIGHUP might be more friendly).

Ideally of course, one would try to debug why kmail is freezing. That's 
probably too hard to do on list and would be better done via a KDE 
specific forum.

One idea which occurred to me is that you could use fetchmail + maildrop 
to replace kmail as your MTA.  It looks like you're using a maildir++ 
format mailbox (often just called maildir).  I suspect this may be the 
default for kmail, but I haven't checked.  Can kmail be set to use a 
maildir without having instructions to fetch mail by POP3 or IMAP?  If 
so, fetchmail could fetch mail for you, and this can run as a daemon or 
from cron.  You can tell fetchmail to use maildrop as your MDA (delivery 
agent).  maildrop knows how to deliver mail to maildir and mbox, and has 
good filtering capability.  You could use procmail, but personally I 
think maildrop is a lot easier.

Googling for fetchmail + maildrop returns some useful hits.  Many setups 
will also have a full mail server like exim, qmail, postfix or 
whatever.  You can have this if you like (you may already have one?) but 
you don't need it - fetchmail + maildrop are sufficient.  Have a look at 
http://www.van-gils.org/~bas/misc/mail.php and note especially the part 
in the fetchmail setup:

     mda "/usr/bin/maildrop"

The nice thing about this would be that you could use any MUA (aka email 
program) that can access Maildir, e.g. mutt, evolution...

Hope some of that is useful.

John

-- 
Next meeting: Dorchester, Tuesday 2010-01-05 20:00
Dorset LUG: http://dorset.lug.org.uk/
Chat: http://www.mibbit.com/?server=irc.blitzed.org&channel=%23dorset
List info: https://mailman.lug.org.uk/mailman/listinfo/dorset

Reply via email to