[SOLVED] Forward mail to script (pipe to stdout)

12 posts / 0 new
Last post
#1 Tue, 07/29/2008 - 10:12
kato

[SOLVED] Forward mail to script (pipe to stdout)

Hello!

One feature I've missed from using a homegrown qmail server is the ability to pipe emails out to a script. This has come in very handy with clients who want to upload special material or attachments and have them programmatically posted to their site.

This works as well in sendmail and procmail, as far as I know, using a .forward file with a | symbol. So I can do...

[code:1]|/var/scripts/convert_to_pdf.php[/code:1]

And the raw email message is literally piped to stdin of the php script.

I wouldn't be surprised to learn that virtualmin can already do something like this, but didn't see any obvious answers.

An intuitive place in the UI would be in the "Mail Forward Settings", in addition to "Deliver to This User Normally" and "forward to other addresses"... Just add a "Forward to script" with a field name for the script.

Best-<br><br>Post edited by: kato, at: 2008/08/01 08:23

Tue, 07/29/2008 - 17:24
Joe
Joe's picture

<div class='quote'>An intuitive place in the UI would be in the &quot;Mail Forward Settings&quot;, in addition to &quot;Deliver to This User Normally&quot; and &quot;forward to other addresses&quot;... Just add a &quot;Forward to script&quot; with a field name for the script.</div>

Already possible. Look at the Advanced form in any Email Alias page...there is a &quot;Feed to program&quot; option.

--

Check out the forum guidelines!

Tue, 07/29/2008 - 18:05 (Reply to #2)
kato

Sweet! Even with you telling me where it was, it took some time to figure out there will little tabs there for basic/advanced. I know it sounds silly, but I never noticed them.

In all likelihood, a few pixels of padding between them and the line above would make them stand out.

Tue, 07/29/2008 - 18:06 (Reply to #3)
kato

Aaaand you guys are awesome!

Tue, 07/29/2008 - 19:47 (Reply to #4)
Joe
Joe's picture

<div class='quote'>In all likelihood, a few pixels of padding between them and the line above would make them stand out.</div>

Yeah, those tabs aren't very nice, at the moment. The new theme gets them a bit nicer...I'm still working on it though.

I'll see about tweaking the current theme, a bit, though, to make those tabs look nicer--Jamie has a bit of UI blindness, and doesn't quite see when UI elements just don't look very good (and aren't entirely clear).

--

Check out the forum guidelines!

Wed, 07/30/2008 - 07:40 (Reply to #5)
kato

If you'd like some help developing themes, I work during the day as a usability engineer and UI designer :)

Sun, 06/07/2009 - 07:27 (Reply to #6)
Joe
Joe's picture

<div class='quote'>If you'd like some help developing themes, I work during the day as a usability engineer and UI designer :) </div>

Yes, si, jah, oui, &ETH;

--

Check out the forum guidelines!

Wed, 07/30/2008 - 14:13
kato

I don't know what sort of approach you're taking to the UI updates, but you might just consider simplifying the html as much as possible. Then you can take the <a href='http://www.csszengarden.com' target='_blank'>csszengarden</a> approach.

Their <a href='http://www.csszengarden.com/zengarden-sample.html' target='_blank'>html</a> is amazingly simple, as you can see, but they can produce some [url=http://www.csszengarden.com/?cssfile=/194/194.css&amp;page=2]brilliant[/..., [url=http://www.csszengarden.com/?cssfile=/204/204.css&amp;page=1]beautiful[/... designs out of it.

This approach would make it exceedingly simple for administrators to skin the product to their business model. The simplicity of the virtualmin interface (the lack of complex bells and whistles) would probably make it an easy approach to implement, even if the code is generating its own html content here and there, with a few wraps and tucks.

Wed, 07/30/2008 - 14:36 (Reply to #8)
Joe
Joe's picture

<div class='quote'>I don't know what sort of approach you're taking to the UI updates, but you might just consider simplifying the html as much as possible. Then you can take the csszengarden approach.

Their html is amazingly simple, as you can see, but they can produce some brilliant, beautiful designs out of it.</div>

That's, obviously, the approach I'd like to see. But the code does not currently permit that level of simplicity. It'll take dramatic modifications to <i>all</i> modules (all 100+ of the standard modules, plus a few hundred third party modules we have no control over) to make it possible to cleanly theme Webmin (and thus Virtualmin) entirely in CSS. Thus my struggle. ;-)

--

Check out the forum guidelines!

Fri, 08/01/2008 - 08:22 (Reply to #9)
kato

Is there a doc/src samples/info that I can look at on the modules? Oh right, I can download the GPL version, right? The source for that is available?

Fri, 08/01/2008 - 15:08 (Reply to #10)
andreychek

Hi Kato,

Yeah, you can see the full source for Virtualmin once you install it. You can find the GPL version here:

http://www.webmin.com/vinstall.html

Then look in /usr/libexec/webmin to view all the goodies!

There's also some documentation on writing Webmin modules here:

http://www.webmin.com/modules.html

Have a good one,
-Eric

Tue, 08/05/2008 - 08:31 (Reply to #11)
Joe
Joe's picture

As Eric mentioned, everything in Virtualmin has source available. We don't attempt to obfuscate it or make it unreadable. But, if you're working on APIs that you'd like to be really popular, targeting Virtualmin GPL is the way to go--it has tens (probably even hundreds) of thousands of users vs. a little over 1000 Virtualmin Professional users.

--

Check out the forum guidelines!

Topic locked