callremctl script

Following a request from Graham and Iain, we now have a script callremctl which can be set as a pipe command in the mail aliases file. The command essentially does:

/usr/bin/k5start -q -l 2m -U -f $keytab -- /usr/bin/remctl $server $service "`cat`"

And is used like:

  theon-trac: "|/disk/mailraid/scripts/callremctl -f /etc/mailremctl.keytab theon trac"

The "-f ..." is optional, and defaults to the above. The whole incoming message is passed to the remctl service as the last argument on the command line, running on the given server using the default or specified keytab, which usually end up as STDIN on the receiving end.

Note that essentially the incoming mail message is passed as a large string argument to remctl. There's probably a limit of 2MB, so may not be suitable for large messages.

At the receiving

... you could have something like this:

#include <dice/options/remctld.h>

!remctld.types mADD(wc)
remctld.services_wc ALL
remctld.exec_wc_ALL /usr/bin/wc
remctld.stdin_wc_ALL last
remctld.allow_wc_ALL pcre:^mailremctl/.*@INF\.ED\.AC\.UK  neilb@INF.ED.AC.UK gdutton@INF.ED.AC.UK
Note that in this case "wc" may well count the words in the received email, but the results won't go anywhere useful. You'd have to replace "wc" with your script to do what it needs to do with the incoming email.

-- NeilBrown - 04 Sep 2013

Topic revision: r3 - 18 Nov 2015 - 11:01:16 - NeilBrown
This site is powered by the TWiki collaboration platformCopyright © by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback
This Wiki uses Cookies