masqmail.conf(5)

πŸ“¦ version 0.3.4, in ubuntu jammy

✨ NAME ✨

okay bestie, welcome to masqmail.conf(5) β€” the File Formats girlie. This is the manual page for the masqmail configuration file. Yes, masqmail.conf β€” masqmail configuration file. Periodt. πŸ’…

🌸 DESCRIPTION 🌸

This man page describes the syntax of the main configuration file of masqmail. Its usual location is /etc/masqmail/masqmail.conf. No cap.

The configuration consists of lines of the form:

val = expression

Where val is a variable name and expression a string, which can be quoted with double quotes ". If the expression is on multiple lines or contains characters other than letters, digits or the characters '.', '-', '_', '/', ';', '@', ':', it must be quoted. You can use quotes inside quotes by escaping them with a backslash. Slay.

Each val has a type, which can be boolean, numeric, string or list. A boolean variable can be set with one of the values on, yes, and true or off, no and false. List items are separated with semicolons ;. For some values, patterns (like *, ?) can be used. The spaces in front of and after the equal sign = are optional.

Most lists (exceptions: local_hosts, listen_addresses, query_routes.name and permanent_routes) accept files. These will be recognized by a leading slash /. The contents of these files will be included at the position of the file name, there can be items or other files before and after the file entry. The format of the files is different though, within these files each entry is on another line and the entries are not separated by semicolons. This makes it easy to include large lists which are common in different configuration files, so they do not have to appear in every configuration file.

Blank lines and lines starting with a hash # are ignored.


πŸ‘‘ OPTIONS πŸ‘‘

  • run_as_user = boolean β€” If this is set, masqmail runs with the user id of the user who invoked it and never changes it. This is for debugging purposes only. If the user is not root, masqmail will not be able to listen on a port < 1024 and will not be able to deliver local mail to others than the user.
  • use_syslog = boolean β€” If this is set, masqmail uses syslogd for logging. It uses facility MAIL. You still have to set log_dir for debug files.
  • debug_level = n β€” Set the debug level. Valid values are 0 to 6 and 9. Be careful if you set this as high as 5 or higher, the logs may very soon fill your hard drive. Level 9 enables printing of debug messages to stderr during reading of the config file. The debug file comes available for the first time after this step. Thus nothing but stderr is available. Level 9 is almost never interesting.
bestie, fr fr, do not set debug_level to 5+ unless you want your hard drive to become the main character for all the wrong reasons 😭
  • log_dir = file β€” The directory where logs are stored, if syslog is not used. Debug files are always stored in this directory if debugging is enabled. file must be an absolute path.

Default: /var/log/masqmail

  • mail_dir = file β€” The directory where local mail is stored, usually /var/spool/mail or /var/mail. file must be an absolute path.

Default: /var/mail

  • spool_dir = file β€” The directory where masqmail stores its spool files (and later also other stuff). It must have a subdirectory input. Masqmail needs read and write permissions for this directory. file must be an absolute path.

Default: /var/spool/masqmail

  • lock_dir = file β€” The directory where masqmail stores its lock files. Masqmail needs read and write permissions for this directory. By default it is a directory ``lock'' inside of spool_dir. file must be an absolute path.
  • host_name = string β€” This is used in different places: Masqmail identifies itself in the greeting banner on incoming connections and in the HELO/EHLO command for outgoing connections with this name, it is used in the Received: header and to qualify the sender of a locally originating message.

If the string begins with a slash /, it is assumed that it is a filename, and the first line of this file will be used. Usually this will be /etc/mailname to make masqmail conform to Debian policies.

It is not used to find whether an address is local. Use local_hosts for that.

Default: none; host_name MUST be set in the config file. not me forgetting this and wondering why everything is chaos πŸ’€
  • local_hosts = list β€” A semicolon ; separated list of hostnames which are considered local. Can contain glob patterns, like *example.org or mail?.*mydomain.net. Normally you should set it to "localhost;foo;foo.bar.com" if your host has the fully qualified domain name foo.bar.com.

Default: localhost ; <value of host_name cut at the first dot> ; <value of host_name>

Example: localhost;foo;foo.example.org (if you have set host_name to foo.example.org)

  • local_addresses = list β€” A semicolon ; separated list of fully qualified email-addresses which are considered local although their domain name part is not in the list of local_hosts. This list can be seen as an addition to local_hosts.

Further more only the local part of the addresses will be regarded, seeing it as a local user.

Example: local_addresses = "person1@yourdomain;person2@yourdomain"

This means mail to person1@yourdomain will effectively go to person1@localhost, if not redirected by an alias.

  • not_local_addresses = list β€” A semicolon ; separated list of fully qualified email-addresses which are considered not local although their domain name part is in the list of local_hosts. This list can be seen as a substraction to local_hosts.

This is the opposite of the previous case. The majority of addresses of a specific domain are local. But some users are not. With this option you can easily exclude these users.

Example:

