MPOP(1)
π¦ mpop(1) β General Commands Manual π¦
okay so bestie, this is the mpop(1) page, and it's a whole mood: it's about mpop, the POP3 client. We're gonna go section by section, no cap, and keep all the important bits exactly where they belong. π
β¨ NAME β¨
mpop β A POP3 client. That's the whole vibe. π
π SYNOPSIS π
Mail retrieval mode (default):
mpop [option...] [--] [account...]
mpop --host=host [option...]
Configuration mode:
mpop --configure <mailaddress>
Server information mode:
mpop [option...] --serverinfo [account...]
mpop --host=host [option...] --serverinfo
Mail Delivery Agent (MDA) mode:
mpop --mda --delivery=method,method_arguments... [envelope-from-
address]
π DESCRIPTION π
In mail retrieval mode, mpop retrieves mails from one or more POP3 mailboxes, optionally does some filtering, and delivers them through a mail delivery agent (MDA), to a maildir folder, or to an mbox file. Mails that were successfully delivered before will not be retrieved a second time, even if errors occur or mpop is terminated in the middle of a session. That's the good stuff: it remembers what already made it through. π«Ά
In server information mode, mpop prints information about one or more POP3 servers. It's giving "let me look at the server" energy. β¨
If no account names are given on the command line, one named default will be used. Lowkey convenient.
The best way to start is probably to have a look at the EXAMPLES section. Go check it, bestie. π
πͺ EXIT STATUS πͺ
The standard sendmail exit codes are used, as defined in sysexits.h. That's the whole tea. β
π OPTIONS π
Options override configuration file settings, for every used account. Every account. Okay? Okay. π
πΈ General Options πΈ
--versionβ Print version information, including information about the libraries used. It's giving receipts. π§Ύ--helpβ Print help. The classic "bestie, help me" move.-P,--pretendβ Print the configuration settings that would be used, but do not take further action. An asterisk (*) will be printed instead of your password. Cute and safe-ish. π-d,--debugβ Print lots of debugging information, including the whole conversation with the server.
β οΈ Be careful with this option: the (potentially dangerous) output will not be sanitized, and your password may get printed in an easily decodable format! This option implies --half-quiet, because the progress output would interfere with the debugging output. Like, actually be careful, bestie. π
π₯ Changing the mode of operation π₯
--configure=mailaddressβ Generate a configuration for the given mail address and print it. This can be modified or copied unchanged to the configuration file. Note that this only works for mail domains that publish appropriate SRV records; see RFC 8314. π-S,--serverinfoβ Print information about the POP3 server(s) and exit. This includes information about supported features (pipelining, authentication methods, TOP command, ...), about parameters (time for which mails will not be deleted, minimum time between logins, ...), and about the TLS certificate (if TLS is active). Full icon behavior. π--mdaβ Act as a mail delivery agent (MDA): read a mail from standard input and deliver it according to the--deliveryoption. See thedeliverycommand. There is one minor difference: the envelope from address is not extracted from the mail, it is instead given as a command line argument, or set toMAILER-DAEMONif no argument is given. Examples:
$ mpop --mda --delivery=mbox,~/Mail/inbox
$ mpop --mda --delivery=maildir,~/Mail/incoming
$ mpop --mda --delivery=mda,"msmtp --host=localhost
--from=me@localhost -- you@localhost"
$ mpop --mda --delivery=mda,"msmtp --host=localhost
--from=%F -- you@localhost" me@localhost
π Configuration options π
-C,--file=conffileβ Use the given file instead of~/.mpoprcor$XDG_CONFIG_HOME/mpop/configas the user configuration file.--host=hostnameβ Use this server with settings from the command line; do not use any configuration file data. This option disables loading of the configuration file. You cannot use both this option and account names on the command line. Pick a lane, bestie. π--port=numberβ Set the port number to connect to. See theportcommand.--source-ip=[IP]β Set or unset an IP address to bind the socket to. See thesource_ipcommand.--proxy-host=[IP|hostname]β Set or unset a SOCKS proxy to use. See theproxy_hostcommand.--proxy-port=[number]β Set or unset a port number for the proxy host. See theproxy_portcommand.--socket=[socketname]β Set or unset a local unix domain socket name to connect to. See thesocketcommand.--timeout=(off|seconds)β Set a network timeout. See thetimeoutcommand.--pipelining=(auto|on|off)β Enable or disable POP3 pipelining. See thepipeliningcommand.--received-header[=(on|off)]β Enable or disable the Received header. See thereceived_headercommand.--auth[=(on|method)]β Set the authentication method to automatic (withon) or manually choose an authentication method. See theauthcommand.--user=[username]β Set or unset the user name for authentication. See theusercommand.--passwordeval=[cmd]β Evaluate password for authentication. See thepasswordevalcommand.--tls[=(on|off)]β Enable or disable TLS/SSL. See thetlscommand.--tls-starttls[=(on|off)]β Enable or disable STARTTLS for TLS. See thetls_starttlscommand.--tls-trust-file=[file]β Set or unset a trust file for TLS. See thetls_trust_filecommand.--tls-crl-file=[file]β Deprecated. Set or unset a certificate revocation list (CRL) file for TLS. See thetls_crl_filecommand.--tls-fingerprint=[fingerprint]β Set or unset the fingerprint of a trusted TLS certificate. See thetls_fingerprintcommand.--tls-key-file=[file]β Set or unset a key file for TLS. See thetls_key_filecommand.--tls-cert-file=[file]β Set or unset a cert file for TLS. See thetls_cert_filecommand.--tls-certcheck[=(on|off)]β Enable or disable server certificate checks for TLS. See thetls_certcheckcommand.--tls-priorities=[priorities]β Set or unset TLS priorities. See thetls_prioritiescommand.--tls-host-override=[host]β Set or unset override for TLS host verification. See thetls_host_overridecommand.--tls-min-dh-prime-bits=[bits]β Deprecated, use--tls-prioritiesinstead. Set or unset minimum bit size of the Diffie-Hellmann (DH) prime. See thetls_min_dh_prime_bitscommand.
π§ Options specific to mail retrieval mode π§
-q,--quietβ Do not print status or progress information. Silent mode, but make it fashion. π€«-Q,--half-quietβ Print status but not progress information.-a,--all-accountsβ Query all accounts in the configuration file.-A,--auth-onlyβ Authenticate only; do not retrieve mail. Useful for SMTP-after-POP.-s,--status-onlyβ Print number and size of mails in each account only; do not retrieve mail.-n,--only-new[=(on|off)]β Process only new messages. See theonly_newcommand.-k,--keep[=(on|off|duration)]β Do not delete mails from POP3 servers (for the given duration), regardless of other options or settings. See thekeepcommand.--killsize=(off|size)β Set or unset kill size. See thekillsizecommand.--skipsize=(off|size)β Set or unset skip size. See theskipsizecommand.--filter=[program]β Set a filter which will decide whether to retrieve, skip, or delete each mail by investigating the mail's headers. See thefiltercommand.--delivery=method,method_arguments...β How to deliver messages received from this account. See thedeliverycommand. Note that a comma is used instead of a blank to separate the method from its arguments.--uidls-file=filenameβ File to store UIDLs in. See theuidls_filecommand.
π§ USAGE π§
A suggestion for a suitable configuration file can be generated using the --configure option. The default configuration file is ~/.mpoprc or $XDG_CONFIG_HOME/mpop/config. Settings in this file can be changed by command line options.
A configuration file is a simple text file. Empty lines and comment lines (first non-blank character is '#') are ignored. Every other line must contain a command and may contain an argument to that command. The argument may be enclosed in double quotes (").
If a file name starts with the tilde (~), this tilde will be replaced by $HOME.
If a command accepts the argument on, it also accepts an empty argument and treats that as if it was on.
Commands are organized in accounts. Each account starts with the account command and defines the settings for one POP3 account.
Commands are as follows:
defaultsβ Set defaults. The following configuration commands will set default values for all following account definitions.account name [:account[,...]]β Start a new account definition with the given name. The current default values are filled in. If a colon and a list of previously defined accounts is given after the account name, the new account, with the filled in default values, will inherit all settings from the accounts in the list.eval cmdβ this one's a whole vibe β¨ It swaps out the current configuration file line for the first line of the commandcmd's output (stdout). So you can decrypt your settings, or generate them on the fly with a script. Obsessed. Like,eval echo host localhostliterally replaces the current line withhost localhost. Chef's kiss. π
Heads up though: every eval line gets evaluated when the configuration file is read β no cap, all of them. And for passwords specifically, you can also use the passwordeval command instead of eval password cmd. The glow-up there is that the command is only evaluated if it's actually needed. π
host hostnameβ the POP3 server you're pulling mail from, bestie. The argument can be a host name or a network address. And listen β every account definition must contain this command. Non-negotiable. πport numberβ which port the POP3 server is listening on. Default is110("pop3"), unless TLS without STARTTLS is in play β then it's995("pop3s"). Slay. πΈsource_ip [IP]β pins your outgoing connection to a source IP address. Genuinely only useful in special cases on multi-home systems, so likeβ¦ niche but valid. An empty argument disables it. π¦proxy_host [IP|hostname]β routes everything through a SOCKS proxy, and I mean everything: all network traffic goes through this proxy host, including DNS queries. The one exception? A DNS query that might be necessary to resolve the proxy host name itself β and you can dodge that entirely by using an IP address as the proxy host name. An empty hostname argument disables proxy usage. The supported SOCKS protocol version is5. If you want to use this with Tor, see also "Using mpop with Tor" below. π§proxy_port [number]β sets the port number for the proxy host. An empty number argument resets it back to the default port, which is1080("socks"). πsocket socketnameβ sets the file name of a unix domain socket to connect to. It overrides bothhost/portandproxy_host/proxy_port. Main character energy, honestly β it just takes over. π₯timeout (off|seconds)β sets or unsets a network timeout, in seconds. Default is180seconds. The argumentoffmeans no timeout will be set at all β which means the operating system default gets used. πpipelining (auto|on|off)β enables or disables POP3 pipelining. You should never need to change the default setting, which isauto: mpop turns pipelining on for POP3 servers that advertise this capability, and off for all the other servers. It can speed up a POP3 session substantially. Let it cook. βauth [(on|method)]β picks an authentication method. The default argumentonchooses one automatically. π«
Usually you authenticate with a user name and a password. The user name is specified in the configuration file with the user command. And there are five different ways to hand over the password:
- Add the password to the system key ring. Currently supported key rings are the Gnome key ring and the Mac OS X Keychain. For the Gnome key ring, use the command
secret-tool(part of Gnome'slibsecret) to store passwords:secret-tool store --label=mpop host pop.freemail.example service pop3 user joe.smith. On Mac OS X, use the following command:security add-internet-password -s pop.freemail.example -r pop3 -a joe.smith -w. In both examples, replacepop.freemail.examplewith the POP3 server name, andjoe.smithwith your user name. π - Store the password in an encrypted files, and use
passwordevalto specify a command to decrypt that file, e.g. using GnuPG. See EXAMPLES. - Store the password in the configuration file using the
passwordcommand. (Usually it is not considered a good idea to store passwords in cleartext files. If you do it anyway, you must make sure that the file can only be read by yourself.) π - Store the password in
~/.netrc. This method is probably obsolete. π - Type the password into the terminal when it is required.
It is recommended to use method 1 or 2. Please bestie, take the recommendation. π«Ά
Multiple authentication methods exist. Most servers support only some of them.
The following user / password methods are supported: user (a simple plain text method supported by all servers), plain (another simple cleartext method, supported by almost all servers), scram-sha-1 and scram-sha-1-plus (a method that avoids cleartext passwords and requires the server to prove that it is in posession of the (hashed and salted) password, which prevents some man-in-the-middle-attacks. The -plus variant additionally uses TLS channel binding information for even better security guarantees), scram-sha-256 and scram-sha-256-plus (same but with a stronger hash function), apop (an obsolete method that avoids cleartext passwords, but is not considered secure anymore), cram-md5 (an obsolete method that avoids cleartext passwords, but is not considered secure anymore), digest-md5 (an overcomplicated obsolete method that avoids cleartext passwords, but is not considered secure anymore), login (a non-standard cleartext method similar to but worse than the plain method), ntlm (an obscure non-standard method that is now considered broken; it sometimes requires a special domain parameter passed via ntlmdomain).
If no method is specified, mpop will autoselect one based on security benefits. With TLS, the order is scram-sha-256-plus, scram-sha-1-plus, scram-sha-256, scram-sha-1, plain, followed by some of the obsolete methods if nothing else is available. Without TLS, only scram-sha-256 and scram-sha-1 are considered. π
There are currently three authentication methods that are not based on user / password information and have to be chosen manually: oauthbearer or its predecessor xoauth2 (an OAuth2 token from the mail provider is used as the password. See the documentation of your mail provider for details on how to get this token. The passwordeval command can be used to pass the regularly changing tokens into mpop from a script or an environment variable), external (the authentication happens outside of the protocol, typically by sending a TLS client certificate, and the method merely confirms that this authentication succeeded), and gssapi (the Kerberos framework takes care of secure authentication, only a user name is required).
It depends on the underlying authentication library and its version whether a particular method is supported or not. Use --version to find out which methods are supported. π
user loginβ sets the user name for authentication. An empty argument unsets the user name. Simple as that. πpassword secretβ sets the password for authentication. An empty argument unsets the password. But consider using thepasswordevalcommand or a key ring instead of this command, to avoid storing cleartext passwords in the configuration file. Just looking out for you. πpasswordeval [cmd]β sets the password for authentication to the output (stdout) of the commandcmd. You can use this e.g. to decrypt password files on the fly or to query key rings, and thus to avoid storing cleartext passwords. Iconic, honestly. πntlmdomain [domain]β sets a domain for thentlmauthentication method. This is obsolete. That's it, that's the whole entry. πtls [(on|off)]β turn TLS (aka SSL) on or off</p> for secured connections. π
Transport Layer Security (TLS) β... provides communications privacy over the Internet. The protocol allows client/server applications to communicate in a way that is designed to prevent eavesdropping, tampering, or message forgeryβ (quote from RFC2246). β¨
A server can use TLS in one of two modes: via a STARTTLS command (the session starts with the normal protocol initialization, and TLS is then started using the protocolβs STARTTLS command), or immediately (TLS is initialized before the normal protocol initialization; this requires a separate port). The first mode is the default, but you can switch to the second mode by disabling tls_starttls. π«Ά
When TLS is started, the server sends a certificate to identify itself. To verify the server identity, a client program is expected to check that the certificate is formally correct and that it was issued by a Certificate Authority (CA) that the user trusts. (There can also be certificate chains with intermediate CAs.) π₯
The list of trusted CAs is specified using the tls_trust_file command. The default value is "system" and chooses the system-wide default, but you can also choose the trusted CAs yourself. π
A fundamental problem with this is that you need to trust CAs. Like any other organization, a CA can be incompetent, malicious, subverted by bad people, or forced by government agencies to compromise end users without telling them. All of these things happened and continue to happen worldwide. The idea to have central organizations that have to be trusted for your communication to be secure is fundamentally broken. π
Instead of putting trust in a CA, you can choose to trust only a single certificate for the server you want to connect to. For that purpose, specify the certificate fingerprint with tls_fingerprint. This makes sure that no man-in-the-middle can fake the identity of the server by presenting you a fraudulent certificate issued by some CA that happens to be in your trust list. However, you have to update the fingerprint whenever the server certificate changes, and you have to make sure that the change is legitimate each time, e.g. when the old certificate expired. This is inconvenient, but itβs the price to pay. π
Information about a server certificate can be obtained with --serverinfo --tls --tls-certcheck=off. This includes the issuer CA of the certificate (so you can trust that CA via tls_trust_file), and the fingerprint of the certificate (so you can trust that particular certificate via tls_fingerprint). π
TLS also allows the server to verify the identity of the client. For this purpose, the client has to present a certificate issued by a CA that the server trusts. To present that certificate, the client also needs the matching key file. You can set the certificate and key files using tls_cert_file and tls_key_file. This mechanism can also be used to authenticate users, so that traditional user / password authentication is not necessary anymore. See the external mechanism in auth. π
You can also use client certificates stored on some external authentication device by specifying GnuTLS device URIs in tls_cert_file and tls_key_file. You can find the correct URIs using p11tool --list-privkeys --login (p11tool is bundled with GnuTLS). If your device requires a PIN to access the data, you can specify that using one of the password mechanisms (e.g. passwordeval, password). π
tls_starttls [(on|off)]β choose the TLS variant: start TLS from within the session (on, default), or tunnel the session through TLS (off). π¦tls_trust_file fileβ activate server certificate verification using a list of trusted Certification Authorities (CAs). The default is the special value"system", which selects the system default. An empty argument disables trust in CAs. If you select a file, it must be in PEM format, and you should also usetls_crl_file. πtls_crl_file [file]β set a certificate revocation list (CRL) file for TLS, to check for revoked certificates (an empty argument, which is the default, disables this). π«
OCSP is an alternative to CRL files. When GnuTLS is used, stapled OCSP information will be checked automatically, and the MustStaple TLS extension is supported, however no manual OCSP queries will be sent when stapled OCSP information is missing. With other TLS libraries, behavior may be different. π
tls_fingerprint [fingerprint]β set the fingerprint of a single certificate to accept for TLS. This certificate will be trusted regardless of its contents (this overridestls_trust_file). The fingerprint should be of type SHA256, but can for backwards compatibility also be of type SHA1 or MD5 (please avoid this). The format should be01:23:45:67:....Use--serverinfo --tls --tls-certcheck=off --tls-fingerprint=to get the server certificate fingerprint. π«tls_key_file fileβ send a client certificate to the server (use this together withtls_cert_file). The file must contain the private key of a certificate in PEM format. An empty argument disables this feature. πtls_cert_file fileβ send a client certificate to the server (use this together withtls_key_file). The file must contain a certificate in PEM format. An empty argument disables this feature. πͺͺtls_certcheck [(on|off)]β enable or disable checks of the server certificate. They are enabled by default. Disabling them will overridetls_trust_fileandtls_fingerprint. WARNING: When the checks are disabled, TLS sessions will not be secure! πtls_priorities [priorities]β set priorities for TLS session parameters. The default is set by the TLS library and can be selected by using an empty argument to this command. The interpretation of the priorities string depends on the TLS library. Use--versionto find out which TLS library you use. π
For GnuTLS, see the section on Priority Strings in the manual. For libtls, the priorities string is a space-separated list of parameter strings prefixed with either PROTOCOLS=, CIPHERS=, or ECDHECURVES=. These parameter strings will be passed to the functions tls_config_parse_protocols, tls_config_set_ciphers, and tls_config_set_ecdhecurves. Unrecognized parts of the priorities string will be ignored. Example: "PROTOCOLS=TLSv1.3 CIPHERS=ECDHE-RSA-AES128-SHA256 ECDHECURVES=P-384". β¨
tls_host_override [host]β use a different host name for TLS host verification. By default, TLS host verification uses the host name given by thehostcommand. This command allows one to use a different host name for verification. This is only useful in special cases. π§tls_min_dh_prime_bits [bits]β deprecated, usetls_prioritiesinstead. Set or unset the minimum number of Diffie-Hellman (DH) prime bits accepted for TLS sessions. The default is set by the TLS library and can be selected by using an empty argument to this command. Only lower the default (for example to 512 bits) if there is no other way to make TLS work with the remote server. β οΈdelivery method method_arguments...β how to deliver messages received from this account. π¬delivery mda commandβ deliver the mails through a mail delivery agent (MDA). All occurrences of%Fin the command will be replaced with the envelope from address of the current message (orMAILER-DAEMONif none is found). Note that this address is guaranteed to contain only lettersa-zandA-Z, digits0-9, and any of".@_-+/", even though that is only a subset of what is theoretically allowed in a mail address. Other characters, including those interpreted by the shell, are replaced with"_". Nevertheless, you should put%Finto single quotes:'%F'. π«Ά
Use delivery mda /usr/bin/procmail -f '%F' -d $USER for the procmail MDA. π
Use delivery mda /usr/sbin/sendmail -oi -oem -f '%F' -- $USER to let your MTA handle the mail. π¨
Use delivery mda /usr/local/bin/msmtp --host=localhost --from='%F' -- $USER@`hostname`.`dnsdomainname` to pass the mail to your MTA via SMTP. (This is what fetchmail does by default.) β¨
delivery maildir directoryβ deliver the mails to the given maildir directory. The directory must exist and it must have the maildir subdirectoriescur,new, andtmp;mpopwill not create directories. This delivery type only works on file systems that support hard links. πdelivery mbox mbox-fileβ deliver the mails to the given file in mbox format. The file will be locked withfcntl(2).mpopuses the MBOXRD mbox format variant; see the documentation of the mbox format. πdelivery exchange directoryβ deliver the mails to the given Exchange pickup directory. The directory must exist. π¦
If the delivery method needs to parse the mail headers for an envelope from address (the mda method if the command contains %F, and the mbox method), then it needs to create a temporary file to store the mail headers (but not the body) in. ποΈ
uidls_file filenameβ the file to store UIDLs in. These are needed to identify new messages.%Uin the filename will be replaced by the username of the current account.%Hin the filename will be replaced by the hostname of the current account. If the filename contains directories that do not exist,mpopwill create them.mpoplocks this file for exclusive access when accessing the associated POP3 account. π
The default value is "~/.mpop_uidls/%U_at_%H". You can also use a single UIDLS file for multiple accounts, but then you cannot poll more than one of these accounts at the same time. π
only_new [(on|off)]β so by default mpop only grabs new messages, and "new" means the ones it hasn't already successfully retrieved in an earlier session. Flip this off and mpop will process all messages, no cap. πkeep [(on|offduration)]β keeps all your mail on the POP3 server, doesn't delete a thing. Obsessed with not losing stuff? Same.- If you give it a duration instead of
onoroff, then mails stick around for at least that long before getting deleted β and the clock starts the first time mpop sees the mails on the POP3 server. β³ - A duration is a string made of one or more time specs, formatted like
Ndfor N days,Nhfor N hours,Nmfor N minutes orNsfor N seconds, optionally separated by spaces. So1d12h,36h, and1d 11h 60mall mean the same 36 hours. Math girlies rise β¨ - Default behaviour: delete mails that have been successfully delivered or filtered by kill filters.
- If you give it a duration instead of
killsize (off|size)β mails bigger than size get deleted (unlesskeepsays otherwise, in which case they just get skipped). The size argument must be zero or greater. If it's followed by akor anm, the size is measured in kibibytes/mebibytes instead of bytes. Heads up: some POP3 servers report slightly wrong sizes for mails β see NOTES below. π- When
killsizeis set to0andkeepis set, then all mails get marked as retrieved but no mail gets deleted from the server. Which is lowkey a vibe for syncing the UID list on the client to the UID list on the server. π«Ά
- When
skipsize (off|size)β mails bigger than size get skipped (as in, not downloaded). The size argument must be zero or greater. If it's followed by akor anm, the size is measured in kibibytes/mebibytes instead of bytes. Same warning as above: some POP3 servers report slightly incorrect sizes for mails; see NOTES below. πfilter [command]β sets a filter that decides whether to retrieve, skip, or delete each mail by investigating the mail's headers. For this to work the POP3 server must support the POP3 TOP command β check option--serverinfoabove. An empty argument disables filtering. π₯- Every occurrence of
%Fin the command gets replaced with the envelope from address of the current message (orMAILER-DAEMONif none is found). Note that this address is guaranteed to contain only lettersa-zandA-Z, digits0-9, and any of".@_-+/"β even though that's only a subset of what's theoretically allowed in a mail address. Other characters, including the ones the shell would interpret, get replaced with"_". Still, you should put%Fin single quotes:'%F'. fr fr. - Every occurrence of
%Sin the command gets replaced with the size of the current mail as reported by the POP3 server. - The mail headers (plus the blank line separating the headers from the body) get piped to the command. Based on the return code, mpop decides what to do with the mail:
0: proceed normally; no special action1: delete the mail (unlesskeepsays otherwise); do not retrieve it2: skip the mail; do not retrieve it
- Return codes greater than or equal to
3mean an error occurred. Thesysexits.herror codes may be used to give info about the kind of error, but honestly that's not necessary. π
- Every occurrence of
received_header [(on|off)]β turns adding aReceivedheader on or off. By default mpop prepends aReceivedheader to the mail during delivery. This is required by the RFCs if the mail is subsequently further delivered e.g. via SMTP. Not optional, bestie, it's giving compliance. π
π¦ FILTERING π¦
There are three filtering commands available, and they run in this exact order:
killsize
skipsize
filter
If a filtering command applies to a mail, the remaining filters will not be executed. First one to call it wins, periodt. β
π EXAMPLES π
Configuration file
# Example for a user configuration file ~/.mpoprc
#
# This file focusses on TLS, authentication, and the mail delivery method.
# Features not used here include mail filtering, timeouts, SOCKS proxies,
# TLS parameters, and more.
# Set default values for all following accounts.
defaults
# Always use TLS.
tls on
# Set a list of trusted CAs for TLS. The default is to use system settings, but
# you can select your own file.
#tls_trust_file /etc/ssl/certs/ca-certificates.crt
# Deliver mail to an MBOX mail file:
delivery mbox ~/Mail/inbox
# Deliver mail to a maildir folder:
#delivery maildir ~/Mail/incoming
# Deliver mail via procmail:
#delivery mda "/usr/bin/procmail -f '%F' -d $USER"
# Deliver mail via the local SMTP server:
#delivery mda "/usr/bin/msmtp --host=localhost --from='%F' -- $USER"
# Deliver mail to an Exchange pickup directory:
#delivery exchange c:\exchange\pickup
# Use an UIDLS file in ~/.local/share instead of ~/.mpop_uidls
uidls_file ~/.local/share/%U_at_%H
# A freemail service
account freemail
# Host name of the POP3 server
host pop.freemail.example
# As an alternative to tls_trust_file, you can use tls_fingerprint
# to pin a single certificate. You have to update the fingerprint when the
# server certificate changes, but an attacker cannot trick you into accepting
# a fraudulent certificate. Get the fingerprint with
# $ mpop --serverinfo --tls --tls-certcheck=off --host=pop.freemail.example
#tls_fingerprint 00:11:22:33:44:55:66:77:88:99:AA:BB:CC:DD:EE:FF:00:11:22:33
# Authentication. The password is given using one of five methods, see below.
user joe.smith
# Password method 1: Add the password to the system keyring, and let mpop get
# it automatically. To set the keyring password using Gnome's libsecret:
# $ secret-tool store --label=mpop \
# host pop.freemail.example \
# service pop3 \
# user joe.smith
# Password method 2: Store the password in an encrypted file, and tell mpop
# which command to use to decrypt it. This is usually used with GnuPG, as in
# this example. Usually gpg-agent will ask once for the decryption password.
passwordeval gpg2 --no-tty -q -d ~/.mpop-password.gpg
# Password method 3: Store the password directly in this file. Usually it is not
# a good idea to store passwords in cleartext files. If you do it anyway, at
# least make sure that this file can only be read by yourself.
#password secret123
# Password method 4: Store the password in ~/.netrc. This method is probably not
# relevant anymore.
# Password method 5: Do not specify a password. Mpop will then prompt you for
# it. This means you need to be able to type into a terminal when mpop runs.
# A second mail box at the same freemail service
account freemail2 : freemail
user joey
# The POP3 server of your ISP
account isp
host mail.isp.example
auth on
user 12345
# Your ISP runs SpamAssassin, so test each mail for the "X-Spam-Status: Yes"
# header, and delete all mails with this header before downloading them.
filter if [ "`grep "^X-Spam-Status: Yes"`" ]; then exit 1; else exit 0; fi
# Set a default account
account default : freemail
Filtering with SpamAssassin
The command filter "/path/to/spamc -c > /dev/null" will delete all mails that SpamAssassin thinks are spam. Since no message body is passed to SpamAssassin, you should disable all body-specific tests in the SpamAssassin configuration file β for example set use_bayes 0. π§
If your mail provider runs SpamAssassin for you, you just have to check for the result. The following script can do that when used as an mpop filter:
#!/bin/sh
if [ "`grep "^X-Spam-Status: Yes"`" ]; then
exit 1 # kill this message
else
exit 0 # proceed normally
fi
Since the filter command is passed to a shell, you can also use this directly:
filter if [ "`grep "^X-Spam-Status: Yes"`" ]; then exit 1; else exit 0; fi
Using mpop with Tor
Use the following settings:
proxy_host 127.0.0.1
proxy_port 9050
tls on
Use an IP address as proxy host name, so that mpop does not leak a DNS query when resolving it. π΅οΈββοΈ
TLS is required to prevent exit hosts from reading your POP3 session. Do not skip this one, bestie. π
π FILES π
~/.mpoprcor$XDG_CONFIG_HOME/mpop/configβ Default configuration file.~/.mpop_uidlsβ Default directory to store UIDLs files in.~/.netrcandSYSCONFDIR/netrcβ The netrc file contains login information. Before prompting for a password,msmtpwill search it in~/.netrcandSYSCONFDIR/netrc. π
πΈ ENVIRONMENT πΈ
$USER,$LOGNAMEβ These variables override the user's login name.$LOGNAMEis only used if$USERis unset. The user's login name is used forReceivedheaders.
π AUTHOR π
mpop was written by Martin Lambers <marlam@marlam.de>. Other authors are listed in the AUTHORS file in the source distribution. Shoutout to the main character who built this. π
β SEE ALSO β
procmail(1), spamassassin(1), netrc(5) or ftp(1), mbox(5), fcntl(2)
and that's the whole page, bestie β you ate that π«Ά this beauty is from the 2026-07 era of MPOP(1), so go forth and fetch your mail with impeccable taste π β¨
π¦ where this page comes from
- arch rolling: mpop 1.4.23-1 Β· GPL-3.0-or-later
- nixpkgs unstable: mpop 1.4.23
- Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013, 2014 2015, 2016, 2018, 2019, 2020, 2021, 2022, 2023, 2024, 2025, 2026
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms