sonyboy.dk

Tools, tip, tricks and other stuff I might come up with

Archive for September, 2008

Mail seems to have lost account information

without comments

Repeated crashes may cause Mail to discard the current ~/Library/Preferences/com.apple.mail.plist preferences file and create a new one:

This file is where all the account settings are stored. As a result, all the non-.Mac account settings are lost. If you have a .Mac account, that account would appear to have been preserved because Mail would set it up automatically using the System Preferences > .Mac/MobileMe settings.

You may want to make a backup copy of the ~/Library/Mail folder first (e.g. by dragging it to the Desktop while holding the Option (Alt) key down), just in case something else goes wrong while trying to solve the problem. This is where Mail stores the mail on your computer.

Now, there are at least three ways to restore the account settings:

  1. Restore ~/Library/Preferences/com.apple.mail.plist from a backup if you have one. Mail shouldn’t be running while you do this.
  2. Set up your mail accounts again (you may want to quit Mail and trash the new com.apple.mail.plist first to start over). If given the option to import existing mailboxes or something like that, don’t. Just enter the account information and Mail will automagically rediscover the data in ~/Library/Mail/ when done. You’ll also have to re-configure some of the Mail > Preferences settings. For spam-related security reasons, the first thing you should do is go to Preferences > Viewing and disable Display remote images in HTML messages if it’s enabled.
  3. Mail may have renamed the old preferences file to com.apple.mail.plist.saved. If that’s the case, you may try trashing the newcom.apple.mail.plist and renaming the old com.apple.mail.plist.saved back to com.apple.mail.plist. Again, be sure Mail isn’t running while doing this. Given the circumstances, there exists the possibility that com.apple.mail.plist.saved became corrupt, but that often is not the case and the settings can usually be restored by just renaming the file back to com.apple.mail.plist.

As a side effect of re-creating com.apple.mail.plist, Mail might rename Outbox (which is where messages waiting to be sent are stored) toDelivered. The name of that mailbox is actually a misnomer, as it would contain messages (if any) that couldn’t be delivered for some reason. You can delete that mailbox if you wish.

Note: For those not familiarized with the ~/ notation, it refers to the user’s home folder. That is, ~/Library is the Library folder within the user’s home folder, i.e./Users/username/Library.

Written by Sonyboy

September 29th, 2008 at 9:39 pm

Posted in Mac

Tagged with , ,

NTP: Who is using my NTP server?

without comments

You can check which hosts are talking to your time server by using the monlist command of ntpdc, e.g. ntpdc -c monlist Please note that a maximum of 600 entries is supported with current versions of ntpdc. The protocol (or better: the contents of the return packets) used by ntpdc is not standardized, therefore it is recommended to only use ntpdc with a matching ntpd, i.e. both should have the same version number.

To get by this 600 entry limitation, many server operators run client statistics scripts, such as Wayne Schlitt’s ntp_clients and ntp_clients_stats scripts, which can be found at http://www.schlitt.net/scripts/ntp/index.html . They work very well, but can use quite a bit of system resources if your client counts are in the high thousands. Examples of these scripts in action can be found at:

ntpq -p

The character in the left margin indicates the fate of this peer in the clock selection process. The codes mean:

<sp> discarded due to high stratum and/or failed sanity checks;
“x” designated falsticker by the intersection algorithm;
“.” culled from the end of the candidate list;
“-” discarded by the clustering algorithm;
“+” included in the final selection set;
“#” selected for synchronization but distance exceeds maximum;
“*” selected for synchronization;
“o” selected for synchronization, PPS signal in use.

Written by Sonyboy

September 28th, 2008 at 11:36 pm

Posted in Tips and Tricks

Tagged with ,

Disable AppArmor

without comments

AppArmor is a security extension (similar to SELinux) that should provide extended security. In my opinion you don’t need it to configure a secure system, and it usually causes more problems than advantages (think of it after you have done a week of trouble-shooting because some service wasn’t working as expected, and then you find out that everything was ok, only AppArmor was causing the problem).

We can disable it like this:

/etc/init.d/apparmor stop
update-rc.d -f apparmor remove

Written by Sonyboy

September 28th, 2008 at 11:27 pm

Posted in Howto,Tips and Tricks

Tagged with , , ,