plugins: allow loading plugins regardless their filename

Instead of requiring that the name of the plugin must match the "internal"
name of the plugin, make it possible to load them regardless if they were
renamed or are loaded through a symlink.

Signed-off-by: Balazs Scheidler <bazsi@balabit.hu>
crypto: don't use apphooks to register/unregister crypto stuff

Use constructor/destructur functions instead.

Signed-off-by: Balazs Scheidler <bazsi@balabit.hu>
func_test: try to load modules from the libtool hidden directory

When running within the source tree, syslog-ng should load .so files
from within the libtool-created .libs directory, otherwise it'd be using
stale copies in the "install" dir.

This was discovered as now syslog-ng autoloads modules by default.

Signed-off-by: Balazs Scheidler <bazsi@balabit.hu>
afmongodb: hack to link afmongodb properly against OpenSSL

In case the glib version is too old, afmongodb requires linking against
libcrypto, however even though libmongo-client.la lists it as a dependency
that is not used when linking modules with libtool.

This patch is a hack, a better solution would be welcome, it unconditionally
links the afmongodb plugin against libssl and libcrypto in case the internal
copy is being used.

Signed-off-by: Balazs Scheidler <bazsi@balabit.hu>
Merge remote-tracking branch '3.3/master'
uuid: Introduce a new function to generate uuids.

The new function, available in "uuid.h" and libsyslog-ng-crypto, can
be used to generate UUID strings. It will either use a custom
implementation, when OpenSSL is available, or libuuid, if it's present
but OpenSSL is not.

If neither is present, it falls back to a dumb counter.

Signed-off-by: Gergely Nagy <algernon@balabit.hu>
tfuuid: New template function to generate UUIDs.

This patch adds a new template function: $(uuid), which can be used to
generate Universally Unique IDentifiers.

The use case for this is to add an UUID to each message as soon as
they're received, so that they can be identified later, accross
destinations. This allows me to pre-generate an ID for messages going
into mongodb, and send those messages to a different destination too,
with the same ID included.

Use it like this:

rewrite r_add_uuid { set("$(uuid)" value("uuid")); };
log { source(s_network); rewrite(r_add_uuid);
      destination(d_mongo); destination(d_program); };

Signed-off-by: Gergely Nagy <algernon@balabit.hu>
value-pairs: Do not require --rekey in the command-line parser.

The --rekey in the commandline parser is not needed, the various
transformation functions can work just fine without it, and do the
setup themselves, if so need be.

This patch gets rid of --rekey.

Signed-off-by: Gergely Nagy <algernon@balabit.hu>
afsmtp: New destination driver, to send mails via SMTP

This introduces the afsmtp destination driver, updated to the latest
3.4 conventions, and with all the threading bugs that were also
present in afmongodb too, fixed.

The driver itself uses libESMTP to send mail, and has the following
config syntax:

destination d_smtp {
 smtp(
  host("localhost") port(25)
  subject("ALERT! IMPORTANT EVENT FROM ${HOST}")
  header("X-Severity", "${SEVERITY}")
  from("no-reply@${HOST}.dummy")
  to("syslog-alerts@my.example.domain")
  bcc("big-brother@my.example.domain")
  cc("it@my.example.domain")
  reply-to("admin@my.example.domain")
 );
};

Signed-off-by: Gergely Nagy <algernon@balabit.hu>
Signed-off-by: Balazs Scheidler <bazsi@balabit.hu>