The tellmail command line utilty

tellmail is a command
line utility that allows you to perform some administrative
tasks with SurgeMail such as adding users and domains to
locating a users mailbox. To use tellmail you just need to type
tellmail at the shell or command prompt. On Windows you can get
to the command prompt by going left clicking on the start
button, then program files, then accessories then command
prompt.

Migration commands

imap_import
<localuser@localdomain> <oldimaphost> <olduser>
<oldpass> <delete|keep> <create|nocreate>
pstat_delete user@xyz.com - Forget about the user so
it may re-import the user (dependent on other settings)

License commands

Mirroring

help

Lists the commands
you case use and a brief description

status

This gives you a ton of
information on the server.

reload

This allows you
reload SurgeMail without having to stop and restart it which
means it won't interrupt users that are currently online. Great
if you have edited surgemail.ini manually and need to activate
your changes without disrupting service.

shutdown

This simply tells
SurgeMail to shutdown.

queue

This displays the current delivery queue.

path <user@domain>

This allows you to find
where a users mailbox is stored on the disk.
example:

add_user <user@domain>

delete_user <user@domain>

This allows you to
delete users from SurgeMail. The deletion process is as follows.

Deletes user from
authentication database

Removes cache entry

Decreases
registration count

Decreases user count
for domain

Removes WebMail
files (tells webmail to)

Removes SurgeMail
files (users mail)

Removes aliases

Removes mailing list
subscriptions

Records them in
users_YYYYMMDD.rec

change_pass <user@domain>
<pass>

This allows you to
change users passwords easily.

add_user_alias <user>
<alias>

This allows you to add
aliases for users.

delete_user_alias <user>
<alias>

This allows you to
delete aliases for users.

add_domain <domain>

Adds a domain to
SurgeMail. This command makes use of the domain_defaults.txt
file specified here.

delete_domain <domain>

Deletes a domain from
SurgeMail.

clear_cache [user@domain]

This allows you to
clear SurgeMail's authentication cache.
Examples:
tellmail clear_cache - With no argument it will clear the entire
cache.
tellmail clear_cache test@localdomain - This will clear only
this users cache out
tellmail clear_cache *@domain2.com - Clears the cache for all
users at domain2.com

quota <user@domain>

Displays the users
current disk usage and their allowed quota.

logout <user@domain>

This will logout a user
that is currently connected to on IMAP or POP you can see the
current locks by using the tellmail
showlocks command

Example:
tellmail logout stu@blah.com

showlocks

This shows the current
software locks used by IMAP and POP in SurgeMail. When a user
logs into POP or IMAP SurgeMail creates a lock for that user to
prevent multiple connections to the same account.

expire

This starts the expire process.

expire_status

Gives the status on the expire process.

expire_user <user@domain>
<days> <bytes>

This expires mail in
the specified users INBOX, and optionally Trash folders based on
the specified criteria, you may specify an age in days and/or a
max size in bytes, any message exceeding these will be expired.

find_user <domain>
<field name > <field value >

This lets you search for a user or users that
match the criteria you have set.

To find out who is using friends
tellmail find_user foo.com friends true

To find users in a certain group
tellmail find_user foo.com mailaccess groupname

set_authfield fieldname file.txt
[apply]

This allows you to
apply new authent values for one field based on the text file
file.txt and fieldname the name of the field to change. Without
[apply] flag this is run in preview mode to see what changes to
the database would be made and run with [apply] flag to actually
make the changes.

user_send_max <user@domain>

Reports the number of
emails the user has sent in the last 24 hour period.

add_member <list>
<user@domain>

Adds the specified
email to the specified mailing list.

add_rules <file>

Reads <file>,
expects lines formatted:

email:rule

where "email" is the
users email address i.e. user@domain.com and "rule" is a user
exception rule formatted as expected in the users friend.rul
file (create some rules for a user to discover the format, it
can be different for different rules and we may change or extend
it in future).

This command will not
add duplicate rules. This command will only add rules for
existing users.

rescan_aliases_files

scan aliases.txt, make domuser.newdat

rescan_aliases

scans domuser.dat, make aliases.txt

list_rcpt

Attempts to list all valid receipt addresses for the server. Can
be run as:

You can use this command to import users from another serverm
this is for importing imap accounts.

The username and domain to which the account will be created
in surgemail

The ip of the server you are migrating the account from

The login name of the account on the server you are migrating
from.

The accounts password on the server you are migrating from

Whether you want to delete or keep the messages on the old
server

Whether you want the account created on the surgemail server,
unless you have already created the account this must be create.

Example:

old server: 10.0.0.5
old user account: fred
old account password: test
username and domain to create on surgemail: fred@mydomain.com

tellmail fred@mydomain.com 10.0.0.5 fred test keep create

activate <registration> [email
address]

This tells SurgeMail
to contact the netwinsite.com database and activate your
SurgeMail server.

deactivate <registration> [email
address]

This tells SurgeMail
to deactivate SurgeMail. You should do this if you are going to
move SurgeMail to a new machine and then can reactivate on the
new machine.

resync_config

This tells SurgeMail to send the config file to the other mirror,
you would run this on the machine that has the data you want
transferred.

resync_fast

This tells SurgeMail to
resend missing files to the slave, this uses a separate thread.
You run this on the machine that has the extra data, if both
machines for some reason have data that each other doesn't have
it is safe to run this command on both slave and master. This
command only sends data the other machine does NOT have, so is
considered a very safe command.

resync_nwauth

This resends NWAuth to
the other machine, usually run on the master, but if the master
had a disk crash and lost NWAuth you would run this on the
slave.

resync_config

This resends the
surgemail.ini to the other machine, usually run on the master,
but if the master had a disk crash and lost it's config you
would run this on the slave. This is required every
time you enable g_mirror_config, i.e. add it, or go from FALSE
to TRUE on either machine.

surgeplus

surgeplus is used for
doing various SurgePlus commands. use "tellmail surgeplus" for a
full list of SurgePlus commands. Some common surgeplus commands
are

tellmail surgeplus status - View current surgeplus
status

tellmail surgeplus rebuild - Delete cached client
downloads so they will be rebuilt next time a user tries to
download them. Useful if you have customized a SurgePlus image
file.