Skip to content

Dorian's Blog

  • Home
  • Technology
  • Internet Marketing
  • Contact Me
Scalix Logo

Scalix Administration – Useful Commands

June 15, 2014February 16, 2012 by Dorian

Scalix LogoScalix is now a mature email server, reliable and powerful, that can accommodate environments with thousands of users.
Most of the tasks can be accomplished using the web interface, which is a nice and intuitive interface. However, not all the tasks needed for a day to day administration are available from the web interface.

Here are some command line Scalix administration commands for the daily use as an email administrator.

Check Scalix services from CLI

omstat –a
omstat –s

lsof –i:25
lsof –I:143
lsof -i :5733
ps -ef | grep postmaster

Users unable to VIEW the inbox content

Try the following steps.

Run:

 
omshowu -n username -f
This should give you the location of the user folder similar to this "~/user/g000038".
Go to /var/opt/scalix/ll/s/user/g000035 (in our case) and remove the "imap-cache" directory then restart the imap server (users will get logged off).
rm -r imap-cache

STOP and START IMAP
Restart IMAP service: omoff -d 0 -a IMAP & omon IMAP

Users unable to VIEW some of the inbox content

Ask the user to log off!!! AND to stay logged off until you finish!!!!
View which users are loged on: omstat -u all
View the process associated with that user: ps -ef | grep 55003 Where 55003 is the user id.
Kill the processes associated with that user: kill -9 “process id”
Fix the mailbox: omscan -Avfx -U “User Name”
Restart the scalix service: omshut -t3 && sleep 3 && omrc
(sxfixdref –f)

sxaa problems
Delete the user’s 3d files in the above folder (/var/opt/scalix/ll/s/user/g000035)

Issues with the web interface

Restart Tomcat and Apache2
/etc/init.d/scalix-tomcat stop
rcapache2 stop
rcapache2 start
/etc/init.d/scalix-tomcat start

CDA server not starting

omoff -d 0 -w cda 
omreset -o off cda

delete the lockfile, (if it exists):

rm /var/opt/scalix/ll/s/sys/omcda.lock  
 omon cda

SPAMASSASSIN problems

Location: /etc/mail/spamassassin
Important files:
Init.pre
Local.cf
V310.pre
V312.pre
Update-channels

Automated update via crontab

cat /etc/cron.daily/spamassassin-updates

(this will update the filesd and restart spamassassin)
Update rules are located at:
/etc/mail/spamassassin

Edit Spamassassin Whitelist and Blacklist

vi /etc/mail/spamasassin/whitelist.cf
Entries should be of the form: whitelist_from [email protected]

vi /etc/mail/spamassassin/vi whitelist.cf
Entries should be of form: blacklist_from user@domainname

when whitelist and/or blacklist are modified…

  1. check for error: spamassassin –lint
  2. restart spamd /etc/init.d/spamd stop and then /etc/init.d/spamd start

Check bounces email on Postfix
tail -f /var/log/mail | grep NOQUEUE

Troubleshoot sending or receiving

  1. Check the ldapmapper and make sure it’s working.
    /etc/init.d/ldapmapper status
    /etc/init.d/ldapmapper stop
    /etc/init.d/ldapmapper restart
  2. Check the sendmail daemon – make sure it’s working.
    ps aux |grep sendmail
    You should see two things: Accept connection and Queue control
    If you don’t see them, restart the service. Sometimes you need to create your own script for starting sendmail, instead of using the one that comes with the distribution.

Clean Scalix Queues

Service router queue, Internet Mail Gateway queue, Local Delivery queue.

CLEAN INTERNET MAIL GATEWAY QUEUE

 echo -e "A$(( $(date +%d) + 10 ))E\nl\nunix\n\n" |
  omqdump -p |
  ./clearq.pl |
  tee output

CLEAN LOCAL QUEUE
echo -e “A$(( $(date +%d) + 10 ))E\nl\nlocal\n\n” |
omqdump -p |
./clearq.pl |
tee output

CLEAN ROUTER QUEUE
echo -e “A$(( $(date +%d) + 10 ))E\nl\nrouter\n\n” |
omqdump -p |
./clearq.pl |
tee output

Always use a new file, output is a sample file name

Once done, de-activate scalix services , except omstmon, omsessd, queue.manager and RUN OMSCAN (this will synchronize the database)
omscan –Aqvfx
stop scalix normally, start scalix normally.

Maintenance in Scalix

