I'm not able to view my inbox mails, I'm using Thunderbird.
I have checked the /var/mail/ directory files. There I saw the lock file. [username.lock] .
I have removed the lock file and restarted the Thunderbird, again the lock file is created.
I have changed the file group as mail from users. after that also the lock file is created. and
I have restarted the machine. After re-booted the machine the file group has changes to users.
I'm not able to stop the lock file creations. I'm not able to access my inbox.
What is the problem ? How to solve this?
Hi all
I need help finding a process that is continuing to create files in the above area. There are three sub folder titled addr q.local and msg . I have already found a process called mmdf running and have used the kill command to stop this from running. I have also looked for sendmail or... (12 Replies)
Hello guys,
I'm in desperate need. I need to write a script that behaves like a "mail" shell program.
I've a base of the program -menu and so on, but what I cannot do is how to read messages from /var/mail/user. I would like to separate them as "mail" program does, but I;m just a newbie and... (21 Replies)
The mail file in the directory var/spool/mail is very large. Can I zero this (>) without losing any unopened mails there may be? There are about 10 mail accounts. Using RedHat Linux.
Thanks in advance. (0 Replies)
Dear All,
Now I use solaris 10 and I try to forward mail from /var/mail/username to their external mail so what should I do?
thank u in advance (2 Replies)
Hi,
How can i get my mail on either /var/spool/mail or /var/mail?
I use mail and sendmail command to send mail. But everytime I send mail it comes to my outlook inbox and when I check with mail command I get the message "No mail for siba". (Note siba is my user Id.) (2 Replies)
Hi all...
We have a box that receives a lot of incoming emails. I have a .procmailrc file that in turn invokes a python script, which process each of these incoming email. All is nice and good.
However, before the .procmailrc and python script were in place, we still were receiving emails and... (0 Replies)
please tell pre-requisite steps to activate cron. i activated the cron but it not executing the script which i set in crontab entry.through root user i passed the service crond start it get start.but when i go to etc/init.d and passed crond stop command.it gets crond: can't lock /var/run/crond.pid,... (2 Replies)
Hi all,
I have to test some user priviliges. The goal is to be sure that an unauthorized user can't restart some modules (ssh, mysql etc...).
I'm trying to automate it with a shell script but in same cases I got the syslog broadcast message.
Is there any way to simply get a return code... (3 Replies)
Hello
I have simple line of code here:
FILE *lockfp = fopen("/var/lock/subsys/processName", "w");
which is denied even running as root. The result is
locking failed for the following reason: Permission denied
How is this possible? Why is this happening?
Thanks for your... (4 Replies)
Discussion started by: flagman5
4 Replies
LEARN ABOUT DEBIAN
maillock
MAILOCK(3) Linux Programmer's Manual MAILOCK(3)NAME
maillock, mailunlock, touchlock - manage mailbox lockfiles
SYNOPSIS
#include <maillock.h>
cc [ flag ... ] file ... -llockfile [ library ]
int maillock( const char *user, int retrycnt );
void mailunlock( void );
void touchlock( void );
DESCRIPTION
The maillock function tries to create a lockfile for the users mailbox in an NFS-safe (or resistant) way. The algorithm is documented in
lockfile_create(3).
The mailbox is typically located in /var/mail. The name of the lockfile then becomes /var/mail/USERNAME.lock. If the environment variable
$MAIL is set, and it ends with the same username as the username passed to maillock(), then that file is taken as the mailbox to lock
instead.
There is no good way to see if a lockfile is stale. Therefore if the lockfile is older then 5 minutes, it will be removed. That is why the
touchlock function is provided: while holding the lock, it needs to be refreshed regulary (every minute or so) by calling touchlock () .
Finally the mailunlock function removes the lockfile.
RETURN VALUES
maillock returns one of the following status codes:
#define L_SUCCESS 0 /* Lockfile created */
#define L_NAMELEN 1 /* Recipient name too long (> 13 chars) */
#define L_TMPLOCK 2 /* Error creating tmp lockfile */
#define L_TMPWRITE 3 /* Can't write pid int tmp lockfile */
#define L_MAXTRYS 4 /* Failed after max. number of attempts */
#define L_ERROR 5 /* Unknown error; check errno */
NOTES
These functions are not thread safe. If you need thread safe functions, or you need to lock other mailbox (like) files that are not in the
standard location, use lockfile_create(3) instead.
These functions call lockfile_create(3) to do the work. That function might spawn a set group-id executable to do the actual locking if the
current process doesn't have enough priviliges.
There are some issues with flushing the kernels attribute cache if you are using NFS - see the lockfile_create(3) manpage.
FILES
/var/mail/user.lock,
/usr/lib/liblockfile.so.1
AUTHOR
Miquel van Smoorenburg <miquels@cistron.nl>
SEE ALSO lockfile_create(3), lockfile_touch (3), lockfile_remove(3)Linux Manpage 28 March 2001 MAILOCK(3)