diff options
author | Bruce Guenter <bruce@untroubled.org> | 2007-10-09 10:08:11 -0600 |
---|---|---|
committer | Bruce Guenter <bruce@untroubled.org> | 2007-10-09 10:08:11 -0600 |
commit | 89a18d52833e65565031ed7a3cd61ff55fcfb151 (patch) | |
tree | 44ca7c828e78dcf4f9684cb78c80c0871e7841be | |
parent | bb508024b20ee63e9f99e13159969467ab7145e3 (diff) |
Added support for reporting the sender and recipients in mailq.
-rw-r--r-- | NEWS | 2 | ||||
-rw-r--r-- | src/mailq.cc | 12 |
2 files changed, 13 insertions, 1 deletions
@@ -2,6 +2,8 @@ This file lists all the major user-visible changes to nullmailer. ------------------------------------------------------------------------------- Changes in version 1.04 +- Added support for reporting the sender and recipients in mailq. + - Added a send timeout in nullmailer-send, to kill sending messages that stall. diff --git a/src/mailq.cc b/src/mailq.cc index 77ae525..b227aad 100644 --- a/src/mailq.cc +++ b/src/mailq.cc @@ -23,6 +23,7 @@ #include "defines.h" #include "fdbuf/fdbuf.h" #include "itoa.h" +#include "mystring/mystring.h" #include <dirent.h> #include <stdlib.h> #include <sys/stat.h> @@ -33,6 +34,8 @@ int main(int, char*[]) { + mystring line; + if(chdir(QUEUE_MSG_DIR)) fail("Cannot change directory to queue."); DIR* dir = opendir(QUEUE_MSG_DIR); @@ -52,7 +55,14 @@ int main(int, char*[]) fout << "?????"; else fout << itoa(statbuf.st_size); - fout << " bytes" << endl; + fout << " bytes"; + fdibuf in(name); + if (in.getline(line)) { + fout << " from <" << line << '>'; + while (in.getline(line) && !!line) + fout << "\n to <" << line << '>'; + } + fout << endl; } closedir(dir); return 0; |