Converting a Linux installation to a Slackware one in an OVHcloud server

17 giugno 2025 by Roberto Puzzanghera 0 commenti

This article explains how to convert a given Linux distribution to a Slackware one in an OVHcloud server. I wrote in the past an article about doing the same for OVH kimsufi.

It is inspired by the Slackware wiki page Install Slackware on an online.net Dedibox BareMetal Server, which explains the same for a Dedibox BareMetal Server on online.net.

The plan is to

  1. install a Linux of your choice
  2. reboot in rescue mode that Linux distro
  3. download the Slackware initrd and prepare the install environment
  4. download the set of Slackware packages to be installed
  5. chroot into the Slackware initrd image
  6. partition and install Slackware over the existing Linux
  7. configure the fresh installed Slackware and reboot

Limitare il numero di email inviate da un dato auth-user/domain/IP

14 giugno 2025 by Roberto Puzzanghera 0 commenti

NB se si è seguita la 'configurazione veloce' basata sullo script config-all, questo programma è già stato configurato.

Changelog

  • Jun 14, 2025
    - Added a cronjob for rcptcheck-overlimit that only removes cases that didn't exceed the limit, i.e. enforces a permanent ban (tx Andreas Gerstlauer)

Se si vuole evitare il rischio di compromettere il proprio server a causa di account che inviano indiscriminatamente messaggi a tutto il mondo, ad esempio per via di di una password che è stata violata in qualche modo, si può utilizzare lo script rcptcheck-overlimit di Luca Franceschini, che deve essere usato insieme alla patch rcptcheck (una patch derivata da Luca da un lavoro originale di Jay Soffian).

Aggiornare qmail

9 giugno 2025 by Roberto Puzzanghera 18 commenti

Per mia comodità ho spostato i sorgenti di qmail sources nel mio spazio github. Ciononostante, tutte le informazioni riguardanti qmail e programmi correlati continueranno a essere riportate in questo spazio web, e questo spazio rimarrà il luogo ove chiedere eventualmente supporto. Da ora in poi, annzichè rilasciare una patch combinata, rilascerò un pacchetto da scaricare da github, che sarà ovviamente il risultato dell'accomodamento delle patch elencate sotto più varie modifiche che verranno indicate nei commit di github.

