Skip to content
  • This project
    • Loading...
  • Sign in

John McEleney / mailutils

Go to a project
Toggle navigation
Toggle navigation pinning
  • Projects
  • Groups
  • Snippets
  • Help
  • Project
  • Activity
  • Repository
  • Pipelines
  • Graphs
  • Issues 0
  • Merge Requests 0
  • Wiki
  • Network
  • Create a new issue
  • Builds
  • Commits
  • Issue Boards
  • Files
  • Commits
  • Network
  • Compare
  • Branches
  • Tags
Switch branch/tag
  • mailutils
  • examples
  • showmail.c
  • Sean 'Shaleh' Perry's avatar
    added showmail · 953d5e9e ...
    953d5e9e
    more mailbox cleanups
    Sean 'Shaleh' Perry authored 1999-10-09 01:13:07 +0000
showmail.c 379 Bytes
Raw Blame History Permalink
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
#include "mailbox.h"
#include <paths.h>

int main (int argc, char *argv[])
{
	mailbox *mbox;
	char *user;
	char *body;
	char mailpath[256];
	int i;

	user = getenv("USER");
	snprintf(mailpath, 256, "%s/%s", _PATH_MAILDIR, user);
	mbox = mbox_open(mailpath);
	for(i = 0; i < mbox->messages; ++i)
	{
		body = mbox_get_body(mbox, i);
		printf("%s\n", body);
	}
	mbox_close(mbox);
}