Operating System - HP-UX
1748211 Members
4771 Online
108759 Solutions
New Discussion юеВ

Re: sendmail / temp files

 
SOLVED
Go to solution
Fred Martin_1
Valued Contributor

sendmail / temp files

While it is delivering mail to a user, sendmail creates a temporary file in the user's home directory. It's named after the user and the process ID of (apparently) the instance of sendmail making the delivery:

/home/fred/fred.3254

The file normally is present only for a few seconds, if that.

On occasion, my /home file directory slams up to 100%, and I find that most users have many of these files left behind, causing the file system to fill. Most of the temp files left behind are essentially copies of the entire mail file for the user.

I've discovered over time, it is caused by a single user's email - someone taking delivery of a malformed or very large email. Recently I had this happen whne a user was taking delivery of a 2mb file every 5 or 10 minutes.

Not sure of the specifics of that, but it seems that sendmail is trying over and over to deliver something, each time creating a new temp file, then when the disk is too full, all users that take deliver of any email get the same problem.

Does anyone know any more about this specific problem? Anything I can do (I already have a filesize limit).

Fred
fmartin@applicatorssales.com
16 REPLIES 16
Steven E. Protter
Exalted Contributor

Re: sendmail / temp files

The easy answer is to increase the size of the /home filesystem.

You can redirect a certain users home elsewhere as well and this will solve the short term problem.

Messing around with where the mail system stores files will make it hard for others to udnerstand your system and let you take vacations and such.

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
Fred Martin_1
Valued Contributor

Re: sendmail / temp files

An update to this. It doesn't seem to be related to disk space for /var/mail. It seems to be related to the size of an individual's inbox.

Whenever the problem occurs there is always one inbox file that is over 2GB. Move it temporarily to another file system and the problem goes away.

So my original assessment is a little off.

It's not really an indivual email that causes this. Although, a very large incoming email is what usually puts the user's inbox over the top.

It then goes into what I'll call a 'crisis' mode, repeatedly copying the user's inbox to his home directory as I've already described.

Then it stars doing the same to other user's inboxes even if they're not large.
fmartin@applicatorssales.com
baiju_3
Esteemed Contributor

Re: sendmail / temp files

You can use the the attached script to trim /var/mail/username , mail boxes .

This script will trim the mailbox leaving the messages in the current month .




thx,
bl
Good things Just Got better (Plz,not stolen from advertisement -:) )
Steven E. Protter
Exalted Contributor

Re: sendmail / temp files

I have seen an authentication system with home directories that gets around this.

There is no /home filesystem, just a /home folder.

In that folder are soft links to NAS/SAN storage that has much more disk available than any local machine.

Assuming there is storage available on your network, this can allow large temporary files to be transmitted. As to why the mail system needs really huge files, I don't know, most systems do have attachment limits and anti-spam message queue limits.

Large files as you originally report should not come from the mail system.

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
Christopher Caldwell
Honored Contributor
Solution

Re: sendmail / temp files

I don't think the temp file in the home directory is normal.

The temp file should be a local delivery agent thing, not a sendmail thing.

Your local delivery agent is probably rmail (search for rmail in sendmail.cf).

[From man rmail] see if you can figure out what TMPDIR is when rmail attempts to deliver the mail locally.

==>When set, the TMPDIR environment variable ==>specifies a directory to be
==>used for temporary files, overriding the ==>default directory /tmp.

By default it's supposed to be /tmp.


/tmp/ma* Temporary file
<\SNIP>

If the environment variable is getting set to something else (e.g. a user's home directory), you might see unintended side effects.

Fred Martin_1
Valued Contributor

Re: sendmail / temp files

Well that is interesting. Currently Mlocal is in fact /usr/bin/rmail.

Man on rmail does mention TMPDIR but it's not defined in our environments.

Perhaps if undefined it defaults to /home/user, I'll have to read some more.

The idea that this is a local delivery thing instead of a sendmail issue, is something I hadn't considered. Thanks for that.

Fred
fmartin@applicatorssales.com
Geoff Wild
Honored Contributor

Re: sendmail / temp files

I agree with Chris - something is up with your configuration - I never get temp files in the home dirs...

How is mail delivered? does it go to a central server (like exchange)? Or do you just deliver locally?

Look at the DS macro in your /etc/mail/sendmail.cf file...

Rgds...Geoff
Proverbs 3:5,6 Trust in the Lord with all your heart and lean not on your own understanding; in all your ways acknowledge him, and he will make all your paths straight.
Fred Martin_1
Valued Contributor

Re: sendmail / temp files

sendmail is running on our unix box, and everyone getting mail has a unix account. Most people POP in to get mail, from a PC. Some use Pine from Unix. So everything is delivered locally.

We do have an anti-spam gateway (SpamLion) between the unix box and the internet. So, DS is defined as:

DSspamlion

However, this issue pre-dates the installation of the SpamLion gateway.
fmartin@applicatorssales.com
Geoff Wild
Honored Contributor

Re: sendmail / temp files

As far as rmail goes - that is the default in HP-UX - to use it that is.

All my servers have Mlocal as:

Mlocal, P=/usr/bin/rmail, F=lsDFMAw5:/|@qm9, S=EnvFromL/HdrFromL, R=EnvToL/HdrToL,


And I never see tmp files in the user home dirs...(that would be terrible if your root account is at the default home dir of / as you could fill up your root file system!).

Looking at the man rmail, I see nothing to indicate temp files in $HOME

Rgds...Geoff
Proverbs 3:5,6 Trust in the Lord with all your heart and lean not on your own understanding; in all your ways acknowledge him, and he will make all your paths straight.