clamsmtpd.conf(5)

πŸ’– clamsmtpd.conf πŸ’–

okay bestie so this whole page lives in the File Formats Manual (section 5, iykyk) and it's literally the entire guide to the config file that clamsmtpd(8) eats for breakfast πŸ“


✨ NAME ✨

clamsmtpd.conf β€” the configuration file for clamsmtpd(8) πŸŽ€


🌸 DESCRIPTION 🌸

so when clamsmtpd(8) boots up, it reads a config file. where that file lives depends on how you compiled clamsmtp, but fr fr it's usually hanging out in either /usr/local/etc/ or /etc/ πŸ’…

and if clamsmtpd(8) can't find its config file? it's gonna print a warning when it starts up, and it'll tell you the location it was expecting to find it in. no secrets here, she's transparent 😭

you can also point her at a totally different config file location by passing the -f argument to clamsmtpd(8) β€” iconic behavior honestly.

the settings go one per line. setting name comes first, then a colon, then the value. comments start with the # character and they get a line all to themselves. whitespace? ignored at the beginning of the line, at the end of the line, and around the colons. she does not care about your spacing 🌈

a sample config file can be found in the doc/ directory of the clamsmtp distribution. go look, it's there πŸ¦‹


πŸ‘‘ SETTINGS πŸ‘‘

the various settings are as follows, and yes we're going through all of them, no skips:

Action πŸ’₯

this one controls what clamsmtpd(8) does when it finds a virus. the options are:

  • bounce β€” bounce the email. in most cases this is not a good idea since many viruses spoof sender addresses πŸ™ˆ
  • drop β€” silently drop the email. Recommended.
  • pass β€” pass on the email. inserts an X-Virus-Infected header.
  • Default: drop

ClamAddress πŸ”Œ

specifies the address to connect to clamd(8) on. peep the syntax of addresses below.

  • Default: /var/run/clamav/clamd

a header to add to scanned messages. put an empty value to suppress adding a header. you can include the following special formatting characters in the string to include special values:

  • %i β€” Client IP Address
  • %l β€” Local IP Address
  • %d β€” Current Date

you can also include the standard \r or \n escapes. cute, right?

  • Default: 'X-Virus-Scanned: ClamAV using ClamSMTP'

KeepAlives 🫢

on slow connections the server will sometimes timeout before clamsmtpd(8) is finished scanning the file. this option sends NOOP's to the server to keep the connection alive. specify the number of seconds, or 0 to disable.

  • Default: 0

Listen πŸ‘‚

the address and port to listen for SMTP connections on. see syntax of addresses below.

  • Default: port 10025 on all local IP addresses

PidFile πŸ“Œ

specifies a location for the a process id file to be written to. this file contains the process id of clamsmtpd.conf and can be used to stop the daemon. if the -p argument is passed on the command line, then this setting will be ignored.

  • Default: none

Quarantine 🦠

quarantine files that contain viruses by leaving them in the TempDirectory directory. the file names look like this (where X is a random character or number): virus.XXXXXX

  • Default: off

MaxConnections 🚦

specifies the maximum number of connections to accept at once. clamd(8) also needs to be setup to accept at least this number of connections.

  • Default: 64

OutAddress πŸ“€

the address of the SMTP server to send email to once it's been scanned. see syntax of addreses below.

  • [ Required ] β€” yeah bestie, this one is not optional, she's mandatory πŸ’€

TempDirectory πŸ—‚οΈ

the directory to write temp files to. this directory needs to be accessible to both clamd(8) and clamsmtpd(8).

  • Default: /tmp

TimeOut ⏰

the number of seconds to wait while reading data from network connections.

  • Default: 180 seconds

TransparentProxy πŸͺ„

this option enables transparent proxy support, which allows you to route all SMTP traffic that's going through a gateway through clamsmtp which will then send it on to its final destination. this setup usually involves firewall rules which redirect traffic to clamsmtp, and the setup varies from OS to OS.

  • Default: off

User 🧚

the user to run as. if this option is specified then clamsmtpd(8) must be started as root. it will then drop root privileges and run as the specified user. the user can either be a name or a numerical user id.

  • [ Optional ]

VirusAction 🚨

this is a command to run when a virus is found. see the VIRUS ACTION section in clamsmtpd(8) for a discussion of this option.

  • Default: off

XClient πŸ“¨

send an XCLIENT command to the receiving server. this is useful for forwarding client addresses and connection info to servers that support this feature.

  • Default: off

🌈 ADDRESSES 🌈

addresses can be specified in multiple formats:

  • Unix local addresses can be specified by specifying their full path. (ie: /var/run/clamav/clamd).
  • IP addresses can be specified using dotted notation with a colon before the port number (ie: 127.0.0.1:3310).
  • IPv6 addresses are implemented but disabled. The code needs testing.

πŸ”₯ SEE ALSO πŸ”₯


⭐ AUTHOR ⭐

Stef Walter <stef@memberwebs.com>


and that's the whole page, bestie! πŸ’œ this one came to you straight from clamsmtp, dated September, 2004 β€” a classic, an icon, a legend. go forth and configure responsibly, mwah πŸ’…βœ¨ clamsmtp β€” September, 2004 β€” clamsmtpd.conf(5) πŸŽ€