47 |
#include <mailutils/mutil.h> |
#include <mailutils/mutil.h> |
48 |
#include <mailutils/observer.h> |
#include <mailutils/observer.h> |
49 |
#include <mailutils/stream.h> |
#include <mailutils/stream.h> |
50 |
|
#include <mailutils/mu_auth.h> |
51 |
|
|
52 |
#define MESSAGE_MODIFIED 0x10000; |
#define MESSAGE_MODIFIED 0x10000; |
53 |
|
|
972 |
|
|
973 |
/* oops! We are still here */ |
/* oops! We are still here */ |
974 |
{ |
{ |
975 |
struct passwd *pw; |
struct mu_auth_data *auth = mu_get_auth_by_uid (getuid ()); |
976 |
const char *sender; |
const char *sender = auth ? auth->name : "unknown"; |
|
pw = mu_getpwuid (getuid ()); |
|
|
sender = (pw) ? pw->pw_name : "unknown"; |
|
977 |
n = strlen (sender); |
n = strlen (sender); |
978 |
if (buf && len > 0) |
if (buf && len > 0) |
979 |
{ |
{ |
980 |
len--; /* One for the null. */ |
len--; /* One for the null. */ |
981 |
n = (n < len) ? n : len; |
n = (n < len) ? n : len; |
982 |
memcpy (buf, pw->pw_name, n); |
memcpy (buf, auth->name, n); |
983 |
buf[n] = '\0'; |
buf[n] = '\0'; |
984 |
} |
} |
985 |
|
if (auth) |
986 |
|
mu_auth_data_free (auth); |
987 |
} |
} |
988 |
|
|
989 |
if (pnwrite) |
if (pnwrite) |