Globally override package virtualbox guest additions (even in NixOS modules) - nix

Adding virtualisation.virtualbox.guest.enable = true; to the /etc/nixos/configuration.nix adds the VirtualBox Guest Additions to the resulting NixOS system, and creates a systemd service to run the VBoxService executable.
I want to use a different version of the guest additions than the one which "ships" with the current channel / nixpkgs.
So I tried to overwrite the package in configuration.nix using nixpkgs.config.packageOverwrites:
nixpkgs = {
config = {
allowUnfree = true;
packageOverrides = xpkgs: {
linuxPackages = xpkgs.linuxPackages //
(
let vbox = xpkgs.callPackage ./vbox-guest.nix { kernel = xpkgs.linuxPackages.kernel; };
in
{
virtualboxGuestAdditions = vbox;
kernel = xpkgs.linuxPackages.kernel // {virtualboxGuestAdditions = vbox;};
}
);
};
};
};
This builds the new Guest Additions package, but does not use it in any way (nix-store --query --referrers /nix/store/NEW-VBOX-GUEST-ADDS-PATH shows no referrers); the "shipped" version is still used by both the systemd service as well as the environment packages.
Even providing the "overwrite" directly when selecting the boot.kernelPackages does not work:
boot.kernelPackages = pkgs.linuxPackages //
(
let vbox = pkgs.callPackage ./vbox-guest.nix { kernel = pkgs.linuxPackages.kernel; };
in
{
virtualboxGuestAdditions = vbox;
kernel = pkgs.linuxPackages.kernel // {virtualboxGuestAdditions = vbox;};
}
);
Putting the overwrite into ~/.nixpkgs/config.nix or /root/.nixpkgs/config.nix doesn't help either.
How can I change which package is used without manually "rewriting" the nixos module which provides this ...guest.enable setting?

Related

Saxon CS: transform.doTransform cannot find out file from first transformation on windows machine but can on mac

