Welcome, Guest
Please Login or Register.
Lost Password?
[SOLVED] Forward mail to script (pipe to stdout) (1 viewing)
Post Reply

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

#15194
kato (User)
Posts: 120
graphgraph
[SOLVED] Forward mail to script (pipe to stdout) 2008/07/29 10:12  
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:

|/var/scripts/convert_to_pdf.php



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-

Post edited by: kato, at: 2008/08/01 08:23
Operating system CentOS Linux 4.6
Webmin version 1.420
Virtualmin version 3.60 (Pro)
Kernel and CPU Linux 2.6.9-67.0.22.ELsmp on i686
  The administrator has disabled public write access.
#15201
Joe (Admin)
Posts: 4124
graph
Re:Forward mail to script (pipe to stdout) 2008/07/29 17:24  
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.

Already possible. Look at the Advanced form in any Email Alias page...there is a "Feed to program" option.
  The administrator has disabled public write access.
#15204
kato (User)
Posts: 120
graphgraph
Re:Forward mail to script (pipe to stdout) 2008/07/29 18:05  
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.
Operating system CentOS Linux 4.6
Webmin version 1.420
Virtualmin version 3.60 (Pro)
Kernel and CPU Linux 2.6.9-67.0.22.ELsmp on i686
  The administrator has disabled public write access.
#15205
kato (User)
Posts: 120
graphgraph
Re:Forward mail to script (pipe to stdout) 2008/07/29 18:06  
Aaaand you guys are awesome!
Operating system CentOS Linux 4.6
Webmin version 1.420
Virtualmin version 3.60 (Pro)
Kernel and CPU Linux 2.6.9-67.0.22.ELsmp on i686
  The administrator has disabled public write access.
#15211
Joe (Admin)
Posts: 4124
graph
Re:Forward mail to script (pipe to stdout) 2008/07/29 19:47  
In all likelihood, a few pixels of padding between them and the line above would make them stand out.

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).
  The administrator has disabled public write access.
#15226
kato (User)
Posts: 120
graphgraph
Re:Forward mail to script (pipe to stdout) 2008/07/30 07:40  
If you'd like some help developing themes, I work during the day as a usability engineer and UI designer :)
Operating system CentOS Linux 4.6
Webmin version 1.420
Virtualmin version 3.60 (Pro)
Kernel and CPU Linux 2.6.9-67.0.22.ELsmp on i686
  The administrator has disabled public write access.
#15246
Joe (Admin)
Posts: 4124
graph
Re:Forward mail to script (pipe to stdout) 2008/07/30 13:17  
If you'd like some help developing themes, I work during the day as a usability engineer and UI designer :)

Yes, si, jah, oui, Да, sì, etc.

Yeah, we could use a little help on the usability front. Unfortunately changes are currently extremely difficult to push out. The UI is practically hard-coded in a large number of modules...so changes to the UI library do nothing to those modules. And even stuff that is using the UI library requires pretty huge effort to make dramatic changes to--so many aspects of presentation are defined by the code rather than the UI library that if I were to change something dramatically in ui-lib, it would break the layout in the modules. I'm making progress on that front, and Jamie is getting some sanity about the UI lately, but it's going to be a long time before UI changes can happen just in the ui-lib. Until then, we're putting band-aids on everything that is obviously wrong.
  The administrator has disabled public write access.
#15247
kato (User)
Posts: 120
graphgraph
Re:Forward mail to script (pipe to stdout) 2008/07/30 14:13  
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.

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.
Operating system CentOS Linux 4.6
Webmin version 1.420
Virtualmin version 3.60 (Pro)
Kernel and CPU Linux 2.6.9-67.0.22.ELsmp on i686
  The administrator has disabled public write access.
#15249
Joe (Admin)
Posts: 4124
graph
Re:Forward mail to script (pipe to stdout) 2008/07/30 14:36  
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.


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 all 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. ;-)
  The administrator has disabled public write access.
#15310
kato (User)
Posts: 120
graphgraph
Re:Forward mail to script (pipe to stdout) 2008/08/01 08:22  
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?
Operating system CentOS Linux 4.6
Webmin version 1.420
Virtualmin version 3.60 (Pro)
Kernel and CPU Linux 2.6.9-67.0.22.ELsmp on i686
  The administrator has disabled public write access.
Post Reply
get the latest posts directly to your desktop

Talk and Get Help

Support
Forums
Bugs and Issues

Get Virtualmin

OS Support
Buy Online
Download
Copyright 2005-2007 Virtualmin, Inc. All rights reserved.