Commit graph

4 commits

Author SHA1 Message Date
Tomi Ollila
ac46c6fdc2 smtp-dummy: clear sockaddr_in structure before use in bind()
Any junk bytes in sockaddr_in structure before passing that
to bind() system call may cause problems.
2011-11-12 07:48:00 -05:00
Carl Worth
b0ba84f9e7 smtp-dummy: Prefer return rather than exit() in main.
The main() function should be written as just another function with a
return value. This allows for more reliable code reuse. Imagine that
main() grows too large and needs to be factored into multiple
functions. At that point, exit() is probably the wrong thing, yet can
also be hard to notice as it's in less-frequently-tested exceptional
cases.
2011-06-22 06:38:33 -07:00
Dmitry Kurochkin
41a094624a Fix compilation warnings in test/smtp-dummy.c.
* Remove unused variables in main(): buf, bytes and greeting.
* Replace return with no value in main() with exit(3).
2011-06-22 06:38:33 -07:00
Carl Worth
102c57c825 test: Add test that emacs interface actually sends mail.
Rather than *reall* sending mail here, we instead have a new test
program, smtp-dummy which implements (a small piece of) the
server-side SMTP protocol and saves a mail message to the filename
provided. This gives us reasonable test coverage of a large chunk of
the notmuch+emacs code base (down to talking to an SMTP server with
the final mail contents).
2010-10-27 10:42:46 -07:00