Automatic measurement of the complex permittivity at millimeter wavelengths