Newsroom Update

Beginning in May, a special Today at Apple series titled “Made for Business” will offer small business owners and entrepreneurs free opportunities to learn how Apple products and services can support their growth and success. Learn more >

Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

Lion Server fetchmailconfig Error

Hello



I have a Problem with the Lion Server. There is the same Problem on each Lion Server installation.


When I start fetchmailconfig on Lion Server I become an error messages.


Error:


/usr/bin/python: can't open file '/fetchmailconf.py': [Errno 2] No such file or directory


On Mac OS X Snow Leo Server fetchmailconfig works fine.

Is there a way to repair that error?



Regards

Florian

Posted on Aug 5, 2011 3:04 AM

Reply
7 replies

Sep 2, 2011 4:21 AM in response to Florian Kriener

Florian,


Before I begin typing out the reason of this post, let me just start off by saying that less than 24 hours ago, I knew absolutely nothing about Unix systems, barely knew that Python was a programming language and was still trying to figure out exactly what Fetchmail is (the latter still applies tbh).


After a lot of googling, a ridiculous amount of frustration and even more nail biting, I FINALLY got it to work. Turns out that the version of Fetchmail that comes with OS Lion Server is 6.3.18, has a known bug. Therefore, it produces the following error:


/usr/bin/python: can't open file '/fetchmailconf.py': [Errno 2] No such file or directory


Google found me a lot of bug reports on this issue. However, all bug reports were on a variety of different Linux systems where the files are located in different folders (as far as I could understand). Anyway, To overcome this error, I simply downloaded the latest version of Fetchmail, took the file "fetchmailconf.py" and placed it in /usr/bin/ on my computer. After running fetchmailconf (not to be confused with the one ending with .py) I got another error:


Traceback (most recent call last):

File "/usr/bin/fetchmailconf.py", line 2103, in <module>

hostname = socket.gethostbyaddr(socket.gethostname())[0]

socket.herror: [Errno 1] Unknown host


Even more googling and I discovered that it has to do with the local host not being set because I'm on a private network.


Fix: Go to /etc/hosts and add your local (internal) IP address.


Run fetchmailconf again from Terminal and you're good to go.


Should you have any problems, drop me a line on niklas [att] garphult dot com.


Good luck!

Sep 7, 2011 4:37 AM in response to Florian Kriener

Just realized I forgot one step. In the fetchmailconf file, change the second line to:


exec /usr/bin/python /usr/bin/fetchmailconf.py "$@"


However... Since configuring Fetchmail (which was surprisingly easy with the Python UI) I have spoken to Apple's support because I had other issues with the server. After installing some sort of logging script that was sent to the Apple technician I spoke to, he informed me that Fetchmail had screwed up Dovecot. He therefore suggested that I'd re-install Lion Server, which I also did. I'm now back on square 1 again, terrified of touching Fetchmail again.


If you properly get Fetchmail working with the Mail service, then please let me know. I'm mentally preparing to achieve this the real way...

Feb 1, 2012 9:59 PM in response to niklasfromstockholm

I had the same issue, and now after some digigng I have the answer.


As you have found the the issue is that fecthmailconf.py is not in the right place (or even on the disk for 10.7.2), and if you look at the script fecthmailconf it pretty much tells you as much since the reference is to fetchmail.py being located at root i.e. exec /usr/bin/python /fetchmailconf.py "$@" = WRONG!.


I copied a version from the web and placed in the directory and it didn't work and showed the same error that you exposed. I suspect the .py file and the 6.3.18 are not matched version of the files required.


What I did was download fetchmail source (6.3.21) & installed the latest version of xcode.


I then cd to the directory I had downloaded and uncompressed the source to and typed the following at the command prompt. (these instructions in long form are in the INSTALL text file with the source)


>$ ./configure --with-ssl

>$ make


This built a new version of fecthmail


>$ sudo make install

This installed the files, however. This caused a issue in that the new version of fetchmail and fecthmailconf where not copied to /usr/bin so i did the following


>$ sudo cp fetchmail /usr/bin/fetchmail

>$ sudo cp fetchmail /usr/bin/fetchmailconf


Then everything worked fine with fetchmailconf.


[That said, I did find that creating my .fetchmailrc and then before calling fecthmail you actually type fetchmail -V at the prompt. fetchmail will tell you how it will interpret the file and gives an indication if you have gone wrong or made a syntax error]


[NOTE: if you want all the features in fetchmail that Apple ship you need to add --with-gssapi --with-kerberos to configure command (if you are not using it though it does not matter) ]

Lion Server fetchmailconfig Error

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple ID.