I am creating an azure function application to validate xml files using a zip folder of schematron files.
I have run into a compatibility issue with how the URI's for the files are being created between mac and windows.
The files are downloaded from a zip on azure blob storage and then extracted to the functions local storage.
When the a colleague runs the transform method of the saxon cs api on a windows machine the method is able to run the first transformation and produce the stage 1.out file, however on the second transformation the transform method throws an exception stating that it cannot find the file even though it is present on the temp directory.
On mac the URI is /var/folders/6_/3x594vpn6z1fjclc0vx4v89m0000gn/T and on windows it is trying to find it at file:///C:/Users/44741/AppData/Local/Temp/ but the library is unable to find the file on the windows machine even if it is moved out of temp storage.
Unable to retrieve URI file:///C:/Users/44741/Desktop/files/stage1.out
The file is present at this location but for some reason the library cannot pick it up on the windows machine but it works fine on my mac. I am using Path.Combine to build the URI.
Has anyone else ran into this issue before?
The code being used for the transformations is below.
{
try
{
var transform = new Transform();
transform.doTransform(GetTransformArguments(arguments[Constants.InStage1File],
arguments[Constants.SourceDir] + "/" + schematronFile, arguments[Constants.Stage1Out]));
transform.doTransform(GetTransformArguments(arguments[Constants.InStage2File], arguments[Constants.Stage1Out],
arguments[Constants.Stage2Out]));
transform.doTransform(GetFinalTransformArguments(arguments[Constants.InStage3File], arguments[Constants.Stage2Out],
arguments[Constants.Stage3Out]));
Log.Information("Stage 3 out file written to : " + arguments[Constants.Stage3Out]);;
return true;
}
catch (FileNotFoundException ex)
{
Log.Warning("Cannot find files" + ex);
return false;
}
}
private static string[] GetTransformArguments(string xslFile, string inputFile, string outputFile)
{
return new[]
{
"-xsl:" + xslFile,
"-s:" + inputFile,
"-o:" + outputFile
};
}
private static string[] GetFinalTransformArguments(string xslFile, string inputFile, string outputFile)
{
return new[]
{
"-xsl:" + xslFile,
"-s:" + inputFile,
"-o:" + outputFile,
"allow-foreign=true",
"generate-fired-rule=true"
};
}```
So assuming the intermediary results are not needed as files but you just want the result (I assume that is the Schematron schema compiled to XSLT) you could try to run XSLT 3.0 using the API of SaxonCS (using Saxon.Api) by compiling and chaining your three stylesheets with e.g.
using Saxon.Api;
string isoSchematronDir = #"C:\SomePath\SomeDir\iso-schematron-xslt2";
string[] isoSchematronXslts = { "iso_dsdl_include.xsl", "iso_abstract_expand.xsl", "iso_svrl_for_xslt2.xsl" };
Processor processor = new(true);
var xsltCompiler = processor.NewXsltCompiler();
var baseUri = new Uri(Path.Combine(isoSchematronDir, isoSchematronXslts[2]));
xsltCompiler.BaseUri = baseUri;
var isoSchematronStages = isoSchematronXslts.Select(xslt => xsltCompiler.Compile(new Uri(baseUri, xslt)).Load30()).ToList();
isoSchematronStages[2].SetStylesheetParameters(new Dictionary<QName, XdmValue>() { { new QName("allow-foreign"), new XdmAtomicValue(true) } });
using (var schematronIs = File.OpenRead("price.sch"))
{
using (var compiledOs = File.OpenWrite("price.sch.xsl"))
{
isoSchematronStages[0].ApplyTemplates(
schematronIs,
isoSchematronStages[1].AsDocumentDestination(
isoSchematronStages[2].AsDocumentDestination(processor.NewSerializer(compiledOs)
)
);
}
}
If you only need the compiled Schematron to apply it further to validate an XML instance document against that Schematron you could even store the Schematron as an XdmDestination whose XdmNode you feed to XsltCompiler e.g.
using Saxon.Api;
string isoSchematronDir = #"C:\SomePath\SomeDir\iso-schematron-xslt2";
string[] isoSchematronXslts = { "iso_dsdl_include.xsl", "iso_abstract_expand.xsl", "iso_svrl_for_xslt2.xsl" };
Processor processor = new(true);
var xsltCompiler = processor.NewXsltCompiler();
var baseUri = new Uri(Path.Combine(isoSchematronDir, isoSchematronXslts[2]));
xsltCompiler.BaseUri = baseUri;
var isoSchematronStages = isoSchematronXslts.Select(xslt => xsltCompiler.Compile(new Uri(baseUri, xslt)).Load30()).ToList();
isoSchematronStages[2].SetStylesheetParameters(new Dictionary<QName, XdmValue>() { { new QName("allow-foreign"), new XdmAtomicValue(true) } });
var compiledSchematronXslt = new XdmDestination();
using (var schematronIs = File.OpenRead("price.sch"))
{
isoSchematronStages[0].ApplyTemplates(
schematronIs,
isoSchematronStages[1].AsDocumentDestination(
isoSchematronStages[2].AsDocumentDestination(compiledSchematronXslt)
)
);
}
var schematronValidator = xsltCompiler.Compile(compiledSchematronXslt.XdmNode).Load30();
using (var sampleIs = File.OpenRead("books.xml"))
{
schematronValidator.ApplyTemplates(sampleIs, processor.NewSerializer(Console.Out));
}
The last example writes the XSLT/Schematron validation SVRL output to the console but could of course also write it to a file.

Nix Flake: how to accept the Android SDK License

I'm trying to use nix flakes for android development.
This is my flake.nix:
{
description = "test";
outputs = { self, nixpkgs }: {
packages.x86_64-linux.hello = nixpkgs.legacyPackages.x86_64-linux.hello;
devShell.x86_64-linux = nixpkgs.legacyPackages.x86_64-linux.mkShell {
buildInputs = [
nixpkgs.legacyPackages.x86_64-linux.androidenv.androidPkgs_9_0.androidsdk
];
};
};
}
Running nix develop gives me this message:
You must accept the following licenses:
- android-sdk-license
by setting nixpkgs config option 'android_sdk.accept_license = true;'.
How can I pass this option to nixpkgs when using flakes?
legacyPackages does not let you pass config. You have to call Nixpkgs yourself:
outputs = { self, nixpkgs, ... }:
let pkgs = import nixpkgs {
system = "x86_64-linux";
config = {
android_sdk.accept_license = true;
};
};
in { /* ... */ pkgs.androidenv.androidPkgs_9_0.androidsdk
# ...

How to pass nixpkgs.config.allowUnfree to local nixpkgs repository

I want to use hubstaff package from local nixpkgs repository,
let
# pass config so that packages use correct allowUnfree for example
nixpkgs-local = import /home/bjorn/projects/nixpkgs { inherit config; };
in
rec {
config.allowUnfree = true;
config.packageOverrides = old: {
# packages from local nixpkgs
inherit (nixpkgs-local) safeeyes hubstaff;
....
but its unfree package, so throws unfree package error
$ sudo nixos-rebuild dry-build
building the system configuration...
error: Package ‘hubstaff-1.3.1-ff75f26’ in /home/bjorn/projects/nixpkgs/pkgs/applications/misc/hubstaff/default.nix:60 has an unfree license (‘unfree’), refusing to evaluate.
As I understand I need to pass nixpkgs.config.allowUnfree = true, but import /home/bjorn/projects/nixpkgs { inherit config; }; above is not working
P.S.
other issue I have is that I have tried to peek what value I am passing in config.nixpkgs.allowUnfree here
{ config, pkgs, lib, ... }:
let r = {
imports = [
./hardware-configuration.nix
./hardware-configuration-override.nix
./hardware-programs.nix
/home/bjorn/projects/nixpkgs/nixos/modules/services/misc/safeeyes.nix
];
....
};
in
builtins.seq (lib.debug.showVal config.nixpkgs.allowUnfree) r
but I get infinite recursion error, maybe someone knows the way to do this?
To answer your second "P.S." question, here's the reason why and suggestions what to do instead.
The infinite recursion occurs because the module system needs to evaluate the 'root' of every module and some attributes like imports in order to build the term that represents the root of config.
With your call to seq you're evaluating an attribute of config at a point where config itself is still being evaluated.
Technically, you can solve this by adding your seq call to an attribute instead of around the entire module. This way, config can be evaluated without evaluating your seq call.
Probably an easier way to have a look at your configuration is to import it in nix repl
nix-repl> c = import <nixpkgs/nixos> { configuration = ./nixos/root/default.nix; /* or the file usually called configuration.nix */ }
nix-repl> c.config.nixpkgs.config.allowUnfree
true
You can use the :r command to reload all files when iterating. Nix likes to cache them because the implementation is geared toward batch execution.
Tnx to tilpner
I was passing wrong config
Namely,
this is config that import /home/bjorn/projects/nixpkgs was expecting
nix-repl> c = import <nixpkgs/nixos> {}
nix-repl> c.config.nixpkgs
{ config = { ... }; overlays = [ ... ]; pkgs = { ... }; system = "x86_64-linux"; }
This is what I was passing
nix-repl> c.config
{ _module = { ... }; assertions = [ ... ]; boot = { ... }; config = { ... }; containers = { ... }; dysnomia = { ... }; ec2 = { ... }; environment = { ... }; fileSystems = { ... }; fonts = { ... }; gnu = false; hardware = { ... }; i18n = { ... }; ids = { ... }; jobs = «error: The option `jobs' is used but not defined.»; kde = { ... }; krb5 = { ... }; lib = { ... }; meta = { ... }; nesting = { ... }; networking = { ... }; nix = { ... }; nixpkgs = { ... }; passthru = «error: The option `passthru' is used but not defined.»; power = { ... }; powerManagement = { ... }; programs = { ... }; security = { ... }; services = { ... }; sound = { ... }; swapDevices = [ ... ]; system = {
Its the one that passed to /etc/nixos/configuration.nix
Fix:
{ config, pkgs }:
let
# pass config so that packages use correct allowUnfree for example
unfreeConfig = config.nixpkgs.config // {
allowUnfree = true;
};
nixpkgs-local = import /home/bjorn/projects/nixpkgs { config = unfreeConfig; };
in

