GPG-MAIL-TUBE(1) GNU Privacy Guard 2.4 GPG-MAIL-TUBE(1)

# [NAME](#NAME)

**gpg-mail-tube** - Encrypt rfc822 formatted mail in a pipeline

# [SYNOPSIS](#SYNOPSIS)

**gpg-mail-tube** \[*options*] *recipients*

# [DESCRIPTION](#DESCRIPTION)

**gpg-mail-tube** takes RFC-822 formatted mail on stdin and turns it into a PGP/MIME encrypted mail which is then written to stdout.

The recipients must be plain mail addresses (e.g. **foo@example.org**) and should in general list the To and Cc addresses contained in the mail.

# [OPTIONS](#OPTIONS)

**gpg-mail-tube** understands these options:

[**--verbose**](#verbose)

[**-v**](#v)

Enable extra informational output.

[**--quiet**](#quiet)

[**-q**](#q)

Try to be as quiet as possible.

[**--log-file *file***](#log)

Write log output to *file*. Use ‘*socket://*’ to log to a socket.

[**--no-stderr**](#no)

Suppresses all output to stderr. This is useful for callers which don't distinguish stdout and stderr. To get diagnostics the option **--log-file** can be used.

[**--header *name*=*value***](#header)

Add the mail header "*name*: *value*" to the output.

[**--setenv *name*=*value***](#setenv)

Put the given environment string into the environment of this process and of the called gpg. This option is required if there is no other way to set the environemt.

[**--as-attach**](#as)

[**-a**](#a)

Do not write a PGP/MIME mail but emit a simple body along with an attachment containing the encrypted body of the input mail. If the input was a plain text message a simple encrypted file will be attached. If the input was a multipart MIME message the encrypted file is of type message/rfc822.

[**--gpg *gpgcmd***](#gpg)

Use the specified command *gpgcmd* instead of **gpg**.

[**--vsd**](#vsd)

Use the gpg from a *GnuPG VS-Desktop®* AppImage. The AppImage is started if it is not running. A symlink named ‘*~/.gnupg-vsd/gnupg-vs-desktop.AppImage*’ needs to link to the actually to be used AppImage.

[**--version**](#version)

Print version of the program and exit.

[**--help**](#help)

Display a brief help page and exit.

# [EXAMPLES](#EXAMPLES)

The following options can be used in a local transport rule of the Exim MTA which assumes that that **check\_local\_user** has been used in the router.

```
transport_filter = /usr/local/bin/gpg-mail-tube --setenv HOME=${home} \


                   --no-stderr -- $pipe_addresses
```

For a remote transport the use of **size\_addition** and an explicit setting of the user and its home directory might be required.

# [DIAGNOSTICS](#DIAGNOSTICS)

The program returns 0 on a successful encryption or a non-zero value on error. Note that on error some output might have already been written to stdout.

# [SEE ALSO](#SEE_ALSO)

[**gpg**(1)](/man/os/gnupg/gpg.1),

The full documentation for this tool is maintained as a Texinfo manual. If GnuPG and the info program are properly installed at your site, the command

```
info gnupg
```

should give you access to the complete manual including a menu structure and an index.

2025-12-30 GnuPG 2.4.9

---

Document: gpg-mail-tube(1) from gnupg 2.4.9-r12 (Chainguard OS)
Source: https://github.com/gpg/gnupg
