Re: Hook in external programs

Sam Varshavchik <[email protected]>
Newsgroups gmane.mail.maildrop
Message-ID <[email protected]>
Marco writes:

> On 2013–01–22 Sam Varshavchik wrote:
>
> > There are a number of ways to invoke an external program. The cc
> > command, for example, can run an external program and pipe it the
> > entire message on standard input. Alternatively, the backticks also
> > execute an external program, but without piping the message to it.
> > If the result of the backticks expression is not assigned anywhere,
> > the output of the external program gets basically thrown away.
>
> Thanks. I tried this before, but it did not work. The reason is
> probable that maildrop passes a minimal environment to the command
> which does not include the necessary variables for notify-send to
> work (DBUS maybe??). A simple test with `touch somefile` works
> perfectly.

Then you need to figure out what environment variables are needed, and use  
the import command to import them from the parent environment.

However, that only works if they are present in the parent environment to  
start with. When maildrop gets executed by your mail server, your mail  
server has no knowledge of the desktop environment that you're currently  
running, or even if you're logged in at all, and it won't have your desktop  
environment.

This is, basically, how to execute an external program from maildrop. How to  
actually get it what it needs to run, you'll need to figure that one out.

------------------------------------------------------------------------------
Master Visual Studio, SharePoint, SQL, ASP.NET, C# 2012, HTML5, CSS,
MVC, Windows 8 Apps, JavaScript and much more. Keep your skills current
with LearnDevNow - 3,200 step-by-step video tutorials by Microsoft
MVPs and experts. ON SALE this month only -- learn more at:
http://p.sf.net/sfu/learnnow-d2d

_______________________________________________
Courier-maildrop mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/courier-maildrop
signature.asc (application/pgp-signature, 198 B)
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.13 (GNU/Linux)

iEYEABECAAYFAlEAh6sACgkQx9p3GYHlUOK99ACeI/e81m55IUGOVFCEWVUCZ05L
0D8An1vjPKbrDT79gUZUQtjailDF0+vY
=Azn0
-----END PGP SIGNATURE-----
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.