Roundcube issue : connection to storage server failed

I am getting this error("connection to storage server failed") lines in Roundcube. I have checked everything, configurations, and database user name password, server details all are clean. can anybody tell me what could possibly be the issue? Here I am giving the whole config file.
<?php
$rcmail_config = array();
$rcmail_config['debug_level'] = 9;
$rcmail_config['log_driver'] = 'file';
$rcmail_config['log_date_format'] = 'd-M-Y H:i:s O';
$rcmail_config['syslog_id'] = 'roundcube';
$rcmail_config['syslog_facility'] = LOG_USER;
$rcmail_config['smtp_log'] = true;
$rcmail_config['log_logins'] = false;
$rcmail_config['log_session'] = false;
$rcmail_config['sql_debug'] = false;
$rcmail_config['imap_debug'] = false;
$rcmail_config['ldap_debug'] = false;
$rcmail_config['smtp_debug'] = false;
$rcmail_config['default_port'] = 143;
$rcmail_config['imap_auth_type'] = NULL;
$rcmail_config['imap_delimiter'] = NULL;
$rcmail_config['imap_ns_personal'] = NULL;
$rcmail_config['imap_ns_other'] = NULL;
$rcmail_config['imap_ns_shared'] = NULL;
$rcmail_config['imap_force_caps'] = false;
$rcmail_config['imap_force_lsub'] = false;
$rcmail_config['imap_force_ns'] = false;
$rcmail_config['imap_timeout'] = 0;
$rcmail_config['imap_auth_cid'] = NULL;
$rcmail_config['imap_auth_pw'] = NULL;
$rcmail_config['imap_cache'] = NULL;
$rcmail_config['messages_cache'] = false;
$rcmail_config['smtp_server'] = '';
$rcmail_config['smtp_port'] = 25;
$rcmail_config['smtp_user'] = '%u';
$rcmail_config['smtp_pass'] = '%p';
$rcmail_config['smtp_auth_type'] = '';
$rcmail_config['smtp_auth_cid'] = NULL;
$rcmail_config['smtp_auth_pw'] = NULL;
$rcmail_config['smtp_helo_host'] = '';
$rcmail_config['smtp_timeout'] = 0;
$rcmail_config['enable_installer'] = true;
$rcmail_config['support_url'] = 'http://poolavadi.com/';
$rcmail_config['skin_logo'] = '';
$rcmail_config['auto_create_user'] = true;
$rcmail_config['log_dir'] = 'logs/';
$rcmail_config['temp_dir'] = 'temp/';
$rcmail_config['message_cache_lifetime'] = '10d';
$rcmail_config['force_https'] = false;
$rcmail_config['use_https'] = false;
$rcmail_config['login_autocomplete'] = 0;
$rcmail_config['login_lc'] = 0;
$rcmail_config['skin_include_php'] = false;
$rcmail_config['display_version'] = false;
$rcmail_config['session_lifetime'] = 10;
$rcmail_config['session_domain'] = '';
$rcmail_config['session_name'] = NULL;
$rcmail_config['session_storage'] = 'db';
$rcmail_config['memcache_hosts'] = NULL;
$rcmail_config['ip_check'] = true;
$rcmail_config['referer_check'] = false;
$rcmail_config['x_frame_options'] = 'sameorigin';
$rcmail_config['des_key'] = 'nSfL_Rz6tc5NRMqKpw7d&A9=';
$rcmail_config['username_domain'] = 'poolavadi.com';
$rcmail_config['mail_domain'] = '';
$rcmail_config['password_charset'] = 'ISO-8859-1';
$rcmail_config['sendmail_delay'] = 0;
$rcmail_config['max_recipients'] = 0;
$rcmail_config['max_group_members'] = 0;
$rcmail_config['useragent'] = 'Roundcube Webmail/RCMAIL_VERSION';
$rcmail_config['product_name'] = 'பூளவாடி மின்னஞ்சல்';
$rcmail_config['include_host_config'] = false;
$rcmail_config['generic_message_footer'] = '';
$rcmail_config['generic_message_footer_html'] = '';
$rcmail_config['http_received_header'] = false;
$rcmail_config['http_received_header_encrypt'] = false;
$rcmail_config['mail_header_delimiter'] = NULL;
$rcmail_config['line_length'] = 72;
$rcmail_config['send_format_flowed'] = true;
$rcmail_config['dont_override'] = array();
$rcmail_config['identities_level'] = 0;
$rcmail_config['client_mimetypes'] = NULL; # null == default
$rcmail_config['mime_magic'] = NULL;
$rcmail_config['im_identify_path'] = NULL;
$rcmail_config['im_convert_path'] = NULL;
$rcmail_config['contact_photo_size'] = 160;
$rcmail_config['email_dns_check'] = false;
$rcmail_config['plugins'] = array();
$rcmail_config['message_sort_col'] = '';
$rcmail_config['message_sort_order'] = 'DESC';
$rcmail_config['list_cols'] = array('subject', 'status', 'fromto', 'date', 'size', 'flag', 'attachment');
$rcmail_config['language'] = 'en_us';
$rcmail_config['date_format'] = 'Y-m-d';
$rcmail_config['date_formats'] = array('Y-m-d', 'd-m-Y', 'Y/m/d', 'm/d/Y', 'd/m/Y', 'd.m.Y', 'j.n.Y');
$rcmail_config['time_format'] = 'H:i';
$rcmail_config['time_formats'] = array('G:i', 'H:i', 'g:i a', 'h:i A');
$rcmail_config['date_short'] = 'D H:i';
$rcmail_config['date_long'] = 'Y-m-d H:i';
$rcmail_config['drafts_mbox'] = 'Drafts';
$rcmail_config['junk_mbox'] = 'Junk';
$rcmail_config['sent_mbox'] = 'Sent';
$rcmail_config['trash_mbox'] = 'Trash';
$rcmail_config['default_folders'] = array('INBOX', 'Drafts', 'Sent', 'Junk', 'Trash');
$rcmail_config['create_default_folders'] = false;
$rcmail_config['protect_default_folders'] = true;
$rcmail_config['quota_zero_as_unlimited'] = false;
$rcmail_config['enable_spellcheck'] = true;
$rcmail_config['spellcheck_dictionary'] = false;
$rcmail_config['spellcheck_engine'] = 'pspell';
$rcmail_config['spellcheck_uri'] = '';
$rcmail_config['spellcheck_languages'] = NULL;
$rcmail_config['spellcheck_ignore_caps'] = false;
$rcmail_config['spellcheck_ignore_nums'] = false;
$rcmail_config['spellcheck_ignore_syms'] = false;
$rcmail_config['recipients_separator'] = ',';
$rcmail_config['max_pagesize'] = 200;
$rcmail_config['min_keep_alive'] = 60;
$rcmail_config['upload_progress'] = false;
$rcmail_config['undo_timeout'] = 0;
$rcmail_config['address_book_type'] = 'sql';
$rcmail_config['ldap_public'] = array();
$rcmail_config['autocomplete_addressbooks'] = array('sql');
$rcmail_config['autocomplete_min_length'] = 1;
$rcmail_config['autocomplete_threads'] = 0;
$rcmail_config['autocomplete_max'] = 15;
$rcmail_config['address_template'] = '{street}<br/>{locality} {zipcode}<br/>{country} {region}';
$rcmail_config['addressbook_search_mode'] = 0;
$rcmail_config['default_charset'] = 'ISO-8859-1';
$rcmail_config['skin'] = 'larry';
$rcmail_config['mail_pagesize'] = 50;
$rcmail_config['addressbook_pagesize'] = 50;
$rcmail_config['addressbook_sort_col'] = 'surname';
$rcmail_config['addressbook_name_listing'] = 0;
$rcmail_config['timezone'] = 'auto';
$rcmail_config['prefer_html'] = true;
$rcmail_config['show_images'] = 0;
$rcmail_config['htmleditor'] = 0;
$rcmail_config['prettydate'] = true;
$rcmail_config['draft_autosave'] = 300;
$rcmail_config['preview_pane'] = false;
$rcmail_config['preview_pane_mark_read'] = 0;
$rcmail_config['logout_purge'] = false;
$rcmail_config['logout_expunge'] = false;
$rcmail_config['inline_images'] = true;
$rcmail_config['mime_param_folding'] = 0;
$rcmail_config['skip_deleted'] = false;
$rcmail_config['read_when_deleted'] = true;
$rcmail_config['flag_for_deletion'] = false;
$rcmail_config['keep_alive'] = 60;
$rcmail_config['check_all_folders'] = false;
$rcmail_config['display_next'] = false;
$rcmail_config['autoexpand_threads'] = 0;
$rcmail_config['top_posting'] = false;
$rcmail_config['strip_existing_sig'] = true;
$rcmail_config['show_sig'] = 1;
$rcmail_config['sig_above'] = false;
$rcmail_config['force_7bit'] = false;
$rcmail_config['search_mods'] = NULL;
$rcmail_config['addressbook_search_mods'] = NULL;
$rcmail_config['delete_always'] = false;
$rcmail_config['delete_junk'] = false;
$rcmail_config['mdn_requests'] = 0;
$rcmail_config['mdn_default'] = 0;
$rcmail_config['dsn_default'] = 0;
$rcmail_config['reply_same_folder'] = false;
$rcmail_config['forward_attachment'] = false;
$rcmail_config['default_addressbook'] = NULL;
$rcmail_config['spellcheck_before_send'] = false;
$rcmail_config['autocomplete_single'] = false;
$rcmail_config['default_font'] = '';
It means dovecot is not running.
run sudo dovecot
this was the solution I got after spending hours in frustration
Try turning all the debugging options on and talk to the IMAP server directly without involving RoundCube, see this guide. That way you can be sure that your IMAP server is working before trying to get RoundCube working.
edit 15-mailboxes.conf by running
nano /etc/dovecot/conf.d/15-mailboxes.conf
add following text inside namespace inbox {} block:
namespace inbox {
inbox = yes
...
save the file and run:
service dovecot restart
and you are done..!
One possible cause is that your Dovecot installation is not working. This happened to me after changing mysql version. I had to do:
sudo apt-get install dovecot-mysql
sudo service dovecot restart
Then it worked.
I was able to solve this issue by referring to Dovecot Status.
First of all, make sure you don't use an incognito browser window, then Check Dovecot Status by running this command
service dovecot status
it will show you that:
● dovecot.service - Dovecot IMAP/POP3 email server
Loaded: loaded (/lib/systemd/system/dovecot.service; enabled; vendor preset: enabled)
Active: **inactive** (dead) since Mon 2020-03-30 21:03:32 UTC; 29min ago
Docs: man:dovecot(1)
http://wiki2.dovecot.org/
Main PID: 910 (code=exited, status=0/SUCCESS)
Then run service dovecot start
Some Devcot config files had been corrupted. So you need to fix by recreate new config file and remove existing one. Login to root by SSH through putty software
Execute these code
cd /home
/etc/init.d/dovecot stop
rm -f */imap/*/*/Maildir/dovecot*
rm -f */imap/*/*/Maildir/.*/dovecot*
rm -f */Maildir/dovecot*
rm -f */Maildir/.*/dovecot*
/etc/init.d/dovecot restart
Now you can Login into your webmail app. No error will appear.
Source
I had this issue when upgrading from Debian Jessie to Stretch. I looked in the log:
/var/log/syslog
and found that the problem was that I was disabling protocol SSLv2 explicitly, and it was not supported anymore. I removed it from the list of protocols and everything worked fine.
remove below file and login.
/etc/dovecot/conf.d/15-mailboxes.conf
or use
sudo rm -rf nano /etc/dovecot/conf.d/15-mailboxes.conf
I had the same problem after migrating to a new server, I thorough check of the config show that my IMAP and IMAPS were disabled, I simply enabled both service and restart the server.
This is how you fix it:
Check the log:
tail /var/log/dovecot.log
if you see:
Fatal: Unknown database driver 'mysql'
Meaning missing package! Dovecot requires the dovecot-mysql package to run mysql authentication. This problem is simply cured by installing it with yum:
yum install dovecot-mysql
I had same problem recently after successful installation of roundcube
first I tried these two command lines:
netstat -tulpn | grep :143
telnet localhost 143
I got connection refused error messages.
so I have to install telnet
apt-get install telnetd
After installation successful then run Restarts
/etc/init.d/openbsd-inetd restart
/etc/init.d/dovecot restart
Then again run
netstat -tulpn | grep :143
Result
tcp 0 0 0.0.0.0:143 0.0.0.0:* LISTEN 13439/dovecot
tcp6 0 0 :::143 :::* LISTEN 13439/dovecot
Try Second test run
telnet localhost 143
Result
Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.
* OK [CAPABILITY IMAP4rev1 LITERAL+ SASL-IR LOGIN-REFERRALS ID ENABLE IDLE START TLS AUTH=PLAIN AUTH=LOGIN] Dovecot (Ubuntu) ready.
I had faced same issue and I found solution by following.
I had checked log by following command.
tail /var/log/dovecot.log
By using above command , I found following error in log.
Sep 01 10:39:50 imap(mail#yourdomain.com): Error: user
mail#yourdomain.com: Initialization failed: Initializing mail storage
from mail_location setting failed:
mkdir(/var/vmail/yourdomain.com/mail) failed: Permission denied
(euid=101(vmail) egid=12(mail) missing +w perm: /var/vmail, dir owned
by 4325:4319 mode=0751)
so I noticed that server is unable to create the directory with name "yourdomain.com" and it require "+w" permission. I have also noticed that "yourdomain.com" directory requires ownership "vmail:mail".
Finally, Directory had been created using following command .
cd /var/vmail/;
mkdir yourdomain.com;
chown vmail:mail yourdomain.com -R;
chmod +w yourdomain.com;
That's it.
I hope this answer might help you.
I had a similar issue when setting up iRedMail dockerized version on Ubuntu 20.04.
The issue was that Dovecot was not running in the container when I checked using the command - service dovecot status. And when I tried starting the service using the command - service dovecot start I got the error
root#mail:/var/spool/postfix# service dovecot start
* Starting IMAP/POP3 mail server dovecot
Error: bind(/var/spool/postfix/private/dovecot-auth) failed: No such file or directory
Fatal: Failed to start listeners
I also ran the command below to confirm that my dovecot configuration was fine:
dovecot -n
And yes the output from the command showed that it was fine.
Here's how I fixed it:
The issue was caused by Postfix not being installed/running on the in my container which I discovered when I checked the docker logs for the container using - docker logs container-id. The file /var/spool/postfix/private/dovecot-auth which Dovecot was referencing was supposed to be created by Postfix, however, since the script to install Postfix failed because the correct path to the script was not picked when building the iRedMail image, this issue then came up as Dovecot could not find the file /var/spool/postfix/private/dovecot-auth:
[iRedMail] [Entrypoint] /docker/entrypoints/postfix.sh
/docker/entrypoints/functions.sh: line 113: /docker/entrypoints/postfix.sh: No such file or directory
[iRedMail] [Entrypoint] /docker/entrypoints/mlmmj.sh
[iRedMail] [Entrypoint] /docker/entrypoints/mlmmjadmin.sh
[iRedMail] [Entrypoint] /docker/entrypoints/iredapd.sh
[iRedMail] [Entrypoint] /docker/entrypoints/antispam.sh
mail: cannot send message: Process exited with a non-zero status
All I had to do was to pull the docker repository for iRedMail using git clone -b stable https://github.com/iredmail/dockerized, rebuilt the image in my local using docker build . --tag iredmail:latest -f dockerized/Dockerfiles/Dockerfile, and then run it. This time the correct location of my Postfix install script was picked, and the Postfix installation and setup ran fine.
And when I checked Dovecot service again using:
service dovecot start
It showed me that it was running fine.
That's all
You should remove to dovecot mail server and Use another mail services, Two services could be conflitcs therefore You must remove a mail services, I've tried to this error for 2 days.
CODE : yum remove dovecot
If you had used this code Dovecot would have remove from your server and There is not conflitcs

Creating a process in ASP.NET MVC controller

I have a requirement to run an application through my MVC controller. To get the installation path I used following link (I used answer provided by Fredrik Mörk). It worked and I could able to run the exe through a process. The problem occurred when I deployed this solution on IIS where it did not create the process as it was creating in local dev environment. Can anybody tell me how to create a windows process through a solution which is hosted on IIS ?
private string GetPathForExe(string fileName)
{
private const string keyBase = #"SOFTWARE\Wow6432Node\MyApplication";
RegistryKey localMachine = Registry.LocalMachine;
RegistryKey fileKey = localMachine.OpenSubKey(string.Format(#"{0}\{1}", keyBase, fileName));
object result = null;
if (fileKey != null)
{
result = fileKey.GetValue("InstallPath");
}
fileKey.Close();
return (string)result;
}
public void StartMyApplication()
{
Process[] pname = Process.GetProcessesByName("MyApplication");
if (pname.Length == 0)
{
string appDirectory = GetPathForExe("MyApplication");
Directory.SetCurrentDirectory(appDirectory);
ProcessStartInfo procStartInfo = new ProcessStartInfo("MyApplication.exe");
procStartInfo.WindowStyle = ProcessWindowStyle.Hidden;
Process proc = new Process();
proc.StartInfo = procStartInfo;
proc.Start();
}
}

Resources