Scalix 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
lsof –i:25 lsof –I:143 lsof -i :5733 ps -ef | grep postmaster
Users unable to VIEW the inbox content
Try the following steps.
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
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
Automated update via crontab
(this will update the filesd and restart spamassassin)
Update rules are located at:
Edit Spamassassin Whitelist and Blacklist
Entries should be of the form: whitelist_from firstname.lastname@example.org
vi /etc/mail/spamassassin/vi whitelist.cf
Entries should be of form: blacklist_from user@domainname
when whitelist and/or blacklist are modified…
- check for error: spamassassin –lint
- 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
- Check the ldapmapper and make sure it’s working.
- 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 |
CLEAN ROUTER QUEUE
echo -e “A$(( $(date +%d) + 10 ))E\nl\nrouter\n\n” |
omqdump -p |
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)
stop scalix normally, start scalix normally.
Maintenance in Scalix
/opt/scalix/bin/omdelu -n CN=FirstName LastName/G=FirstName/S=LastName/OU1=lcbmail
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)
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
-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
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
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 IA-FORMALemail@example.com (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
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