Archiv für die Kategorie ‘IT’

NexentaCore 3.0.1 is not configured out of the box to send mails through smtp.

All I want is to get notification mails from the NexentaCore box in case of failures etc., problem is I have to use an external smtp-server.

Being not a *nix guy I didn’t want to mess with sendmail / postfix / whatever.

Information on the web is very limited, so it was most trial & error to find an easy solution. At last I’m now a happy msmtp user. Big kuddos to fedoraswiss and his blog post which at last got me up & running.

Here are my steps to get it working on NexentaCore 3.0.1:

#First install the msmtp package

$ apt-get install msmtp

Note: As of today the msmtp package in the repository is rather old (1.4.13 in opposite to the official version 1.4.23) and lacks some features, f.e. „–tls-fingerprint“.

Create a config for msmtp, either globally or per-user. The following example is per-user, must be named „.msmtprc“ and placed in the users home folder:

$ cd ~
$ nano .msmtprc

.mstmprc’s content:

defaults
#Specify log path
logfile ~/.msmtp.log
tls on
account myaccount
host smtp.yourdomain.tld
from sender@yourdomain.tld
#my smtp server issues a cert with a different name, so I need to get rid of this
tls_certcheck off
tls_starttls on
auth on
user username
password your_secret_password

account default : myaccount

#smtp refuses to work if the rights on the .msmtprc file are not correct

$ chmod 600 ~/.msmtprc

To ease sending mails from the commandline (f.e. with cron) one can pipe mailx through msmtp. I do this because I didn’t find a satisfying way to enter the whole message on the commandline directly with msmtp. Specifying a file containing the message body is not an option for me.

Create or modify the file ~./mailrc to include the line

set sendmail="/usr/bin/msmtp"

Now you can send mails like this:

$ echo "this is the message body" | mailx -s "this is the subject line" receiver@somedomain.tld

GPO Preferences allow to create Power Plans for users including the action what to do on closing a notebooks lid. Lately I struggled to create two power plans – one with the lid action „sleep“ and one with the lid action „do nothing“ along with some other useful settings.

The GPO got applied correctly, but the lid actions were not set. Instead the lid actions were locked to „do nothing“ (even as Enterprise Admin). GPO Preference debug logging resulted in an error applying the preference:

[pid=0x22c,tid=0x84c] setPlanProperty [ hr = 0x800704ec "This program has been blocked by a group policy.

The exact message text might be different, as I translated the message from german.

Disabling all GPOs including the inherited ones didn’t help at all.
Playing around with powercfg.exe (resetting, changing SDDLs) didn’t help either.

The culprit was a registry key located under HKLM\Software\Policies, which had been introduced during our Windows 7 image build process some time ago. As soon as I deleted the key all GPO preferences got applied successfully and the lid actions are working.

The registry key is:
HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Power\PowerSettings\5CA83367-6E45-459F-A27B-476B1D01C936

The above GUID is „LIDACTION“. It should be sufficient to delete just the settings „DCSettingIndex“ and „ACSettingIndex“.

There’s an excellent document called „PMPolicy_Windows.docx“ from Microsoft on the web describing all power management features.

One of our roadwarriors called the other day explaining that the DFS shares are not connected when using VPN dialup. Connecting the DFS shares manually worked for all shares which the user currently uses in offline mode.
On the other hand synchronizing and going online with these shares was not possible for him while connected through VPN. Executing the domain logon script located at \\domain.tld\netlogon was not possible, as the path was not found with the error message „The account is not available“.

Solution:
Somehow the cached network credentials of the user got fuxored and instead of using the current credentials of the user, the system used the credentials from the cache to authenticate against the DCs, which obviously is doomed to fail.
Deleting all cached credentials of the user solved the problem immediately.

Recently a user called an reported his offline files functionality in Windows 7 was broken.
He could sync and switch between online and offline mode, but was not able to edit files in offline mode. Also he was not able to rename newly created files or folders on an offline share.

Upon further examination the properties of offline files showed available disk space of 999GB – which is just wrong, as the physical disk had a way lower size (300GB).
Clicking the „Change limits“ button did do nothing.

Here’s the solution:

1. Go to Control Panel – Sync Center
2. Click on „Manage Offline Files“
3. Click on „Deactivate offline files“
4. Reboot
5. Make yourself owner of the folder C:\WINDOWS\CSC. Apply to all subfolders and files.

I experienced several „Access denied“ errors during the ownership change, but that didn’t prevent the next steps from succeeding.

5. Delete the folder C:\WINDOWS\CSC.
6. Go to Control Panel – Sync Center
7. Click on „Manage Offline Files“
8. Click on „Activate offline files“
9. Reboot

Everything worked as expected after the reboot.  This should also work for Windows Vista.