WebDAV for Linux - Advanced
If two-factor authentication is enabled, you must use an application password to connect to your mailbox Drive via WebDAV. The regular password for your mailbox account will not work in this case.
For more information, see the article Application passwords for external programs.
Setup – Step by step
In this advanced user guide, you will learn how to set up mailbox Drive on the Linux operating system and mount it as a local directory. The following steps are performed in the Linux terminal. You will also need a text editor to modify configuration files.
Here are the instructions for an easier approach: Setting up Drive as a folder in Linux with WebDAV – Easy
Step 1: Preparation
If davfs2 is not installed, install it using the Software Manager or the terminal.
| Distribution | Installation command |
|---|---|
| Debian / Ubuntu | sudo apt install davfs2 |
| Fedora | sudo dnf install davfs2 |
| Arch Linux | sudo pacman -S davfs2 |
Step 2: Editing the “fstab” file
Navigate to the /etc directory:
cd /etc
Open the fstab file with a text editor (we'll use nano as an example here). Enter your root password:
sudo nano fstab
Add the following line at the end of the configuration file:
https://dav.mailbox.org/servlet/webdav.infostore/Userstore /media/drive davfs noauto,user,rw 0 0
Step 3: Configuring the “davfs2” file
Navigate to the davfs2 directory:
cd /etc/davfs2
Open the davfs2.conf file with a text editor:
sudo nano davfs2.conf
Adjust the following configuration parameters or add them if they do not already exist:
| Parameter | Value | Description |
|---|---|---|
if_match_bug | 1 | Enables compatibility mode for certain WebDAV servers. |
use_locks | 0 | Disables file locking to prevent access conflicts. |
cache_size | 50 | Sets the size of the local cache in MB. |
table_size | 4096 | Size of the internal file allocation table |
delay_upload | 10 | Enables delayed uploads to improve performance. |
gui_optimize | 1 | Optimizes usage with graphical user interfaces. |
buf_size | 64 | Sets the size of the local buffer in KB. |
Any other configuration lines that you do not need or do not want to overwrite should be commented out by adding a # at the beginning of the line. This ensures that only the intended settings are active.
Now assign ownership rights to the davfs2.conf file. Replace username with your actual username. If you are unsure of your username, you can find it by using the following command:
whoami
Command to set the correct permissions:
sudo chown -Rv root:username davfs2.conf
Storing mailbox username and password locally
Open the file /etc/davfs2/secrets with a text editor.
sudo nano secrets
Add the following line to the secrets file:
/media/drive username@mailbox.org password
Replace username@mailbox.org and password with your login credentials for your mailbox account.
If your password contains special characters or spaces, we recommend enclosing it in double quotes. If two-factor authentication is enabled, use your Application passwords for external programs.
To protect the secrets file from unauthorized read access, set the appropriate permissions. Use the following command to do so:
sudo chmod 400 /etc/davfs2/secrets && sudo chown -Rv root:root /etc/davfs2/secrets
Step 4: Configuring WebDAV access
Create the /media/drive directory using the following command:
sudo mkdir -p /media/drive
Now assign ownership to this directory using the command to set permissions:
sudo chown -Rv $USER:$USER /media/drive
Test I
You can now run an initial test:
sudo mount -t davfs /media/drive
If this command executes without errors, your mailbox Drive is now available locally on your computer.
This is how you can view the contents:
ls /media/drive
To complete the test, unmount the Drive now:
sudo umount -t davfs /media/drive
Customising user permissions
Allow the non-privileged user you normally work with to mount the drive. Add the user to the davfs2 group.
sudo usermod -aG davfs2 $USER
Test II
You can now run a second test:
mount /media/drive
If this command runs without sudo and without any errors, your mailbox Drive is now available locally on your computer.
This is how you can view its contents:
ls /media/drive
If an unknown error occurs, restart the system if necessary, and then check whether your username is a member of the davfs2 group. To do this, use the following command:
groups $USER
If the following error occurs: "/sbin/mount.davfs: the program file does not have the setuid bit set: The argument is invalid", use the following command and then run Test II again.
sudo chmod u+s /sbin/mount.davfs
To complete Test II, now unmount the Drive:
umount /media/drive
Step 5: Automatic mount on Linux startup
To automatically mount the directory every time the system restarts, add the following command to your startup settings or under “Startup Programs.” After restarting Linux, the mailbox Drive should be accessible in a file manager at /media/drive.
mount /media/drive
Open the mount.desktop file with a text editor.
nano /home/$USER/.config/autostart/mount.desktop
Add the following line to the mount.desktop file:
[Desktop Entry]
Exec=mount /media/drive
Icon=
Name=mount
Path=
Terminal=True
Type=Application
Name[de_DE]=mailbox Drive
Alternatively, you can configure the settings for “Automatic Mount on Linux Startup” using the graphical user interface.

Automatic mounting at Linux startup, using GNOME as an example
Saving the Drive as a bookmark
To save the Drive as a bookmark in your file manager:
-
In the address bar of your file manager, open the folder
/media/drive—in this example, “Dolphin” is used. -
Right-click on the corresponding folder — in this example, “Maxima Mustermann.”
-
Click Add to Places.

Drive as a bookmark -
You can rename the folder. To do so, right-click on your mounted folder “Maxima Mustermann.”
-
Enter any name you like, e.g., “mailbox Drive.”

Rename bookmark
Done!
Step 6 - Optional: Synchronizing with a local directory
Rclone is an open-source command-line tool for managing, synchronizing, and backing up files to cloud storage.
With Rclone, you can link your mailbox Drive to a local directory. This allows you to work directly with the files as if they were stored locally, while all changes are synchronized with the mailbox Drive in real time—as long as you have an internet connection. For offline work, FreeFileSync is the better choice.
Prerequisite
Rclone is installed on your system.
If Rclone is not installed on your system, install it using the appropriate command:
| Distribution | Installation command |
|---|---|
| Debian / Ubuntu | sudo apt install rclone |
| Fedora | sudo dnf install rclone |
| Arch Linux | sudo pacman -S rclone |
To access the mailbox Drive in your file manager (e.g., Dolphin) and enable synchronization with Rclone, you need a local directory and an online folder (mailbox Drive).
In this guide, the directories are as follows:
/media/driveis the mailbox Drive/home/$USER/drive-local/is the local directory
If you have followed steps 1 through 5 of this guide, the /media/drive directory already exists.
Now create a local directory using the following command:
mkdir -p /home/$USER/drive-local
Step 6.1: Configure Rclone
-
Start the Rclone configuration with the following command:
rclone config -
Type “n” to select
New remote. -
Enter a name for the directory, such as “mailbox Drive.”
-
Enter “webdav” as the storage type.
-
Enter the URL for your mailbox Drive:
https://dav.mailbox.org/servlet/webdav.infostore/Userstore -
Select the
Other site/serviceoption as the service. -
Select the
useroption, thenpass. Enter your mailbox email address (username@mailbox.org) as the username. -
Type “y” to confirm that you want to enter your password manually. Then enter the password for your mailbox account.
-
For the
Bearer tokenoption, press enter. -
Review the configuration settings displayed and confirm them by typing “y”.
Step 6.2: Mount mailbox Drive with Rclone
Mount mailbox Drive as follows:
rclone mount mailbox-drive: /home/$USER/drive-local --vfs-cache-mode full &
The mount command runs in the background. To stop it, use this command:
fusermount -u /home/$USER/drive-local
Test I
Create a test file to verify the configuration. To do so, first navigate to your local directory. Before executing the following command, replace “Maxima Mustermann” with your first and last name.
cd /home/$USER/drive-local/Mustermann,\ Maxima/
Use the following command to create and view a file:
echo ‘rclone Test I’ > Documents/test.txt && ls Documents/test.* && cat Documents/test.txt
The file is automatically synchronized with Mailbox Drive.
Test II
Use a second test to verify that the test file exists in both your local directory and on your Drive.
To do this, navigate to your home directory:
cd /home/$USER
Now check whether the test file is present in both directories and whether the two files are identical. Before executing the following command, replace “Maxima Mustermann” with your first and last name:
diff drive-local/Mustermann,\ Maxima/Documents/test.txt /media/drive/Mustermann,\ Maxima/test.txt && ls drive-local/Mustermann,\ Maxima/Documents/test.txt /media/drive/Mustermann,\ Maxima/test.txt
If the diff command produces no output, the test file is identical in both directories.
Step 6.3: Automatic Rclone Mount at Linux Startup
Unmount the Rclone mount:
fusermount -u /home/$USER/drive-local
Open the rclone-mount.service file with a text editor:
sudo nano /etc/systemd/system/rclone-mount.service
Add the following line to the rclone-mount.service file. Replace username with your actual username:
[Unit]
Description=Mount mailbox Drive with Rclone
After=network.target
[Service]
Type=simple
ExecStart=/usr/bin/rclone mount mailbox-drive: /home/username/drive-local --vfs-cache-mode full
ExecStop=/bin/fusermount -u /home/username/drive-local
Restart=on-failure
User=username
Group=username
[Install]
WantedBy=multi-user.target
Enable and start the service for the automatic Rclone mount when Linux starts:
sudo systemctl enable rclone-mount.service && sudo systemctl start rclone-mount.service && sudo systemctl status rclone-mount.service
Done!
