LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Enterprise (https://www.linuxquestions.org/questions/linux-enterprise-47/)
-   -   stopping you have mail on Linux (https://www.linuxquestions.org/questions/linux-enterprise-47/stopping-you-have-mail-on-linux-860603/)

manoj.linux 02-03-2011 10:30 PM

stopping you have mail on Linux
 
Hi,

on server Red Hat Enterprise Linux AS release 3, I am getting the mail "you have mail" can any body suggest how to stop this? mail are getting generated in below path.

/var/spool/postfix/maildrop, due to which heavy file are getting generated.

though sendmail service is stopped.

Regards,

Manoj

xeleema 02-04-2011 12:20 AM

Greetingz!

Well, you could read your email and that would get rid of the error. Otherwise, if you're still getting email, it's just going to fill up the filesystem /var/spool/postfix/maildrop is on.
With that said, a quick google search would have told you that you can set "MAILCHECK=NO" in your shell and it will stop.
Temporarily Disable
export MAILCHECK=NO

Permanently Disable (Per User)
Add "MAILCHECK=NO" to the user's ~/.bashrc or ~/.bash_profile

Permanently Disable (Per System)
Add "MAILCHECK=NO" to the /etc/bashrc

If this (or anyother post) helps you out, be sure to mark it as such. Also, if your problem is solved, use "Thread Tools" to mark this as [SOLVED].

manoj.linux 02-06-2011 11:18 PM

Quote:

Originally Posted by xeleema (Post 4247901)
Greetingz!

Well, you could read your email and that would get rid of the error. Otherwise, if you're still getting email, it's just going to fill up the filesystem /var/spool/postfix/maildrop is on.
With that said, a quick google search would have told you that you can set "MAILCHECK=NO" in your shell and it will stop.
Temporarily Disable
export MAILCHECK=NO

Permanently Disable (Per User)
Add "MAILCHECK=NO" to the user's ~/.bashrc or ~/.bash_profile

Permanently Disable (Per System)
Add "MAILCHECK=NO" to the /etc/bashrc

If this (or anyother post) helps you out, be sure to mark it as such. Also, if your problem is solved, use "Thread Tools" to mark this as [SOLVED].

Thanks Xeleema for prompt response but still I am getting the mail.

xeleema 02-06-2011 11:42 PM

Do you want to stop the "You have mail" notice on your Xterms, or do you want to actually stop getting the email?

If you want to prevent the emails from being delivered to your account, you can do one of two things;

1) Find and stop whatever is email you.
(This would be the correct thing to do)

2) Try "echo some_other_valid_email@address.com >> ~/.forward"
This should redirect the email to an account you can check/access on a regular basis.

Note: If you're getting "logwatch" emails, and you want to stop them, just "chmod a-x" the logwatch script in /etc/cron.*

manoj.linux 02-07-2011 12:48 AM

Quote:

Originally Posted by xeleema (Post 4250457)
Do you want to stop the "You have mail" notice on your Xterms, or do you want to actually stop getting the email?

If you want to prevent the emails from being delivered to your account, you can do one of two things;

1) Find and stop whatever is email you.
(This would be the correct thing to do)

2) Try "echo some_other_valid_email@address.com >> ~/.forward"
This should redirect the email to an account you can check/access on a regular basis.

Note: If you're getting "logwatch" emails, and you want to stop them, just "chmod a-x" the logwatch script in /etc/cron.*

Thanks Xeleema, Actually My requirement is that the files which are getting generated hugely daily basis in folder /var/spool/postfix/maildrop shold be stopped.

xeleema 02-07-2011 01:19 AM

Sounds great. Stop the postfix service.

manoj.linux 02-07-2011 11:26 PM

Quote:

Originally Posted by xeleema (Post 4250540)
Sounds great. Stop the postfix service.

Hi Xeleema,

I have checked and not found any service related to postfix, I have checked with command service postfix stop, and inside /etc/init.d/ but there is no service such as postfix, but on server mysql and svn is configred,

how to trace where the path of /var/spool/postfix/maildrop is mentioned?

can you please suggest?

xeleema 02-11-2011 05:33 AM

Quote:

Originally Posted by manoj.linux (Post 4251513)
I have checked and not found any service related to postfix...

Just to be sure, go through every service on your system;
Code:

chkconfig --list
if you see anything that looks like mail (postfix, sendmail, and the like), make sure it's not turned on for RunLevels 3, 4, or 5.

Quote:

Originally Posted by manoj.linux (Post 4251513)
how to trace where the path of /var/spool/postfix/maildrop is mentioned?
can you please suggest?

It's not quite that easy, you could try "grep -Ri maildrop /etc" and that might give you a lead. However, odds are good there's a cron job that is emailing you.

Try typing "mailx" (might want to read the man page first) and see what is being emailed to you. That might also give you some insight as to what is sending you email.

Mr. C. 02-16-2011 09:14 PM

The maildrop directory is used by postfix when something is submitted via it's sendmail compatibility utility:

http://www.postfix.org/sendmail.1.html

This utility is configured (or hardcoded) into many other utilities - they call it directly to submit mail to the system.

When postfix is running, postfix will use the pickup utility to place it with the postfix delivery system. When it is not running, the files will remain in the maildrop directory.

You have to find the actual utility that is try to transmit its output via sendmail. Since you are not *running* postfix, but have it installed, look at the contents of the files in the maildrop directory to determine what utility is doing the actual submission. You'll obviously have to figure out which utility generates such output.


All times are GMT -5. The time now is 09:30 AM.