Home Forums OS X Server and Client Discussion Questions and Answers Fetchmailrc launchd configuration

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #377422
    atma
    Participant

    Greetings,

    I want to make launchd act like cron for my fetchmail and hence I’m trying to write my first launchd xml script. Although I’ve read a lot, apparently the task is proven a bit more difficult that I imagined.
    Given the fact that as a user I can run fetchmail through the command line with issues and get all my emails to $HOME/Mail/ for mutt to see, I decided to create a launchd xml startup file and place it on $HOME/Library/LaunchDaemons/ .

    So here is my script

    [code=xml]


    Disabled

    KeepAlive

    Label
    org.macports.fetchmail
    Program
    /usr/bin/fetchmail
    ProgramArguments

    –fetchmailrc=/Users/atma/.fetchmailrc
    –pidfile=/Users/atma/.fetchmail/fetchmail.pid
    –nodetach

    RunAtLoad
    [/code]

    This is the last xml file I’ve made. The prior one, which made more sense to me was with time interval. But it did not work either. All the files I create don’t work and when I load them I get the same string of errors:

    launchd[1123]: org.macports.fetchmail: exited with exit code: 1
    launchd[1123]: org.macports.fetchmail: 9 more failures without living at least 60 seconds will cause job removal

    and a weird bonjour error that I can’t replicate right now and I can’t find on syslog. Since I plan to write a few more launchd scripts… Can someone explain what am I missing here?

    Thanks in advance,

    regards

    #377427
    robinson
    Participant

    In my case I did it with 2 files. First I have /etc/fetchmailrc with[code]poll mail.yourprovider.com proto pop3
    user [email protected] password secret sslproto ” is user here[/code]
    and then the /Library/LaunchDaemons/info.fetchmail.launchd.plist with [code]info.fetchmail.launchd.plist
    sh-3.2# vim info.fetchmail.launchd.plist



    Disabled

    Label
    info.fetchmail.launchd
    ProgramArguments

    fetchmail
    -f
    /etc/fetchmailrc
    -d
    300

    RunAtLoad
    UserName
    admin
    [/code]

    It’s important that the UserName (in my case “admin”) is the owner of /etc/fetchmailrc

    #377428
    Violet
    Participant

    Hi Robinson….

    Can you give me a bit more info how you achieved this.??

    – File permissions…
    – Debugging…..

    Any help would be great.

    #377457
    robinson
    Participant

    I used Lingon http://sourceforge.net/projects/lingon/files/ for create the plist file. I cannot give you any advice because I don’t know much more about this by myself. Sorry.

Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.

Comments are closed