1832367 Members
3007 Online
110041 Solutions
New Discussion

/var/adm/syslog/mail.log

 
SOLVED
Go to solution
Ricky B. Nino
Frequent Advisor

/var/adm/syslog/mail.log

Hi,

Does the above mentioned file log success and failure activities related to email.

Just recently noticed that this file in my system is growing too fast.

please advise...
Opportunities expand for people willing to put time and effort into learning new skills.
8 REPLIES 8
eran maor
Honored Contributor
Solution

Re: /var/adm/syslog/mail.log

Hi

you are rigth .

you can delete the file with this action :


Note: You can manually run this procedure, or you can create
a cron job to perform these commands.

1. Stop the sendmail daemon:

/sbin/init.d/sendmail stop

2. Clear the log (or copy the log to another location):

cp /dev/null /var/adm/syslog/mail.log

3. Re-start the sendmail daemon:

/sbin/init.d/sendmail start

'syslogd' actually writes to the mail.log file. If the above operation
does not resolve the problem of writing to mail.log, then you should
signal syslogd to stop and re-start, forcing it to re-read its
configuration. You can do this by sending a hangup signal to the
syslogd process.

For example: kill -HUP `cat /etc/syslog.pid
love computers
Chris Wilshaw
Honored Contributor

Re: /var/adm/syslog/mail.log

Yes, it should log whether the mail was transmitted, postponed, held etc. In most cases of failure/delay it will give a reason why, although the actual details can be a little obscure.
Ricky B. Nino
Frequent Advisor

Re: /var/adm/syslog/mail.log

Hi Eran,

Does the procedure you have mentioned is the best practice to manage the file?

All,

Is there a way to filter the activities that needs to be log. For instance only activities that fails?

Thanks...
Opportunities expand for people willing to put time and effort into learning new skills.
Michael Tully
Honored Contributor

Re: /var/adm/syslog/mail.log

You can use the 'mailq' command to see what has not been delivered. To clear the mail log:

# /sbin/init.d/sendmail stop
# cp /dev/null >/var/adm/syslog/mail.log
# /sbin/init.d/sendmail start
Anyone for a Mutiny ?
eran maor
Honored Contributor

Re: /var/adm/syslog/mail.log

Hi

yes , it is the best method to do it .

the issue is that you must shutdown the sendmail deamon .

if you shutdown it you can trim the file also with SAM with the option :
SAM -> routine Task -> system log files
and choose to trim .

love computers
Fred Martin_1
Valued Contributor

Re: /var/adm/syslog/mail.log

I think the level of detail that sendmail places in the log file is configurable in sendmail:

O LogLevel=9

There's a comment header in my sendmail.cf that explains it in some detail.
fmartin@applicatorssales.com
Ricky B. Nino
Frequent Advisor

Re: /var/adm/syslog/mail.log

Hi Fred,

Have read the logging level in sendmail.cf. The configuration file does not have detailed discussion on the log level except for loglevel=9.

Just in case you have a better documention related to this let me know thru here.

Many Thanks...
Opportunities expand for people willing to put time and effort into learning new skills.
Jeff Schussele
Honored Contributor

Re: /var/adm/syslog/mail.log

Hi Ricky,

Another way to manage the mail.log files (and others as well) is to use SAM as follows:

Routine Tasks -> System Log Files

There you can set a recommended size & trim to that size or a percentage of it or even a line number. Of course you can trim it to zero as well. If sendmail is running SAM will mv the current file & create a zero size new mail.log & then you can do what you will with that copy.

Rgds,
Jeff
PERSEVERANCE -- Remember, whatever does not kill you only makes you stronger!