cancel
Showing results for 
Search instead for 
Did you mean: 

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
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.
Fred Martin_1
Valued Contributor

Re: sendmail / temp files

At any given moment on our system, I can issue the following:

# find /home -name [a-z][a-z][a-z].[0-9]*
/home/frp/frp.11382
/home/fas/fas.3996
/home/fgc/fgc.29648

These are all mail files that have been dropped into homes, as I described above.

I just made a huge discovery. The files are created when the users POP in to get mail, NOT when the mail is being delivered to their inbox.

I dropped several large emails into my own inbox, then when I clicked on my mail client's send-receive button 30 seconds later, the temp file appeared briefly.

Apparently, when an inbox is too large, or perhaps mailformed, I have issues.

Well, this happens with users on Outlook, Eudora and Thunderbird, so it's not the client at fault.

As mentioned, perhaps my /home area is too small and it's as simple as that.

I don't know anything about the processes involved when POP is is session.
fmartin@applicatorssales.com
Fred Martin_1
Valued Contributor

Re: sendmail / temp files

...although I'm learning :)

We're using FacetWin POP3, so the process fct_pop3d appears briefly when I pop in for mail from my PC.

I think I need to look at the FacetWin POP3 environment.
fmartin@applicatorssales.com
Fred Martin_1
Valued Contributor

Re: sendmail / temp files

Alas, docs are sparse. No mention of any temp files or temp directories, or anything configurable.

Only that FacetWin's POP3 is in compliance with RFC1460, Post Office Protocol - Version 3, June 1993.

I have a question, I started used FacetWin because in the old days HP-UX 9 & 10 didn't have a POP3d.

I'm running HP-UX 11.11, does it now?
fmartin@applicatorssales.com
Christopher Caldwell
Honored Contributor

Re: sendmail / temp files

I bet those temp files have something to do with your POP daemon. Look in the POP docs and your configuration to see where POP wants to write temp files (and mail spool files).

With most modern POP daemons, you've got good ability to control what goes where.

We usually set up a hierarchy outside of /var/mail or /home for POP, so that if things break, it's just POP breaking (e.g. /var/spool/pop).

Fred Martin_1
Valued Contributor

Re: sendmail / temp files

Yeah that's the right track, I figure. I've been looking, it doesn't appear that the FacteWin POP3d (our version circa 1999) is configurable enough that I can tell it to put temp files anywhere else.

If not, I'll have to increase /home to be quite large.

Or switch to another POP3d.
fmartin@applicatorssales.com
Christopher Caldwell
Honored Contributor

Re: sendmail / temp files

We've generally used qpopper from Qualcomm:
http://eudora.com/products/unsupported/qpopper/documentation.html

You've got to compile it. I bet there's a built version at the porting archive.
Fred Martin_1
Valued Contributor

Re: sendmail / temp files

Thanks folks, been scratching my head about this one for a long time, it's nice to have it narrowed down to the pop3 daemon, after thinking it was sendmail, all this time. Looks like more disk space in /home is what I'll try first.
fmartin@applicatorssales.com