Salmon commandline interface
salmon
Python mail server
salmon [OPTIONS] COMMAND [ARGS]...
Options
- --version
Show the version and exit.
Salmon is Copyright (C) Matt Molyneaux 2014-2015, 2019. Licensed GPLv3. Forked from Lamon, Copyright (C) Zed A. Shaw 2008-2009. Licensed GPLv3. If you didn’t get a copy of the LICENSE go to:
Have fun.
blast
Given a Maildir, this command will go through each email and blast it at your server. It does nothing to the message, so it will be real messages hitting your server, not cleansed ones.
salmon blast [OPTIONS] MAILBOX
Options
- --port <PORT>
port to connect to
- --host <ADDRESS>
address to connect to
- --lmtp
- --debug
debug mode
Arguments
- MAILBOX
Required argument
cleanse
Uses Salmon mail cleansing and canonicalization system to take an input Maildir (or mbox) and replicate the email over into another Maildir. It’s used mostly for testing and cleaning.
salmon cleanse [OPTIONS] IN_MAILBOX OUT_MAILBOX
Arguments
- IN_MAILBOX
Required argument
- OUT_MAILBOX
Required argument
gen
Generates various useful things for you to get you started.
salmon gen [OPTIONS] PATH
Options
- -f, --force
overwrite existing directories
Arguments
- PATH
Required argument
log
Runs a logging only server on the given hosts and port. It logs each message it receives and also stores it to the run/queue so that you can make sure it was received in testing.
salmon log [OPTIONS]
Options
- --port <PORT>
port to listen on
- --host <ADDRESS>
address to listen on
- --chroot <PATH>
path to chroot
- --chdir <PATH>
change to this directory when daemonising
- --umask <MASK>
set umask on server
- --pid <PATH>
path to pid file
- -f, --force
force server to run, ignoring pid file
- --debug
debug mode
- --uid <UID>
run with this user id
- --gid <GID>
run with this group id
- --daemon, --no-daemon
start server as daemon (default)
If you specify a uid/gid then this means you want to first change to root, set everything up, and then drop to that UID/GID combination. This is typically so you can bind to port 25 and then become “safe” to continue operating as a non-root user. If you give one or the other, this it will just change to that uid or gid without doing the priv drop operation.
queue
Lets you do most of the operations available to a queue.
salmon queue [OPTIONS] PATH
Options
- --pop
pop a message from queue
- --get <KEY>
get key from queue
- --remove <KEY>
remove chosen key from queue
- --count
count messages in queue
- --clear
clear queue
- --keys
print queue keys
Arguments
- PATH
Optional argument
routes
Prints out valuable information about an application’s routing configuration after everything is loaded and ready to go. Helps debug problems with messages not getting to your handlers. Path has the search paths you want separated by a ‘:’ character, and it’s added to the sys.path.
MODULE should be a configuration module and can be given multiple times.
salmon routes [OPTIONS] MODULE
Options
- --path <PATH>
search path for modules
- --test <EMAIL>
address to test against routing configuration
Arguments
- MODULE
Required argument(s)
send
Sends an email to someone as a test message. See the sendmail command for a sendmail replacement.
salmon send [OPTIONS]
Options
- --port <PORT>
Port to connect to
- --host <ADDRESS>
Host to connect to
- --username <username>
SMTP username
- --password <password>
SMTP password
- --sender <EMAIL>
- --to <EMAIL>
- --subject <subject>
- --body <body>
- --attach <attach>
- --lmtp <lmtp>
- --ssl <ssl>
- --starttls <starttls>
sendmail
Used as a testing sendmail replacement for use in programs like mutt as an MTA. It reads the email to send on the stdin and then delivers it based on the port and host settings.
salmon sendmail [OPTIONS] RECIPIENTS...
Options
- --port <PORT>
Port to connect to
- --host <ADDRESS>
Address to connect to
- --lmtp
Use LMTP rather than SMTP
- --debug
Debug mode
Arguments
- RECIPIENTS
Required argument(s)
start
Runs a salmon server out of the current directory
salmon start [OPTIONS]
Options
- --boot <MODULE>
module with server definition
- --chroot <PATH>
path to chroot
- --chdir <PATH>
change to this directory when daemonising
- --umask <MASK>
set umask on server
- --pid <PATH>
path to pid file
- -f, --force
force server to run, ignoring pid file
- --debug
debug mode
- --uid <UID>
run with this user id
- --gid <GID>
run with this group id
- --daemon, --no-daemon
start server as daemon (default)
If you specify a uid/gid then this means you want to first change to root, set everything up, and then drop to that UID/GID combination. This is typically so you can bind to port 25 and then become “safe” to continue operating as a non-root user. If you give one or the other, this it will just change to that uid or gid without doing the priv drop operation.
status
Prints out status information about salmon useful for finding out if it’s running and where.
salmon status [OPTIONS]
Options
- --pid <PATH>
path to pid file
stop
Stops a running salmon server
salmon stop [OPTIONS]
Options
- --pid <PATH>
path to pid file
- -f, --force
force stop server
- --all <all_pids>
stops all servers with .pid files in the specified directory