Changelog

  • Jun 9, 2025
    - CRLF fix for fastremote-3 patch (thanks Andreas Gerstlauer)
    - Bug fix to the greetdelay program (thanks Andreas Gerstlauer): qmail-smtpd crashes if SMTPD_GREETDELAY is defined with no DROP_PRE_GREET defined.
    - turned off TLS and helo dns check on qmail-smtpsd/run script (tx Luis)
  • Apr 30, 2025
    qmailctl
    , qmHandle, queue_repair and all scripts installed in QMAIL/bin and not in /usr/local/bin by config-all.sh
  • Apr 25, 2025
    - added a configuration script config-all, which configure and installs the control files (as per the original config-fast script), aliases, SRS (uses control/me as the srs_domain), log dirs in /var/log/qmail, tcprules (basic, just to make initial tests), supervise scripts, qmailctl script, DKIM control/filterargs and control/domainkeys dir, SURBL, smtpplugins, helodnscheck spp plugin, svtools, qmHandle, queue-repair, SSL key file (optional).
    Consider this feature as "testing"
  • Feb 11, 2025
    - Several adjustments to get freeBSD and netBSD compatibility. More info in the commit history. Hints/comments are welcome.
    - freeBSD users have to erase the very 1st line of the file "conf-lib", as libresolv.so in not needed on freeBSD.
    - Dropped files install-big.c, idedit.c and BIN.* files.
    - Dropped files byte_diff.c, str_cpy.c, str_diff.c, str_diffn.c and str_len.c, which break compilation on clang and can be replaced by the functions shipped by the compiler (tx notqmail).
    - Old documentation moved to the "doc" dir. install.c and hier.c modified accordingly
    - conf-cc and conf-ld now have -L/usr/local/lib and -I/usr/local/include to look for srs2 library
    - conf-cc and conf-ld now have -L/usr/pkg/lib and -I/usr/pkg/include to satisfy netBSD
    - vpopmail-dir.sh: minor correction to vpopmail dir existence check
    - srs.c: #include <srs2.h> now without path
  • Dec 01, 2024 (More info here)
    - Added support for EAI (RFC 5336 SMTP Email Address Internationalization) (#13). Thanks to https://github.com/arnt/qmail-smtputf8/tree/smtputf8-tls. libidn2 package (libidn2-dev on debian) is a new dependence.
    - chkuser is now smtputf8 compliant. It accepts utf8 characters in sender and recipient addresses provided that the remote server advertises the SMTPUTF8 verb in MAIL FROM, otherwise it allows only ASCII characters plus additional chars from the CHKUSER_ALLOWED_CHARS set. (#15 #16)
    * dropped variables CHKUSER_ALLOW_SENDER_CHAR_xx CHKUSER_ALLOW_RCPT_CHAR_xx (replaced by CHKUSER_ALLOWED_CHARS)
    * dropped variables CHKUSER_ALLOW_SENDER_SRS and CHKUSER_ALLOW_RCPT_SRS, as we are always accepting '+' and '#' characters
    * added variables CHKUSER_INVALID_UTF8_CHARS and CHKUSER_ALLOWED_CHARS
  • Nov 10, 2024
    - Added support for EAI (RFC 5336 SMTP Email Address Internationalization) (commit). libidn2 is required. Thanks to https://github.com/arnt/qmail-smtputf8/tree/smtputf8-tls.
    - CHKUSER_SENDER_FORMAT and CHKUSER_RCPT_FORMAT have been commented out in chkuser_settings.h to get this feature working.
    Let's consider this release a beta. Testers are welcome concerning the new SMTPUTF8 feature.
  • Oct 26, 2024
    - qmail-remote.c patched to dinamically touch control/notlshosts/<fqdn> if control/notlshosts_auto contains any number greater than 0 in order to skip the TLS connection for remote servers with an obsolete TLS version. (tx Alexandre Fonceca) (commit)
    - defined CHKUSER_DISABLE_VARIABLE "RELAYCLIENT" in chkuser_settings.h
    - enabled CHKUSER_SENDER_NOCHECK_VARIABLE "RELAYCLIENT" in chkuser_settings.h
    - fixed several compilation breaks/warnings on later gcc compilers (tx Pablo Murillo)
    - invalid auth fix in qmail-smtpd.c's smtp_auth function (tx Alexandre Fonceca for the advice) (commit)
    - qmail path determined dinamically in conf-policy
    - added a patch to remove chkuser and the vpopmail dependency (patches dir)
  • Jan 11, 2024
    - DKIM: dk-filter dropped
    WARNING: IF YOU ARE UPGRADING qmail AND YOU ARE USING A VERSION BEFORE 2024.01.11, YOU HAVE TO RECONFIGURE DKIM AND MODIFY YOUR rc FILE ACCORDINGLY.

Installare un certificato Let's Encrypt per i server qmail e dovecot

7 giugno 2025 by Roberto Puzzanghera 9 commenti

Changelog

  • Jun 6, 2025
    - dehydrated now launches a hook.sh script which handles the post-installation tasks (assemble and copy the certificate into the qmail dir, restart the server and eventually alert the administrator in case of problems). It replaces the old scripts.
  • 22 febbraio 2025
    Let's Encrypt ha annunciato che interromperà il servizio di avviso via mail per i certificati in scadenza. Aggiunto uno script che fa la stessa cosa internamente.
  • 5 agosto 2023
    - L'installzione del certificato è ora basata su dehydrated. La vecchia documentazione basata su certbot si trova in fondo a questa pagina, ma non verrà più aggiornata.
  • May 18, 2023
    - added the option --key-type rsa to the certbot command, to avoid that certbot will silently default to ECDSA the private key format, which results not understandable by my openssl-1.1. In this way the format of the private key will be RSA. More info here.

To enable HTTPS on your website, you need to get a certificate (a type of file) from a Certificate Authority (CA). Let’s Encrypt is a CA. In order to get a certificate for your website’s domain from Let’s Encrypt, you have to demonstrate control over the domain. With Let’s Encrypt, you do this using software that uses the ACME protocol which typically runs on your web host.

Roundcube webmail

2 giugno 2025 by Roberto Puzzanghera 4 commenti

Roundcube è una webmail avanzata con una bella interfaccia grafica.

Changelog

  • Jun 2, 2025
    version 1.6.11
  • Mar 9, 2025
    added $config['quota_zero_as_unlimited'] = true; to show quota unlimited instead of unknown for accounts with unlimited quota

Configurazione di qmail

3 maggio 2025 by Roberto Puzzanghera 10 commenti

qmail v2025.04.18 e successivi include un nuovo script config-all che automatizza la configurazione di qmail. Vari script che prima dovevano essere installati a mano successivamente all'installazione di base di qmail vengono ora installati automaticamente se si lancia semplicemente il comando './config-all mx.domain.tld' dopo la compilazione. Ecco cosa sarà installato e configurato con l'installazione rapida:

  • control file pricipali come da script originale config-fast,
  • alias,
  • RBL
  • SPF
  • SRS (usa control/me come srs_domain),
  • directory log in /var/log/qmail,
  • cronjobs 
  • logrotate
  • PATH e MANPATH in /etc/profile.d/qmail.sh
  • tcprules (base, solo per poter fare i testi inziali),
  • supervise scripts,
  • qmailctl script,
  • DKIM control/filterargs and control/domainkeys directory,
  • SURBL,
  • overlimit feature,
  • moreipme,
  • smtpplugins,
  • helodnscheck spp plugin,
  • svtools,
  • qmHandle,
  • queue-repair,
  • SSL key file (opzionale)

Da ora in avanti, lanciando ./config-all mx.mydomain.tld dopo la compilazione si otterrà una installazione di qmail pronta per i test. Si dovrà solo aggiungere i propri domini virtuali e le altre funzionalità non menzionate sopra.

Coloro che preferiscono configurare tutto a mano possono continuare a usare lo script config-fast, che orà copia i miei script supervise nella cartella qmail/doc.

In quanto segue, la sezione "Configurazione Manuale" è ovviamente una lettura caldamente suggerita al fine di avere un quadro di come funziona il tutto, soprattutto se si è principianti di qmail.

Considerare questa funzionalità ancora come 'test' per il momento. I commenti sono apprezzati.

Changelog

  • Apr 15, 2025
    - added script config-all.sh
  • Jul 31, 2024
    multilog uses "d" flag as default to gain compatibility with the readable datetime format of multilog in daemontools-0.78. Change it with the "t" flag if you prefer to have timestamps.

Illustrazione "qmail virtual user delivery"

3 aprile 2025 by Roberto Puzzanghera 0 commenti

L'architettura della mia configurazione di qmail è stata modificata parecchio nel corso degli anni, specialmente per quanto riguarda il recapito dei messaggi verso gli utenti virtuali nel caso si sia abilitata la funzionalità "defaultdelivery" per vpopmail (--enable-defaultdelivery) che ho modificato recentemente, pertanto ho costruito una illustrazione di qmail con l'intento di chiarire come le cose funzionano insieme.

E' ovviamente ispirata alle illustrazioni di djb e dalla "Big qmail picture" di André Oppermann.

Installare e configurare VPopMail

29 marzo 2025 by Roberto Puzzanghera 6 commenti

Vpopmail fornisce un modo semplice di gestire indirizzi di posta su domini virtuali e account email diversi da quelli su /etc/passwd.

Changelog

  • defaultdelivery feature (--enable-defaultdelivery) changes (more info here, commit):
    • vdelivermail is installed by default in .qmail-default of newly created domains with option 'delete' as in the previous version.
    • if no user's valiases and no .qmail are found, then the message is sent to the control/defaultdelivery file, so that dovecot-lda (or whatelse) can store the mail into inbox and execute the sieve rules.
    • if vdelivermail is found in control/defaultdelivery, then it is ignored. The delivery remains in charge to vdelivermail, to avoid loops.
    • v. 5.6.8 is backward compatible. The users having .qmail from previous versions of the defauldelivery feature are not affected by this change.
  • Mar 23, 2025 (v. 5.6.7)
    - bug fix in vpopmaild.c: Crypted[64] enlarged to Crypted[128] to make room for SHA-512 passwords. This restores the usability of the RoundCube's 'password' plugin (commit)
    - fixed quota calculation in sql procedures for dovecot (tx Hakan Cakiroglu) (commit)
    - minor changes to the usage function of vmakedotqmail.c (commit)
  • Feb 15, 2025 (v. 5.6.6)
    - bug fix: pwstr.h was not installed by Makefile (tx Bai Borko)
  • Feb 9, 2025
    - added pwd strength check also for vadduser.c
    -
    removed -std=c99 -D_XOPEN_SOURCE=500 arguments from CFLAGS in configure.ac to make clang happy
    - several changes to compile on FreeBSD clang v. 18.1.6
  • Dec 20, 2024 (v. 5.6.4)
    - Password strength enforcement PR #5 (grabbed from Matt Brookings' 5.5.0-dev version)
    - Dropped min pwd length feature.
    - vmysql.h: tables' layout changed in order to have VARCHAR instead of CHAR. Fields containing ip addresses enlarged to VARCHAR(39), to create room for ipv6. Unix timestamps definition changed from BIGINT(20) to INT(11). (commit 44bad58) Have a look to the upgrade notes below.
  • Oct 14, 2024 (v. 5.6.3)
    - fixed a configure break where a trivial C test program exits on error with gcc-14.1 due to missing headers
    - vusaged/domain.c: fixed -Wimplicit-function-declaration compilation warning
    - vmysql.h: dropped the multicolumn PRIMARY KEY in valias table to allow multiple forwards for a given alias.
       In case one already has the valias table defined, this is the sql query for the upgrade:
       ALTER TABLE `vpopmail`.`valias` DROP PRIMARY KEY, ADD INDEX (`alias`, `domain`, `valias_type`) USING BTREE;
       ALTER TABLE `vpopmail`.`valias` ADD `id` INT NOT NULL AUTO_INCREMENT FIRST, ADD PRIMARY KEY (`id`);

Aggiornare alla versione 5.6.x

Quando si passa dalla versione 5.4.33 alla versione 5.6.x, se si hanno gli account su SQL, è necessario aumentare le dimensioni della colonna vpopmail.pw_passwd del database, poichè il meccanismo di criptaggio delle password è ora basato su SHA512, che è più lungo del vecchio MD5; si può comunque scegliere di disabilitare le SHA512 pwd con --disable-sha512-passwords al momento della configurazione. La colonna vpopmail.pw_passwd dovrebbe essere ora impostata a una dimensione di 128; questa la query:

ALTER TABLE `vpopmail` CHANGE `pw_passwd` `pw_passwd` CHAR(128) CHARACTER SET latin1 COLLATE latin1_swedish_ci NULL DEFAULT NULL;

Aggiornare dalla versione 5.6.3 alla versione 5.6.4

Varie altre modifiche che però non creano incompatibilità con le versioni precedenti sono state apportate al layout delle tabelle MySQL. Ecco la query da lanciare per alterarle (inlclusa la modifica già menzionata sopra):
/* vpopmail */
ALTER TABLE `vpopmail` CHANGE `pw_name` `pw_name` VARCHAR(64) CHARACTER SET latin1 COLLATE latin1_swedish_ci NOT NULL; 
ALTER TABLE `vpopmail` CHANGE `pw_domain` `pw_domain` VARCHAR(96) CHARACTER SET latin1 COLLATE latin1_swedish_ci NOT NULL; 
ALTER TABLE `vpopmail` CHANGE `pw_passwd` `pw_passwd` VARCHAR(128) CHARACTER SET latin1 COLLATE latin1_swedish_ci NULL DEFAULT NULL;
ALTER TABLE `vpopmail` CHANGE `pw_gecos` `pw_gecos` VARCHAR(64) CHARACTER SET latin1 COLLATE latin1_swedish_ci NULL DEFAULT NULL;
ALTER TABLE `vpopmail` CHANGE `pw_dir` `pw_dir` VARCHAR(160) CHARACTER SET latin1 COLLATE latin1_swedish_ci NULL DEFAULT NULL;
ALTER TABLE `vpopmail` CHANGE `pw_shell` `pw_shell` VARCHAR(20) CHARACTER SET latin1 COLLATE latin1_swedish_ci NULL DEFAULT NULL; 

/* vlog */
ALTER TABLE `vlog` CHANGE `user` `user` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_swedish_ci NULL DEFAULT NULL; 
ALTER TABLE `vlog` CHANGE `passwd` `passwd` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_swedish_ci NULL DEFAULT NULL;
ALTER TABLE `vlog` CHANGE `domain` `domain` VARCHAR(96) CHARACTER SET latin1 COLLATE latin1_swedish_ci NULL; 
ALTER TABLE `vlog` CHANGE `remoteip` `remoteip` VARCHAR(39) CHARACTER SET latin1 COLLATE latin1_swedish_ci NULL DEFAULT NULL; 
ALTER TABLE `vlog` CHANGE `error` `error` TINYINT(1) NULL DEFAULT NULL;
ALTER TABLE `vlog` CHANGE `timestamp` `timestamp` INT NOT NULL DEFAULT '0'; 

/* lastauth */
ALTER TABLE `lastauth` CHANGE `user` `user` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_swedish_ci NOT NULL; 
ALTER TABLE `lastauth` CHANGE `domain` `domain` VARCHAR(96) CHARACTER SET latin1 COLLATE latin1_swedish_ci NOT NULL; 
ALTER TABLE `lastauth` CHANGE `remote_ip` `remote_ip` VARCHAR(39) CHARACTER SET latin1 COLLATE latin1_swedish_ci NOT NULL;
ALTER TABLE `lastauth` CHANGE `timestamp` `timestamp` INT NOT NULL DEFAULT '0'; 

/* limits */
ALTER TABLE `limits` CHANGE `domain` `domain` VARCHAR(96) CHARACTER SET latin1 COLLATE latin1_swedish_ci NOT NULL; 

/* alias */
ALTER TABLE `valias` CHANGE `alias` `alias` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_swedish_ci NOT NULL;
ALTER TABLE `valias` CHANGE `domain` `domain` VARCHAR(96) CHARACTER SET latin1 COLLATE latin1_swedish_ci NOT NULL;

/* dir_control */
ALTER TABLE `dir_control` CHANGE `domain` `domain` VARCHAR(96) CHARACTER SET latin1 COLLATE latin1_swedish_ci NOT NULL;

/* aliasdomains */
ALTER TABLE `aliasdomains` CHANGE `alias` `alias` VARCHAR(96) CHARACTER SET latin1 COLLATE latin1_swedish_ci NOT NULL;
ALTER TABLE `aliasdomains` CHANGE `domain` `domain` VARCHAR(96) CHARACTER SET latin1 COLLATE latin1_swedish_ci NOT NULL;

Mie modifiche al programma

Questo l'insieme delle mie patch che sono incluse in vpopmail a partire dalla versione 5.6.0:

  • la patch sql-aliasdomains, che fa in modo che VPopMail salvi gli aliasdomains su mysql. Questo consente al driver sql di dovecot di fare l'autenticazione non solo con i domini reali ma anche con gli alias, a condizione che si modifichi anche la query all'interno del driver, come verrà spiegato dopo. Ciò è ora importante, dato che dovecot ha eliminato il driver per VPopMail.
  • la patch defaultdelivery (--enable-defaultdelivery):
    • vdelivermail è installato per default nel .qmail-default dei nuovi domini con l'opzione 'delete'.
    • se nessun utente e nessun .qmail sono stati trovati viene eseguito quanto contenuto nel file control/defaultdelivery, di modo che dovecot-lda possa salvare la mail ed eseguire le regole sieve.
    • se vdelivermail è stato trovato nel file control/defaultdelivery, allora control/defaultdelivery viene ignorato e la consegna del messaggio rimane a carico di vdelivermail, per evitare loop.
    Per informazioni precise leggere qui. Dare anche una occhiata al file doc/README.defaultdelivery nel codice sorgente.
  • dovecot-sql-procedures patch. Se si vuole usare il driver sql di dovecot con la configurazione "una tabella per un dominio) (--disable-many-domains) è necessario personalizzare in modo pesante le query sql. Con questo aggiustamento vpopmail installerà in modo autonomo la procedura e le funzioni sql nel database quando si crea un nuovo dominio. La procedura può essere chiamata da dovecot per fare l'autenticazione.
    Il codice sql supporta gli aliasdomains e i mysql limits, e sarà caricato dal file ~/vpopmail/etc/disable-many-domains_procedures.sql che si può ovviamente personalizzare.
    E' necessario configurare vpopmail con --enable-mysql-bin=PATH poichè dobbiamo installare la procedura chiamando mysql con un comando shell.
  • vusaged configure patch
    Almeno su Debian 11 sembra che vusaged si rifiuti di terminare la configurazione (comando configure) a causa di un mancato link alle librerie mysql (configure: error: No vauth_getpw in libvpopmail). Ovviamente ho spulciato lo script e il link sembra impostato correttamente, e ciò è al momento molto strano. Dopo un po' di prove, ho notato che facendo in modo che il configure superi il problema senza bloccarsi con un messaggio di errore, la compilazione susseguente vada a buon fine linkando corrrettamente libmysqlclient e terminando con successo la compilazione.
    NB: è necessario dare un autoreconf -f -i nella directory vusaged prima della configurazione, dal momento che il file configure.ac è stato modificato.
  • s/qmail cdb patch. Questa patch, che consente a vpopmail di localizzare correttamente il file assign.cdb di qmail per gli utenti s/qmail, nell'attuale pacchetto perchè rimpiazzata da una analoga. Gli utenti di s/qmail dovrebbero configurare vpopmail con l'opzione --enable-qmail-cdb-name=assign.cdb
  • recipient check patch. Da usare con s/qmail di Erwin Hoffmann al fine di validare il destinatario della mail. Questa patch non è importante nella presente installazione. Si veda il file  doc/README.vrcptcheck per maggiori informazioni.
  • vuserinfo-D_newline, una piccola patch che migliora la leggibilità quando si utilizza il comando vuserinfo -D, introducendo una nuova linea
  • la patch gcc-10-compat, con il la quale VPopMail è compatibile con gcc-10.
  • Una patch che risolve i seguenti problemi (Ali Erturk TURKER):
    - vdelivermail.c controlla i permessi di spamassassin anzichè di maildrop.
    - vopen_smtp_relay() restituisce il valore corretto, di modo che open_smtp_relay() possa rilevare e riportare gli errori di connessione al database (vmysql.c, voracle.pc, vpgsql.c)
    - vdel_limits() esegue un core-dump se la connessione al database non è disponibile. (vmysql.c, voracle.pc)

qmail notes

Pay me a coffee:

PayPal - The safer, easier way to pay online.

LXC scripts
Other contents
Guide per gli utenti
Ultimi commenti
Articoli recenti

RSS feeds