local_hosts = "localhost;myhost;mydomain.net"
not_local_addresses = "eric@mydomain.net"
  • listen_addresses = list β€” A semicolon ; separated list of interfaces on which connections will be accepted. An interface ist defined by a hostname, optionally followed by a colon : and a number for the port. If this is left out, port 25 will be used.

You can set this to "localhost:25;foo:25" if your hostname is foo.

Note that the names are resolved to IP addresses. If your host has different names which resolve to the same IP, use only one of them, otherwise you will get an error message.

Default: localhost:25 (i.e. only local processes can connect)

  • do_save_envelope_to = boolean β€” If this is set to true, a possibly existing Envelope-to: header in an incoming mail which is received via either pop3 or smtp will be saved as an X-Orig-Envelope-to: header.

This is useful if you retrieve mail from a pop3 server with fetchmail, and the server supports Envelope-to: headers, and you want to make use of those with a mail filtering tool, e.g. procmail. It cannot be preserved because masqmail sets such a header by itself.

Default is false.

  • do_relay = boolean β€” If this is set to false, mail with a return path that is not local and a destination that is also not local will not be accepted via smtp and a 550 reply will be given. Default is true.
Note that this will not protect you from spammers using open relays, but from users unable to set their address in their mail clients. it's giving β€œnot a spam shield, bestie” 🫢
  • do_queue = boolean β€” If this is set, masqmail will not try to deliver mail immediately when accepted. Instead it will always queue it. (Note: Masqmail will always automatically queue mail if neccesary, i.e. if it cannot deliver because no suitable route was available for example.)

Same as calling masqmail with the -odq option. Usually you should leave this option unset.

Default: false

  • permanent_routes = list β€” Set this to the filename (or a semicolon-separated list of filenames) of the route configuration for always available connections. Main purpose is to define a mail server with mail_host in your local network, or if masqmail should send mail directly to the target host. If you have only a single host, you can leave it unset.

A setting local_nets = "*home.net" in versions <= 0.3.3 is in newer versions configured as: permanent_routes = "/etc/masqmail/homenet.route" and the route file homenet.route containing:

allowed_recipients = "*@*home.net"
connect_error_fail = true
resolve_list = byname

This is just as it had been with local_net_route, with the exception that the filtering for appropriate addresses is only in the route file and not with

part 1 ends right here, bestie β€” part 2 has the rest of permanent_routes and the rest of the page πŸ’–

local_nets. πŸ’–


