Re: dotqmail scripting
Eric Cox [EMAIL PROTECTED] wrote: Peter Samuel wrote: On Thu, 21 Sep 2000, Eric Cox wrote: Mail is delivered to [EMAIL PROTECTED] ~alias/.qmail-user1 contains: |script that writes a username into ~alias/.qmail-user2 user2 It would work but it's a woefully inefficient way to do it. Especially as qmail comes with a mechanism to do just this - /var/qmail/bin/forward. ~alias/.qmail-user1 contains: | forward `some_script_that_generates_new_addess(es)` See the man page. The man page says that forward is a wrapper around qmail-queue. Doesn't that mean the message makes two complete trips into and out of the queue, while the method I described is handled completely within qmail-local? Granted I haven't looked at the source yet, but what have I missed? You missed the fact that qmail-local calls qmail-queue to handle forwards. -Dave
Re: dotqmail scripting
On Sat, Sep 23, 2000 at 06:44:37PM -0700, Eric Cox wrote: Peter Samuel wrote: On Thu, 21 Sep 2000, Eric Cox wrote: Mail is delivered to [EMAIL PROTECTED] ~alias/.qmail-user1 contains: |script that writes a username into ~alias/.qmail-user2 user2 It would work but it's a woefully inefficient way to do it. Especially as qmail comes with a mechanism to do just this - /var/qmail/bin/forward. ~alias/.qmail-user1 contains: | forward `some_script_that_generates_new_addess(es)` See the man page. The man page says that forward is a wrapper around qmail-queue. Doesn't that mean the message makes two complete trips into and out of the queue, while the method I described is handled completely within qmail-local? Granted I haven't looked at the source yet, but what have I missed? You haven't missed anything. It could be faster. And the order does not matter as all forwards are done last. /magnus
Re: dotqmail scripting
On Thu, 21 Sep 2000, Eric Cox wrote: |script that writes a username into ~alias/.qmail-user2 user2 Peter Samuel wrote: | forward `some_script_that_generates_new_addess(es)` See the man page. On Sat, Sep 23, 2000 at 06:44:37PM -0700, Eric Cox wrote: The man page says that forward is a wrapper around qmail-queue. Doesn't that mean the message makes two complete trips into and out of the queue, while the method I described is handled completely within qmail-local? Your script has a race condition -- if two messages are being handled simultaneously, and going to different users, what happens? Also, the cost of putting a message in the queue is small compared to the cost of running a shell script. By the time you deal with your race condition, you've probably lost any "efficiency" gains. Finally, your script should have read myusername-user2, for the second line. -- Raul
Re: dotqmail scripting
Peter Samuel wrote: On Thu, 21 Sep 2000, Eric Cox wrote: Mail is delivered to [EMAIL PROTECTED] ~alias/.qmail-user1 contains: |script that writes a username into ~alias/.qmail-user2 user2 It would work but it's a woefully inefficient way to do it. Especially as qmail comes with a mechanism to do just this - /var/qmail/bin/forward. ~alias/.qmail-user1 contains: | forward `some_script_that_generates_new_addess(es)` See the man page. The man page says that forward is a wrapper around qmail-queue. Doesn't that mean the message makes two complete trips into and out of the queue, while the method I described is handled completely within qmail-local? Granted I haven't looked at the source yet, but what have I missed? Eric
Re: dotqmail scripting
On Thu, 21 Sep 2000, Eric Cox wrote: Mail is delivered to [EMAIL PROTECTED] ~alias/.qmail-user1 contains: |script that writes a username into ~alias/.qmail-user2 user2 It would work but it's a woefully inefficient way to do it. Especially as qmail comes with a mechanism to do just this - /var/qmail/bin/forward. ~alias/.qmail-user1 contains: | forward `some_script_that_generates_new_addess(es)` See the man page. -- Regards Peter -- Peter Samuel[EMAIL PROTECTED] http://www.e-smith.org (development)http://www.e-smith.com (corporate) Phone: +1 613 368 4398 Fax: +1 613 564 7739 e-smith, inc. 1500-150 Metcalfe St, Ottawa, ON K2P 1P1 Canada "If you kill all your unhappy customers, you'll only have happy ones left"
dotqmail scripting
Hey, I'm still having troubles with the dotqmail scripting. I can not go |scriptname as someone suggested since my script simple prints the email address the message is supposed to go to. Is there some way to use variables in the .qmail files? I want to do something like: `scriptname` to have it forward to a specific address. Can I do this with a simple script or am I going to have to reinject the message instead of redirecting it? thanks.
Re: dotqmail scripting
Thus spake Gary Richardson ([EMAIL PROTECTED]): I want to do something like: `scriptname` to have it forward to a specific address. Can I do this with a simple script or am I going to have to reinject the message instead of redirecting it? There is no 'or'. You can do this with a _simple_ script which reinjects the message. In terms of the design of qmail 'redirecting' _is_ a special case of 'reinjecting'. cheers, oec
Re: dotqmail scripting
On 20 Sep 2000, Gary Richardson wrote: Hey, I'm still having troubles with the dotqmail scripting. I can not go |scriptname as someone suggested since my script simple prints the email address the message is supposed to go to. Is there some way to use variables in the .qmail files? I want to do something like: `scriptname` Use this instead | forward `scriptname` forward is part of the qmail package. See man -M /var/qmail/man forward -- Regards Peter -- Peter Samuel[EMAIL PROTECTED] http://www.e-smith.org (development)http://www.e-smith.com (corporate) Phone: +1 613 368 4398 Fax: +1 613 564 7739 e-smith, inc. 1500-150 Metcalfe St, Ottawa, ON K2P 1P1 Canada "If you kill all your unhappy customers, you'll only have happy ones left"
Re: dotqmail scripting
Gary Richardson [EMAIL PROTECTED] wrote: I want to do something like: `scriptname` to have it forward to a specific address. Can I do this with a simple script or am I going to have to reinject the message instead of redirecting it? Reinject. It's not as painful as it sounds; read `man qmail-inject` or even `man mailsubj` for details. .qmail- files don't allow you to do quite what you want above. conredirect might suffice, but we don't know enough about what you want to accomplish. Charles -- -- Charles Cazabon [EMAIL PROTECTED] QCC Communications Corporation Saskatoon, SK My opinions do not necessarily represent those of my employer. --
Re: dotqmail scripting
Actually, I modified the script to just do the inject. That worked, but then I got an email about the already built 'forward'. I decided to switch to that since it is probably a whole lot more tested thanks guys. On Wed, 20 Sep 2000 11:37:57 -0600, Charles Cazabon said: Gary Richardson [EMAIL PROTECTED] wrote: I want to do something like: `scriptname` to have it forward to a specific address. Can I do this with a simple script or am I going to have to reinject the message instead of redirecting it? Reinject. It's not as painful as it sounds; read `man qmail-inject` or even `man mailsubj` for details. .qmail- files don't allow you to do quite what you want above. conredirect might suffice, but we don't know enough about what you want to accomplish. Charles -- -- Charles Cazabon [EMAIL PROTECTED] QCC Communications Corporation Saskatoon, SK My opinions do not necessarily represent those of my employer. --