Link to home
Start Free TrialLog in
Avatar of bbbb44
bbbb44

asked on

mail: can't stat mailfile larger than 2gb

Hello,

I have a solaris 10 server running Oracle. The oracle app created a file larger than 2gb in /var/mail directory. when tried to run mailx under that user, it'll report:
mail: can't stat mailfile.

I believe this is a normal behavior for Oracle to create the log file in the /var/mail directory with larger than 2gb.

The Os is using vxfs so the 2gb file limitation should not be an issue.

example:

# pwd
/var/mail
# ls -lh
total 11266464
drwxrwxr-x   2 root     mail          96 Nov  9 13:56 :saved
-rw-rw----   1 test mail        2.4G Nov 10 13:30 test
-rw-------   1 ambi    other       2.0G Nov 10 14:44 ambi
-rw-rw----   1 root     mail        516K Dec 16  2009 root

# mail
mail: Cannot stat mailfile

If I remove the file(ambi), then I can send mail with no problem

# rm ambi

# pwd
/var/mail

# ls -lh
total 7072144
drwxrwxr-x   2 root     mail          96 Nov  9 13:56 :saved
-rw-rw----   1 test mail        2.4G Nov 10 13:30 test
-rw-rw----   1 root     mail        516K Dec 16  2009 root

# mail
No mail.


Please let me know if you need more info.

Thank You.

bb









Avatar of arnold
arnold
Flag of United States of America image

See if owner/group  is the issue.

chgroup mail /var/mail/ambi

i.e. if you create any file in /var/mail/filename where mail is not the group do you get the same issue.  
Is the file created by oracle has the correct format for a mailbox?

I think the normal location would be within $ORA_HOME/var/log
/var/mail should only have mailboxes created by MTA/MDA.
Avatar of bbbb44
bbbb44

ASKER

Hi,

I changed the group to mail, but the issue still there.

not sure what do you mean by correct format for oracle. when I create a file that's larger than 2gb for a test user, it'll also error out with the same error.

Is there any limitation that will prevent mailx to work if the file is larger than 2gb?

Thanks,

Bb
is the file that is being dropped/saved in /var/mail in a valid email mailbox format?

Only the MTA should be saving data in /var/mail nothing else should be saving files there if it is not a file in proper mailbox format.

/var/mail should not be used as a storage space for other applications.  Change the location where oracle saves whatever this file is to /opt/oracle/ or /var/oracle anywhere you want the file other than locations that have specific meaning/purpose.
Avatar of bbbb44

ASKER

I believe it's a typical  mail log created when oracle app sents out alert and it's just append to this log file.

Example:

User is testmail, when there’s no mailfile larger than 2gb, then it’s working fine:

-bash-3.00$ pwd
/var/mail
-bash-3.00$ ls -l
total 7072160
drwxrwxr-x   2 root     mail          96 Nov  9 13:56 :saved
-rw-rw----   1 oratest mail     2546647790 Nov 11 12:50 oratest
-rw-rw----   1 root     mail      528394 Dec 16  2009 root
-rw-------   1 mm other    1073741824 Nov 10 14:23  mm

-bash-3.00$
-bash-3.00$ id
uid=5011(testmail) gid=1(other)
-bash-3.00$ mail
No mail.                          <<<<<<<<<<<<<<<<<<<<<< it works when there’s no file larger than 2gb for testmail
-bash-3.00$


When created file larger than 2gb, then it’ll failed with error:

-bash-3.00$ pwd
/var/mail
-bash-3.00$
-bash-3.00$ mkfile 2g testmail
-bash-3.00$
-bash-3.00$ ls -l
total 11266480
drwxrwxr-x   2 root     mail          96 Nov  9 13:56 :saved
-rw-rw----   1 oratest mail     2546647790 Nov 11 12:50 oratest
-rw-------   1 testmail   mail    2147483648 Nov 12 10:38 testmail       <<<<<<<<<<<<<<newly created 2gb file
-rw-rw----   1 root     mail      528394 Dec 16  2009 root
-bash-3.00$
-bash-3.00$
-bash-3.00$ mail
mail: Cannot stat mailfile                <<<<<<<<<<<<<<<<<<< then it doesn’t work.


So, is there any limitation in the /var/mail directory?


Thanks for the reply.

bb
ASKER CERTIFIED SOLUTION
Avatar of arnold
arnold
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of bbbb44

ASKER

issue resolved.

thanks for the help

b4
Avatar of bbbb44

ASKER

acceptefd