✨ OPTIONS ✨ (still going, bestie, we're so close)

  • query_routes.name = list β€” swap name out for whatever you wanna call this connection. Set it to a filename (or a semicolon-separated list of filenames, yes really πŸŽ€) for the route config of that connection.

Routes like this one are not expected to be online all the time, okay? Masqmail is gonna query which of the routes are actually online. πŸ¦‹

The name is your lil handle β€” you use it to call masqmail with the -qo option every single time a connection to your ISP gets set up, so queued mail goes out through this route.

Example, and this one's cute: your ISP is called FastNet. So you write this line in the main config:

query_routes.FastNet = "/etc/masqmail/fastnet.route"

That /etc/masqmail/fastnet.route file is the route configuration file β€” see masqmail.route(5) for the tea β˜•. The moment a link to FastNet is set up, you call masqmail -qo FastNet. Masqmail reads the file you specified and sends the mails. slay. ✨

Also see online_query.

  • alias_file = file β€” point this at wherever your alias file lives. If it's not set, no aliasing happens at all. nothing. nada. πŸ’€

Default: <not set> (i.e. no aliasing is done)

  • caseless_matching = boolean β€” if you set this, aliasing and the matching for local_addresses and not_local_addresses will be done caseless. no cap. πŸ‘‘
⚠️ Note bestie: only change this option if the queue is empty, because correct processing of queued messages is not guaranteed otherwise. fr fr.

Default: false

  • pipe_fromline = boolean β€” if this is set, a from line gets prepended to the output stream whenever a pipe command is called after an alias expansion. Default is false.
  • pipe_fromhack = boolean β€” if this is set, every line that starts with From gets replaced with >From whenever a pipe command is called after an alias expansion. You probably want this if you set pipe_fromline up above. Default is false.
  • mbox_default = string β€” the default local delivery method. Can be mbox or mda. You can override it per-user with mbox_users or mda_users (see below πŸ‘‡).

Default: mbox.

  • mbox_users = list β€” a list of users who want delivery to an mbox style mail folder. πŸ’Œ
  • mda_users = list β€” a list of users who want local delivery to an mda. You have to set mda (see below) as well. don't forget or it's giving nothing.
  • mda = expand string β€” if you want local delivery handed off to an mda (Mail Delivery Agent), set this to a command. The argument gets expanded at delivery time, and you can use variables that start with a dollar sign $, optionally wrapped in curly braces. The variables you can use are:
    • uid β€” the unique message id. This is not necessarily identical with the Message ID as given in the Message ID: header. πŸ™ˆ
    • received_host β€” the host the mail was received from
    • ident β€” the user id of the sender if the message was received locally.
    • return_path_local β€” the local part of the return path (sender).
    • return_path_domain β€” the domain part of the return path (sender).
    • return_path β€” the complete return path (sender).
    • rcpt_local β€” the local part of the recipient.
    • rcpt_domain β€” the domain part of the recipient.
    • rcpt β€” the complete recipient address.

Example:

mda="/usr/bin/procmail -Y -d ${rcpt_local}"

For the mda, same as for pipe commands, a few environment variables get set as well. See masqmail(8). To use environment variables for the mda, the dollar sign $ has to be escaped with a backslash β€” otherwise masqmail will try to expand them with the internal variables. πŸ’…

  • mda_fromline = boolean β€” if this is set, a from line gets prepended to the output stream whenever a message is delivered to an mda. Default is false.
  • mda_fromhack = boolean β€” if this is set, every line beginning with From gets replaced with >From whenever a message is delivered to an mda. You probably want this if you set mda_fromline above. Default is false.
  • online_query = command line β€” defines the method masqmail uses to detect whether there's an online connection right now. πŸ”₯

Masqmail runs the command you give and reads from its standard output. The command should just print a route name, as defined with query_routes.name, to standard output and return a zero status code. Masqmail assumes it's offline if the script returns with a non-zero status. Leading and trailing whitespace gets removed from the output.

Simple example:

#!/bin/sh
test -e /var/run/masqmail/masqmail-route || exit 1
cat /var/run/masqmail/masqmail-route
exit 0

No matter how masqmail detects the online status, only messages that are accepted at online time will be delivered using the connection. The mail spool still needs to be emptied manually (-qoconnection). 😭

command line must start with an absolute path to an executable program. It can contain optional arguments.

To simulate the old online_method=file, use: /bin/cat /path/to/file

To be always online with connection foo, use: /bin/echo foo

To query a masqdialer server (i.e. asking it whether a connection exists and what its name is) use: /usr/bin/mservdetect localhost 224

  • errmsg_file = file β€” set this to a template that'll be used to generate delivery failure reports. Variable parts within the template begin with a dollar sign and are identical to those which can be used as arguments for the mda command, see mda above. Additional info can be included with @failed_rcpts, @msg_headers and @msg_body β€” these must be at the beginning of a line and will be replaced with the list of the failed recipients, the message headers, and the message body of the failed message.

Default is /usr/share/masqmail/tpl/failmsg.tpl.

  • warnmsg_file = file β€” set this to a template that'll be used to generate delivery warning reports. It uses the same mechanisms for variables as errmsg_file, see above.

Default is /usr/share/masqmail/tpl/warnmsg.tpl.

  • warn_intervals = list β€” set this to a list of time intervals at which delivery warnings (starting from the receiving time of the message) shall be generated. ⏰

A warning will only be generated just after an attempt to deliver the mail, and only if that attempt failed temporarily. So a warning may be generated after a longer time if there was no attempt before. lowkey makes sense.

Default is "1h;4h;8h;1d;2d;3d"

  • max_defer_time = time β€” this is the maximum time in which a temporarily failed mail will be kept in the spool. When this time is exceeded, it gets handled as a delivery failure and the message will be bounced. πŸ’€

The exceedance of this time will only be noticed if the message was actually tried to be delivered. If, for example, the message can only be delivered when online, but you have not been online for that time, no bounce will be generated.

Default is 4d (4 days)

  • log_user = name β€” replace name with a valid local or remote mail address.

If this option is set, then a copy of every mail that passes through the masqmail system will also be sent to the given mail address. πŸ‘‘

For example you can feed your mails into a program like hypermail for archiving purposes by placing an appropriate pipe command in masqmail.alias. cute AND useful.

  • max_msg_size = bytes β€” this option sets the maximum size in bytes masqmail will accept for delivery. This value is advertised to the SMTP client by the SIZE message during SMTP session setup. Clients pretending to send, or actually sending, more than bytes will get a 552 error message. 🚫

0 means no fixed maximum size limit is in force.

Default is 0 (= unlimited).

  • defer_all = boolean β€” if set to true, masqmail replies with 421 service temporarily unavailable to any SMTP request and shuts the connection down.
⚠️ Note: This option is for debugging purposes only.

Default: false


πŸ’« AUTHOR πŸ’«

Masqmail was written by Oliver Kurth. It is now maintained by Markus Schnalke <meillo@marmaro.de>. 🫢

You'll find the newest version of masqmail at http://marmaro.de/prog/masqmail/. There's also a mailing list β€” you'll find info about it at masqmail's main site. 🌈


πŸ› BUGS πŸ›</h3>

Please report bugs to the mailing list. πŸ™


🌸 SEE ALSO 🌸

masqmail(8), masqmail.route(5)


and that's the whole page bestie, you ate that πŸ’…βœ¨ this was masqmail-0.3.4 from 2012-01-18, filed under masqmail.conf(5) β€” go forth and configure, no cap πŸŽ€πŸ¦‹πŸ’–

πŸ“¦ where this page comes from