I'm running the Dovecot imap server with users and mailboxes managed by vpopmail and for various reasons I want to gradually move away from vpopmail but without losing the maildir++ storage structure for messages. The first issue is that vpopmail ...
‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ 

Click here to read this mailing online.

Your email updates, powered by FeedBlitz

 
Here is a sample subscription for you. Click here to start your FREE subscription


PatchLog"PatchLog" - 5 new articles

  1. Dovecot with vpopmail and lua authentication
  2. Create Windows 10 install USB from macOS Mojave
  3. DIY dynamic dns and ssl certificates
  4. Installing cordova fails
  5. Tevo Little Monster delta grid compensation
  6. More Recent Articles

Dovecot with vpopmail and lua authentication

I'm running the Dovecot imap server with users and mailboxes managed by vpopmail and for various reasons I want to gradually move away from vpopmail but without losing the maildir++ storage structure for messages.

 

The first issue is that vpopmail authentication in dovecot is not compiled in by default on the Debian packages so every time I upgrade I have to recompile the packages to support the vpopmail driver.

This post explains how to use the lua authentication with the vpopmail vpasswd files so we continue to use the same users and passwords without relying on the special dovecot vpopmail driver. If assumes your vpopmail installation is in /home/vpopmail , if it's somewhere else just change the location in the auth.lua file.

Disable the vpopmail authentication module in conf.d/10-auth.conf

Add /etc/dovecot/conf.d/auth-lua.conf.ext with this content:

passdb {
 driver = lua
 args = file=/etc/dovecot/auth.lua blocking=yes # default is yes
}
userdb {
 driver = lua
 args = file=/etc/dovecot/auth.lua blocking=yes # default is yes
}

Create /etc/dovecot/auth.lua with the following content:

local function isempty(s)
  return s == nil or s == ''
end

function auth_password_verify(req, pass)
 local str=req.user
 local lastAt = str:find("[^%@]+$")
 local localPart = str:sub(1, (lastAt - 2)) 
 local domainPart = str:sub(lastAt, #str)
 local file = "/home/vpopmail/domains/"..domainPart.."/vpasswd"

 for line in io.lines(file) do
  local u,epass=string.match(line,"([^%:]+):([^%:]+)");
  if not isempty(epass) and localPart==u and req:password_verify("{MD5-CRYPT}"..epass,pass)>0 then
   return dovecot.auth.PASSDB_RESULT_OK, {}
  end
 end
end

function auth_userdb_lookup(req)
 local str=req.user
 local lastAt = str:find("[^%@]+$")
 local localPart = str:sub(1, (lastAt - 2)) 
 local domainPart = str:sub(lastAt, #str)
 local file = "/home/vpopmail/domains/"..domainPart.."/vpasswd"
 for line in io.lines(file) do
  local u,epass=string.match(line,"([^%:]+):([^%:]*):");
  if localPart==u then
   return dovecot.auth.USERDB_RESULT_OK, "uid=vpopmail gid=vchkpw"
  end
 end
 return dovecot.auth.USERDB_RESULT_USER_UNKNOWN, "no such user"
end
    

Create Windows 10 install USB from macOS Mojave

If you want to install windows on your mac and you need s bootable usb stick with windows, here's how to do it. Please note, this is not for installing windows on other devices.

 

There is a solution using unetbootin , one with bootcamp assistant and one using mounting and manually copying files but none of them worked for me.

This solution worked for me in macOS High Sierra and Mojave and it will probably work on other versions.

First you have to convert the windows iso file to an img:

hdiutil convert -format UDRW -o windows.img windows.iso

The result of this would most likely be a file named widows.img.dmg. The next step is to unmount the usb disk ( diskutil list to see which one it is , in my case this was /dev/disk2 )

sudo diskutil unmountDisk /dev/disk2

Now just use dd to copy the image to the usb device:

sudo dd if=windows10.img.dmg of=/dev/disk2 bs=1m

    

DIY dynamic dns and ssl certificates

Use SFTdyn to host your own dynamic dns server. The github page describes the whole setup process so there's no point in going over it again.

 

This article will show you how you can create a free letsencrypt certificate for these dynamic domains without running a http server on them. ( in case you want to use them for something like a smtp service or a http server that's not supported by the certbot plugins ).

When setting up SFTdyn you configured bind to accept local updates. We'll use the same key for the certbot dns plugin so it can do dns challenges for creating and renewing certificates.

The certbot dns plugin needs a configuration file ( ~/.secrets/certbot/rfc2136.ini ) that looks like this:

# Target DNS server ( always use an ip address here )
dns_rfc2136_server = 12.34.56.78
# Target DNS port
dns_rfc2136_port = 53
# TSIG key name ( this has to be set to local-ddns ) 
dns_rfc2136_name = local-ddns
# TSIG key secret ( get this from the ddns server's /var/run/bind/session.key  ) 
dns_rfc2136_secret = splfUqpteoHQ43DDzGKvMS6L3oCjzv20WpKfhxhgWo0=
# TSIG key algorithm
dns_rfc2136_algorithm = HMAC-SHA256

The secret will probably change when you restart bind, so make sure to update the rfc2136.ini file after you do it. Or you can add the contents of the /var/run/bind/session.key file to the named.conf.local file and then change the key's name to something like "remote-key" and then also change the ~/.secrets/certbot/rfc2136.ini file to reflect the name of the new key so you don't have to bother to copy the key every time you restart bind.

When all this is set up just run :

certbot certonly --dns-rfc2136 --dns-rfc2136-credentials ~/.secrets/certbot/rfc2136.ini -d <my-domain-name>

    

Installing cordova fails

I've just set up a new computer (macOS) and when I tried to install cordova it failed. It looked like it was doing somthing for a suspiciouly short time and then it exit whitout any error.

It seems the problem was I was trying to install it from an app folder that contained a folder named cordova and although I was running "sudo npm install -g cordova" which is supposed to install it globally it didn't work. All it did was to link my app folder to /usr/local/lib/node_modules . After I removed the link and ran "npm install -g cordova" it installed correctly.

Note to self: next time you install cordova on a new computer make sure you don't do it from a place where there's already a "cordova" folder.

    

Tevo Little Monster delta grid compensation

Before you start the calibration check if you have the grid calibration enabled in the smoothieware config file:
My config has this:

#Example for the delta grid leveling strategy
leveling-strategy.delta-grid.enable true # Enable grid leveling
leveling-strategy.delta-grid.radius 140 # Grid radius in millimeters
leveling-strategy.delta-grid.size 29 # Grid size, must be an odd number

The bigger the grid size, the more points it will test and the longer will take.

Heat the printbed to the temperature you normally print with.

Do the grid calibration:

; home
G28

;bltouch alarm release
M280 PS10.6

; probe pin down
M280 S3

; set bed temp to 80C
M190 S80

; do delta calibration
G32

; save trim to sdcard
M500

; probe the grid and enable grid compensation
G31

; save the grid to sd card
M374

;To set the zero for the print head
;Make sure there is no left over material on the nozzle ( maybe heat and wipe it )
;go home
G28

;go close to Z=0
G0 Z1

; put a sheet of thin paper under the nozzle
; Then move the head ( using the printer controls ) until it presses on the paper sheet, until ; you feel the friction when you pull on the paper. This is the Z=0 point
; Use this point as the homing offest
M306 Z0

;save to SD card
M500

But even after all this it seems the prints are still not all right, so another option is to do some manual calibration of the hotbed using some springs. 

    

More Recent Articles


You Might Like

Safely Unsubscribe ArchivesPreferencesContactSubscribePrivacy