Administering mail.

Check for Errors

1. cat /var/log/messages |grep username
2. cat /var/log/maillog |grep username

Edquota (cobalts)

1. cat /var/log/messages |grep username
a. if error is “quota exceeded”, then:
2. edquota username
a. edit hard
b. i then 1
c. 😡

Check for large domain mail (cobalts)

1. open Cobalt server
2. cd /var/spool/mail
3. ls -l username
4.
5. mail -f username
6. q = quit

Delete mail from server (cobalts)

1. open Cobalt server
2. cd var/spool/mail
3. mail -f username
4. d#-#
5. q

Test mail delivery

1. mail -v user@domain.com
2. . to end the message

Create an Alias

1. finger -m username
2. copy username
3. vi /etc/mail/aliases or vi /etc/aliases
4. Search for the username to see if there are any existing. If not, page to the bottom of the Users section and add a new line.
5. alias:current_username

2004 – We need an email aliases file copy on lincoln which will act as the plat agent and mail server for our other domains. So I made a script /etc/mail/newaliases.sh which will transfer the aliases file from franklin to lincoln first and then run the system newaliases command.

So for the future change of aliases file, please run /etc/mail/newaliases.sh or under /etc/mail run “./newaliases.sh” instead of ?newaliases? after you vi the file /etc/mail/aliases.

Delete mail from server (franklin)

1. SSH to franklin
2. cd var/mail
3. mail -f username
4. d#-#
5. q

Forward Mail

6. finger -m username
7. copy username
8. cd /usr/home/username
a. if no dir: mkdir username
9. vi .forward
10. type address mail is being forwarded to
11. 😡
12. finger -m username (to verify)

Example: Forward Existing Mail (only if both are on the same server)

rm user1
cp user2 user1
chown user1 user1
mail -f user1

Unforward Mail

1. cd /usr/home/username
2. rm .forward
3. finger -m username to verify

Remove POP Lock (cobalts)

1. cd /var/spool/mail
2. ls -l .*.pop
3. If pop file is greater than 0:
a. mv .username.pop username
4. If pop file is 0:
a. rm .username.pop
5. chown username username
a. or chgrp if on franklin
6. mail -f username

Remove POP lock (franklin)

NOTE: ALL USERS CURRENTLY DOWNLOADING THEIR MAIL FROM FRANKLIN HAVE .*.pop FILES!!!

TO FIND POPLOCK:

ps aux |grep username
(this will return the process ID)

TO REMOVE POPLOCK ON FRANKLIN:

NOTE: When you move the popper file, it will have the wrong permissions. You must chgrp.

kill [pid]
THEN
mv .username.pop user
THEN
chgrp user username

OR, FOR THE SUPER PARANOID:

kill [poppernumber]
THEN
cp .username.pop user
THEN
chgrp user username
THEN
rm .username.pop

Tail

1. tail -f /var/log/messages
2. tail -f /var/log/messages |grep username
3. tail -f /var/spool/mail/username
OR
4. tail -f /var/log/maillog |grep username

Mail on Jeff 2

1. cd /var/mail
2. vi /etc/sendmail.cf
a. never edit this file!
3. finger user to find out where mail is being forwarded to

Mail file too large to open

Symptom: Mail file too big to open on mail server.

franklin# mail -f usrnm
/tmp: write failed, file system is full
/tmp: No space left on device

franklin# ls -l usrnm

-rw——- 1 usrnm user 154133131 Aug 16 15:42 usrnm

Check the temp directory on the target server, to see if it has enough room to open the mail file:

franklin# df
Filesystem 1K-blocks Used Avail Capacity Mounted on
/dev/sd0a 493982 54993 414289 12% /
/dev/sd0h 3002212 1340762 1511339 47% /usr
/dev/sp0a 53310540 22450676 28194336 44% /mail
mfs:17941 197583 103964 83739 55% /tmp

franklin#

On the mail server:

[mushlette@cobalt mail]$ ftp server.lisco.com
ftp> bin
200 Type set to I.
ftp> put username
ftp> quit

On carter:

cd /usr/home/mushlette
ls
mail -f username
delete big messages

On the mail server:

ftp> bin
200 Type set to I.
ftp> get username
local: username remote: username
200 PORT command successful.
150 Opening BINARY mode data connection for ‘username’ (7055257 bytes).
226 Transfer complete.
7055257 bytes received in 18.7 secs (3.7e+02 Kbytes/sec)
ftp> quit
221 Goodbye.
ls -l
total 6924
-rw-rw-r– 1 username home 5782 Aug 9 2000 index.html
-rw-r–r– 1 root home 7055257 Apr 17 10:53 username
cd /var/spool/mail
ls -l username
-rw-rw—- 1 username mail 102784928 Apr 17 10:39 username
cd /home/sites/home/users/username
chown username username
chgrp mail username
ls -l
total 6924
-rw-rw-r– 1 username home 5782 Aug 9 2000 index.html
-rw-r–r– 1 kachpop mail 7055257 Apr 17 10:53 username
mv username /var/spool/mail
cd /var/spool/mail

SMTP Error Log

Check for SMTP errors on cobalts, and dns servers:

cd /var/log
cat maillog |grep username

Check mailfile

ssh to pitbull

Check for Errors

cat /var/log/maillog |grep username

Location of user mail files

/home/mail/bmi.net/username

Manual delete (for when the web interface fails to remove the files):
rm -rf /home/mail/bmi.net/username/

Test mail delivery

1. mail -v user@domain.com
2. . to end the message

 

Comments are closed.