F10 and redirected root mails

Place to discuss Fedora and/or Red Hat
Post Reply
User avatar
Basher52
guru
guru
Posts: 919
Joined: Wed Oct 22, 2003 5:57 am
Location: .SE

F10 and redirected root mails

Post by Basher52 » Tue Dec 30, 2008 3:38 pm

so, in this version I have to remove the nightly email manually?
they dont get "deleted" to history anymore when Ive read them

User avatar
Void Main
Site Admin
Site Admin
Posts: 5716
Joined: Wed Jan 08, 2003 5:24 am
Location: Tuxville, USA
Contact:

Post by Void Main » Wed Dec 31, 2008 3:54 pm

Not sure what you mean. If you have root's mail forwarded to another account (via /etc/aliases) it doesn't also put a copy in root's local mail folder. It doesn't for me anyway but I'm sure I misunderstand the issue you are having.

User avatar
Basher52
guru
guru
Posts: 919
Joined: Wed Oct 22, 2003 5:57 am
Location: .SE

Post by Basher52 » Wed Dec 31, 2008 5:20 pm

what I mean is that I already read emails is still here
they usually automatically will be placed in the 'read' mailbox and not seen here

User avatar
Basher52
guru
guru
Posts: 919
Joined: Wed Oct 22, 2003 5:57 am
Location: .SE

Post by Basher52 » Fri Jan 09, 2009 12:49 am

Before I upgraded the system from F8, all mails that I read (froward from root to basher52) automatically would be placed the some history place so if I quit mail using 'q' and go in there again, I got a reply telling me that no mail was found, but now they all just are left in there.

Is this auto move not working or is it removed in F10 and if the later, how do I move them manually or if not move, delete them.

User avatar
Void Main
Site Admin
Site Admin
Posts: 5716
Joined: Wed Jan 08, 2003 5:24 am
Location: Tuxville, USA
Contact:

Post by Void Main » Fri Jan 09, 2009 1:03 am

How are you forwarding the mail? If you are forwarding root's mail to your account in /etc/aliases it should not even put a copy of the message in root's mail file. If you are reading your mail using the "mail" command you would use the "d" command to delete the messages. I think the change is in the /etc/mail.rc file. Probably the "set hold" line. The old default moved the messages from the spool file to root's ~/mbox file.

EDIT: Yep, I just commented out the "set hold" line and it goes back to the behaviour you describe. I forward all my root mail to my mail server and read it all with my normal mail reader so I never noticed because I don't normally use the mail command interactively any more.

User avatar
Basher52
guru
guru
Posts: 919
Joined: Wed Oct 22, 2003 5:57 am
Location: .SE

Post by Basher52 » Fri Jan 09, 2009 3:37 am

yeah, I use etc/aliases to forward root to my "normal" user and use that to read them and I also use the 'mail' command for that, I have no mail server. I only use this for checking the nightly things.

The text in mail.rc is funny :P

Code: Select all

[b]# Do not forward to mbox by default since this is likely to be
# irritating for most users today.[/b]
set hold
For me its more irritating that it won't auto "go away" when I read it lol
and it seems that since I forwarded the mails to the basher52 account it's in that accounts mbox it went after I read them.
And it's big too lol
1,335,954,387 bytes

can I just delete this file? or is there a "clean" utility for this?
haven't found anything...yet

User avatar
Void Main
Site Admin
Site Admin
Posts: 5716
Joined: Wed Jan 08, 2003 5:24 am
Location: Tuxville, USA
Contact:

Post by Void Main » Fri Jan 09, 2009 11:25 am

Well if you don't specifically delete the mail (d command) then it's not really going away when you read it. It's just being moved from the spool to the ~/mail file. You actually have to delete the messages for them to be removed. Just comment that one line out and it will work like it did before for you (moves to ~/mbox when read). If you remove the file it will just reappear the next time the mail package is upgraded. If you comment the line out an upgrade will not effect it.

User avatar
Basher52
guru
guru
Posts: 919
Joined: Wed Oct 22, 2003 5:57 am
Location: .SE

Post by Basher52 » Fri Jan 09, 2009 11:52 am

Just so I got all this right.

1st.
When I read a mail and then delete it it won't add to the mbox file and that is OK, since I only watch the mail one time.

2nd.
The best thing I think is to use the "new" type of handling it all, so I delete the mail and the mbox file wont grow, but how do I then "save" a mail "into" that file if I want to save it, but don't see it anymore unless I want to read the mbox file.

and 3rd.
Can I delete the mbox file since it so big without totally make the sendmail system to stop working or?
Last edited by Basher52 on Mon Jan 12, 2009 12:16 am, edited 1 time in total.

User avatar
Void Main
Site Admin
Site Admin
Posts: 5716
Joined: Wed Jan 08, 2003 5:24 am
Location: Tuxville, USA
Contact:

Post by Void Main » Fri Jan 09, 2009 12:02 pm

I usually just truncate the mail files if I want to wipe them out. For example if you want to truncate all mail from root's inbox as root you would:

Code: Select all

> /var/spool/mail/root
The above command gives the same result as if you were to type this (but shorter):

Code: Select all

cat /dev/null > /var/spool/mail/root
I wouldn't do any of what you are doing though and opt to redirect the mail to one of my normal mail accounts in /etc/aliases. Then the mail will never go to root's mail but go to your normal mailbox. There should be a line in /etc/aliases that starts with "root:" (it may be commented as an example). Assuming your server can send mail out just make it look something like:

Code: Select all

root:      basher@somewhere.com
Then run the "newaliases" command as root. That's it, now all of root's mail will be redirected to that email address.

Post Reply