Delete user

/opt/scalix/bin/omdelu -n CN=FirstName LastName/G=FirstName/S=LastName/OU1=lcbmail

Regular maintenance

omscan –Aaf (Select all areas for checking/scanning and fix)
omscan -Avuo3 -f (-A active – refreshes the omscan; -u each user; -o 0 output normal)
omscan -Avfx -U “User Name” (scans only one mailbox)
omscan -AavfxS

Refresh omscan to the latest results
omoff -d 0 scan (shutdown omscan)
omscan -Z (capital z) (reset omscan counters)
omon omscan (restart omscan)
omshowlog -f 10.05.07 -F 09:09:00 (-f date –F time) from “Date”, from “Time” (-t date –T Time) to “date” “time”
omscan -avfx – remove the orphans
omscan -AavfxS – active mode to check and fix any issues it can find – it doesn’t clear orphans
sxdu -hs (show actual mailbox space usage)

Clean up Users’ Mailboxes:

omtidyallu -Twr -a 100 –d -c -k (purges everyone’s trash and recovery directory) do not attempt unless you have to, (for example you are out of space on server) – this will delete all users’ email

omtidyu
-T folder[s] Defines which folders the following criteria is to be applied to:
i refers to the intray;
o refers to the outtray;
f refers to the filing cabinet;
w refers to the wastebasket (Deleted Items folder).
p refers to the pending tray; and (Sent Items – ?)
l refers to the List Area.
r refers to the Scalix Recovered Items folder.

Examples of Mainenance Cleaning in Scalix

omtidyu -B -u “user name” -k -T i -t “[SPAM]*” returns emails with the subject [SPAM] in the inbox
omtidyu -B -u “User Name” -d -k -T i -t “I Love You” removes all message with the subject.
omtidyu -B -u “User Name” -d -k -T i -a 365 deletes all the email older than 365 days
omtidyu -B -u “User Name” -d -T i -a 4 – moves the email messages in the Wastebasket
omtidyu -B -u “LCB Mailer” -d -k -T i deletes permanently all the messages in Inbox
omtidyu -B -u “User Name” -d -k -T iofwlrp -a 365

Import/Export mailboxes, backup, restore in Scalix

sxmboxexp –user “User Name” -a /mnt/temp/uname.mbox
sxmboximp -a /mnt/temp/uname.mbox –user ” Test User”

Scan mailbox for last login time

/root/sxlastlog.pl >lastlogin.txt
more /root/ lastlogin.txt
This could be tricky if you want to get the inactive mailboxes, since you won’t know the status of the redirected mailboxes.

Scan users’ mailbox for usage

Sxdu -sh

Show all mailboxes

omshowu –m all

Pull details of a specific mailbox

omshowu –m all | grep –i nameofindividual

View details of mailbox

omshow nameofindividual or authentication ID

Delete a duplicate account

omdelent -e local-unique-id=’ID’
omdelent -e g=given_name/s=surname

List, search users, mailboxes and email addresses

