NAME
Reply-O-Matic - automatic e-mail reply system
SYNOPSIS
rom [ -h[n] ] [
-f <from> ] [
-b <message body file> ] [
-s <message subject> || -S ] [
-r <reply-to address> ] [
-c <copy response to> ] [
-d <deliver-to address> ] [
-a <file to attach> ] [
-t <attachment mime-type> ] [
-C [<chroot dir>] ] [
-u <uid> ] [ -g <gid> ] [
-U <uid> ] [ -G <gid> ] [
-R [<hours>] ] [ -v ]
DESCRIPTION
Reply-O-Matic is a full featured, secure
and easy to use auto-reply system that can be used in conjunction
with almost any Mail Delivery Agent, Mail Transport Agent or Local
Delivery agent.
PARAMETERS
Reply-O-Matic does not need a configuration file. All it
needs are some (or none) parameters to do all it's tricks:
- -v
- Show version and help text
- -h[n]
- Define who much of the original message will be on the reply.
Possible values for n include:
0 - Nothing of the original message will show on the
reply
1 - The headers of the original message will show on the
reply (default)
2 - The full original message will show as an attachment
on the reply
When -h1 is used, the headers will be send inline on the reply
message. -h2 will be a mime attachment.
- -f <from>
- Set the address that will be used on the From: header of the
reply message. Can be on any of the following formats:
-f user@address.com
-f "User Name <user@address.com>"
-f "user@address.com (User
Name)"
The last format is not recommended and is provided only
for legacy reasons.
Default: postmaster
- -b <message body file>
- This file defines the content of the reply message. It should
be a plain-text file, once the content is always plain/text. If you
need to send information on any other format, use the -a
parameter.
Default: internal text (Use the code, Luke)
- -s <message subject>
- Set the subject of the reply message
Default: "Reply-o-Matic auto response"
- -S
- Prefix the original message's subject with "RE: ", and use it
as the reply message subject line.
This parameter takes precedence over -s , and if both are
given, the value of -s is only used if there is no subject
line on the original message (fallback).
- -r <reply-to address>
- This address will show up in the Reply-To header of the reply
message, and will be used as the destination if someone try to
reply the message.
- -c <copy response to>
- This address will receive a copy of the reply message. The
original message sender will not be aware of this copy (blind
copy).
You can list more then one address using a comma separated list,
in one of the formats bellow:
-c user2@my.com
-c user3@otherdomain.com
-c "user3@otherdomain.com"
- -d <deliver-to address>
- Sometime, you want the sender to get an auto-reply, but also
want to receive the original message, or deliver it to someone
else. This is how you do it. It can take the same formats of the
-c parameter (comma separated list)
- -a <file to attach>
- The given file will be delivered as an attachment of the reply
message. The whole message will me converted to the multipart/mixed
MIME format. Unless otherwise specified with the -t
parameter, Reply-O-Matic will try to guess the mime using
/etc/rom/mime.types and /etc/mime.types, and checking for the file
extension. If the type cannot be determined,
application/octet-stream will be used.
Only the first -a parameter will be used. Any other is
discarded, and the occurrence will be logged.
- -t <attachment mime-type>
- This is how you define the mime-type of the attachment
delivered with the -a parameter. This parameter will
override the auto.
Only the first -t parameter will be used. Any other is
discarded, and the occurrence will be logged.
- -C [<chroot dir>]
- Make ROM run in a chroot environment. SEE
- -R [<hours>]
- Number of hours to wait before replying to the same originator
address. If a value is note given for -R, Reply-O-Matic will
wait for 1(one) hour.
Default: Don't wait
The rate limiting data file will be stored on the user homedir
as .rom_rates, unless the file /etc/rom/.rates/.uid-XXX (where XXX
is the users uid) exists. If both exists (or both don't), the file
on the user homedir will be used.
SECURITY CONSIDERATIONS for more details.
Default: /etc/rom
- -u <uid>
- Select the uid ROM will drop it's privileges to. ROM will never
run as root, so if you select 0, it will drop to the default value.
Default: 65534
- -g <gid>
- Select the gid ROM will drop it's privileges to. ROM will never
run with gid 0, so if you select 0, it will drop to the default
value.
Default: 65534
- -U <uid>
- Select the uid ROM will use to run the MTA/MDA
(/usr/sbin/sendmail). Selecting 0 will cause the privileges not to
be dropped. SEE SECURITY CONSIDERATIONS for more details.
Default: Don't drop
- -G <gid>
- Select the gid ROM will use to run the MTA/MDA
(/usr/sbin/sendmail). Selecting 0 will cause the privileges not to
be dropped. SEE SECURITY CONSIDERATIONS for more details.
Default: Don't drop
- IMPORTANT:
- As of 0.10.1, the last four parameters (-u, -g, -U and -G)
will only take effect if the calling user is root (real uid
= 0). Otherwise, ROM will drop it's privileges to that of
the calling user, INCLUDING when calling the
MTA/MDA.
IGNORING SENDERS
Reply-O-Matic now have the hability
to ignore specific senders. This is done by ways of a
.rom_ignores file on the user home directory. On this file
can be listed complete addresses (user@address.com) or domains
(@domain_to_ignore.com).
Ignored message will still be delivered if the -d parameter is
given.
USAGE
All data is received by ROM using the standard input.
So, there are two basic ways to use it.
- MDA/MTA
- Just add it on the aliases file (or equivalent), in a way it is
used as a pipe output (see EXAMPLES bellow).
- Local Delivery Agent It will depend on the
local delivery agent your system uses. In the EXAMPLES
section bellow we show it on procmail and the .forward
file.
EXAMPLES
On the MTA/MDA aliases file:
info: |/usr/sbin/rom
info2: |/usr/sbin/rom -S -b /etc/rom/auto_reply_text
info3: |/usr/sbin/rom -s 'Information Requested follows' -a
/etc/rom/info.pdf
support: |/usr/sbin/rom -S -d cli_sup@my.com -b
/etc/rom/information_received.txt -h2
On the .forward file:
|/usr/sbin/rom -s Vacation Notice -b /home/user/vacation.txt
-d
|/usr/sbin/rom -s The information you request -b
/home/user/info,txt -a /home/user/data.dat -h0
On the .procmailrc file:
:0
* Subject: REQ:
|/usr/sbin/rom -s Requested information follow -b
/home/user/powerinfo.txt -h0
SECURITY CONSIDERATIONS
Although Reply-O-Matic is
quite secure by itself, it can and will deliver any file given to a
-a or -b parameters. That is the way it is intended
to work. So, to give it a little edge on the side of security, it
will only accept regular files on these parameters. No
symlinks or devices (although hard links should still work). So you
might want to restrict who can use it. Also, it will not accept
bodyfile or attachment, if the filename start with a dot (.).
Reply-O-Matic now can run in a chroot environment, using
the -C parameter. Remember programs must have euid 0 to run
chroot, so make sure you make Reply-O-Matic suid root.
When running on a chroot environment, Reply-O-Matic
expects to find the mime.types file on the base dir of the chroot
environment. So, if you are using the default chroot dir
(/etc/rom/), make sure you copy your system mime.types file to
/etc/rom/mime.types.
One further notice is that Reply-O-Matic will drop it's
privileged as soon as possible, either to the values specified with
-u and -g, or it's default values (65534 for both). If you set any
of these values (-u and -g) to 0, Reply-O-Matic will reset
it to 65534, refusing to run as root.
-G and -U specify the uid and gid the MTA/MDA will run as. The
value 0 for -G or -U means not to drop the privilege (default).
This is because many times you will want to run the MTA/MDA as
root, so it will trust the user sending the e-mail.
Reply-O-Matic will run the MTA/MDA as root if no value or 0 is
given to -U, and it's setuid root.
As of 0.10.0, Reply-O-Matic can be set to paranoid mode
(recommended). See the PARANOID MODE section bellow for more
details.
One important point to notice is that Reply-O-Matic will
not reply to messages with the Precedence header field set to
"bulk" or "list". This is important so we don't send replies to
mailing lists, or to other Reply-O-Matic instances. It will
still deliver the message if -d is used.
PARANOID MODE
Paranoid Mode is what allows you to control
some potentially dangerous features of Reply-O-Matic ,
restricting some of it's functionality.
It's common knowledge that the author of this software hates the
create configuration files parsers. So, Reply-O-Matic uses a
very dirty trick to implement the Paranoid Mode.
Paranoid Mode is configured using the file /etc/rom/paranoid.
But instead of the content of the file, Reply-O-Matic will
check the file ownership to configure itself.
The owner of the file (uid) will have unrestricted access to all
functionalities. The group of the file (gid) is used for bitwise
configuration. Just add the values of the flags, and set the group
of the file to this value:
- 1
- Force chroot to ROM's default chroot directory (/etc/rom)
- 2
- Don't allow the setting of the user (-u and -U). ROM will use
it's defaults.
- 4
- Don't allow the setting of the group (-g and -G). ROM will use
it's defaults.
- 8
- Don't allow attachments (-a).
If you set the group to 0 , the paranoid mode will be
deactivated. The root user (uid=0) will always have full
functionality access, no matter if the paranoid file exists, and
it's owner.
The recommended ownership for /etc/rom/paranoid is
mail.15 (or mail.255, if you are really paranoid, and want to
activate paranoid modes that does not exist yet). Group 15 means
CHROOT + LOCKUID + LOCKGID + NOATTACH (1 + 2 + 4 + 8).
COMPATIBILITY
Reply-O-Matic will try to access
/usr/sbin/sendmail to deliver it's messages. Most MTAs/MDAs
provided this interface, once there are lots of softwares that
expect to find /usr/sbin/sendmail.
Reply-O-Matic was tested with sendmail ,
exim , postfix and qmail ; our primary
development platform was using exim.
FILES
- /usr/sbin/sendmail
- Used for mail delivery
- /dev/urandom
- Used to create random MIME delimiters
- /etc/mime.types, /etc/rom/mime.types
- Used to do mime-type auto-detection
- /mime.types
- Used to do mime-type auto-detectin on a chrooted environment
(the base directory of the chroot dir)
- /etc/rom/paranoid
- Paranoid mode configuration
- /etc/rom/.rates/*
- Directory to store reply rate limiting data (must be 1777) This
is legacy stuff. See bellow
- $HOME/.rom_rates
- File used to store reply rate limiting data (takes precedence
over /etc/rom/.rates/.uid-XXX (where XXX is the users uid)
- $HOME/.rom_ignores
- File with a list of addresses and/or domains to ignore (don't
reply to)
SEE ALSO
procmail(1)
(8)
(8)
postfix(8)
qmail(8)
your_MTA/MDA/LDA_manpage(X)