Maildrop turn on
maildrop
is a mail delivery agent that can be used to filter and deliver email messages. To turn it on, you'll need to configure it to run automatically when you start your system. Here are the general steps:
On Linux systems:
- Install maildrop: If you haven't already, install
maildrop
on your system. The package name may vary depending on your distribution. For example, on Ubuntu/Debian, you can usesudo apt-get install maildrop
. - Configure maildrop: Edit the
/etc/maildrop.conf
file to specify the email account(s) you want to use with maildrop. You can add the following lines to the file:# Set the email account to use ACCOUNT [email protected]
Set the email password
PASSWORD mypassword
Set the email server
SERVER mail.example.com
Replace `[email protected]`, `mypassword`, and `mail.example.com` with your actual email account information.
3. **Create a maildrop filter**: Create a file in the `/etc/maildrop/filters` directory (or a subdirectory) with a `.filter` extension. For example, you can create a file called `myfilter.filter`. In this file, you can specify the rules for filtering and delivering email messages. For example:
```bash
# Filter email messages
if ( $header : contains "spam" )
then deliver "/dev/null"
else
deliver "[email protected]"
This filter will deliver email messages that contain the word "spam" to /dev/null
(i.e., delete them), and deliver all other email messages to your email account.
4. Enable maildrop: Create a systemd service file to enable maildrop to run automatically when you start your system. Create a file called /etc/systemd/system/maildrop.service
with the following contents:
[Unit]
Description=Maildrop Service
After=network.target
[Service]
User=root
ExecStart=/usr/bin/maildrop -f /etc/maildrop.conf
Restart=always
[Install]
WantedBy=multi-user.target
- Reload systemd daemon: Reload the systemd daemon to pick up the new service file:
sudo systemctl daemon-reload
. - Start and enable maildrop service: Start the maildrop service and enable it to start automatically when you boot your system:
sudo systemctl start maildrop
andsudo systemctl enable maildrop
.
On macOS (with Homebrew):
- Install maildrop: Install
maildrop
using Homebrew:brew install maildrop
. - Configure maildrop: Edit the
~/.maildrop
file to specify the email account(s) you want to use with maildrop. You can add the following lines to the file:# Set the email account to use ACCOUNT [email protected]
Set the email password
PASSWORD mypassword
Set the email server
SERVER mail.example.com
Replace `[email protected]`, `mypassword`, and `mail.example.com` with your actual email account information.
3. **Create a maildrop filter**: Create a file in the `~/.maildrop/filters` directory (or a subdirectory) with a `.filter` extension. For example, you can create a file called `myfilter.filter`. In this file, you can specify the rules for filtering and delivering email messages. For example:
```bash
# Filter email messages
if ( $header : contains "spam" )
then deliver "/dev/null"
else
deliver "[email protected]"
This filter will deliver email messages that contain the word "spam" to /dev/null
(i.e., delete them), and deliver all other email messages to your email account.
4. Enable maildrop: Add the following line to your shell configuration file (e.g., ~/.bashrc
or ~/.zshrc
) to enable maildrop to run automatically when you start your shell:
export MAILDROP_FILTERS=~/.maildrop/filters
- Restart your shell: Restart your shell to pick up the new configuration:
exec $SHELL
.
That's it! Maildrop should now be running and filtering your email messages according to your custom filter rules.