List number of users per country
omsearch -e S=* -m CNTRY >Email_list.txt
add additional attributes like name (/CN) or email address ( :
omsearch -e S=* -m CNTRY/CN/IA-FORMAL
omsearch -e S=* -m CNTRY/CN/IA-FORMAL
omsearch -e S=* -m CNTRY/CN/INTERNET-ADDR
omsearch -e S=* -m CNTRY/CN
or add all attributes:
omsearch -e S=* -m @all-attr@

per country list export to text file:
omsearch -s -e CNTRY=JP -m S/CN/IA-FORMAL >Japan_Users.txt

omshowatt for a list of attributes

omsearch -s -m CNTRY/G/I/S/CN/IA-FORMAL >list-of-users.txt

Search Accounts ibn Scalix

omsearch -e “G=<firstname>/S=<lastname>” -m @all-attr@

Search an Account If You Have the Email Address
omsearch -m @all-attr@ -e [email protected] (you can use * )

Read and Edit the Mailbox Rules in Scalix

sxaa –user username (get the active and inactive rules)
sxaa –user username –remove 501 (remove the rule with the reference 501)
sxaa –user username –off 600 (disable, without removing the rule with the ref 600)
sxaa –user username –on 600 (enable the rule with the ref 600)

Other Useful Commands in Scalix

ps –ax ( list of processes)
Top –p pidID (stats about specific process)

More info on the error from omshowlog
omsolve -n OM 16094

Search for content ZIP compressed logs on the fly
bzcat /var/log/mail-20070610.bz2 | grep -i webmaster | less –S

Find the abbreviated names for a Scalix service
omshowlvl –a –l

 

Not Related To Scalix But Useful

tcpdump -ni eth0 port 5729 -s 0 –A
watch -n1 cat /dev/vcs10 (see the logs on the tty10 console)

rdiff-backup a great utility to backup your system

Scalix Migration

Move users to other mail-nodes.
Note that you don’t need to specify your node if the user is in the default node. –o is old –n is new.
ommodu -o username -n “Firstname Lastname”/Parisnode

Related

Categories How To Tags -AavfxS, -f date, -hs, -n OM, -t date, -w cda omreset, –a –l, –A watch, –Aqvfx stop scalix, –d, –i nameofindividual View, –m, /etc/init.d/ldapmapper restart Check, /etc/init.d/spamd start Check, /etc/mail/spamassassin Important files, /mnt/temp/uname.mbox sxmboximp, /opt/scalix/bin/omdelu, /Parisnode, /root/ lastlogin.txt, /var/log/mail-20070610.bz2 | grep, /var/opt/scalix/ll/s/sys/omcda.lock, abbreviated names, active mode, actual mailbox space, additional attributes, addresses, Apache2 /etc/init.d/scalix-tomcat stop, areas, authentication ID Delete, blacklist, capital, case, Check Scalix services, checking/scanning, CLEAN INTERNET MAIL, CLEAN LOCAL QUEUE, CLEAN ROUTER QUEUE, clear orphans, CLI, CN=FirstName, CNTRY/CN/IA-FORMAL omsearch, CNTRY/CN/INTERNET-ADDR omsearch, CNTRY=JP, command, command line, connection, content, content ZIP, country list export, crontab cat, database, de-activate scalix services, default node, deletes, distribution, domain, domainname, duplicate account, echo, Edit Spamassassin Whitelist, email, Email Address omsearch, email addresses, email administrator, email messages, email omtidyu, emails, Enlnlocalnn, Enlnrouternn, Enlnunixnn, Entries, environments, error, Examples, filesd, filing cabinet, Firstname Lastname, following criteria, following steps, form, g=given_name/s=surname List, great utility, grep, grep NOQUEUE Troubleshoot, grep postmaster Users, hanmail.net vi /etc/mail/spamassassin/vi, how to, ibn Scalix omsearch, IMAP Restart IMAP, imap-cache STOP, IMPORTANT, inactive mailboxes, inactive rules, inbox content, inbox omtidyu, Init.pre Local.cf V310.pre, internet, internet mail gateway, intray, intuitive interface, issues, Items folder, LastName/G=FirstName/S=LastName/OU1=lcbmail Regular maintenance, latest results, LCB Mailer, line, line Scalix administration, lint restart spamd, list, List Area., List number, Local Delivery queue, location, lockfile, login time, logs, lsof, mail gateway queue, mailbox omshow nameofindividual, Mailbox Rules, Mainenance Cleaning, mature email server, message, need, new file, new. ommodu, old –n, omoff, omon cda SPAMASSASSIN, omon IMAP Users, omqdump, omrc, omsearch -s, omsessd, omshowatt, omshowlog, omstat –a omstat, omstmon, omtidyallu, outtray, Postfix tail, problems, process id, processes, Pull details, queen_213, queue.manager, recovery directory, refers, restart spamassassin, RUN OMSCAN, S=*, sample file, Scalix Delete user, Scalix Migration, Scalix omtidyu, Scalix ps, Scalix Queues Service, Scalix Recovered Items, Scalix service omshowlvl, Scalix sxaa, Scalix sxmboxexp, Scan mailbox, Scan users, script, search, search users, sending, sendmail daemon, space, SPAM, specific mailbox omshowu, specific process, start CDA server, status /etc/init.d/ldapmapper, subject. omtidyu, sxaa problems, sxfixdref –f, tasks, tee output CLEAN, Test User, things, time, troubleshoot, usage Sxdu, Useful Commands, Useful tcpdump, user folder, user id, user username, username, users, V312.pre Update-channels Automated, Wastebasket omtidyu, web interface, web interface Restart
PROTECT IP / SOPA Breaks The Internet
Centos Network Configuration – on a Barebones from Command Line
  • Privacy Policy
  • Contact Me
© 2025 Dorian's Blog • Built with GeneratePress