RE: forwarding to a dynamic / variable address ??
Hmm. Well, you could set up a .qmail-default file in xyz's directory that has this: | find_and_forward.pl where find_and_forward.pl is your perl script that dynamically finds the forward address for xyz. Then in order to actually forward the message just read <> into a variable (say, $message) and inject that into qmail with qmail-inject which, in perl, would look something like this: $mail_prog = '/var/qmail/bin/qmail-inject'; $mail = "To: $to_name <$to_email>\r\n"; $mail .= "From: $from_name <$from_email>\r\n"; $mail .= "Subject: $subject\r\n\r\n"; $mail .= "$message\r\n"; system ("echo '$mail' | $mail_prog"); Obviously the $to_email came from your SQL database search and you can either parse the message for the $subject or fudge your own. Better methods than this? I'm sure there are several but this is what immediately comes to mind. Brett. -Original Message- From: Kim Chr. Hvidkjaer [mailto:[EMAIL PROTECTED]] Sent: Thursday, May 03, 2001 10:38 AM To: [EMAIL PROTECTED] Subject: forwarding to a dynamic / variable address ?? Hello All, I'm trying to do a forwaring-service, where the users each have an address (ie [EMAIL PROTECTED]) and any mail sent to this address is forwarded to their _actual_ address (perhaps a hotmail-address or similiar). I know how to forward (& [EMAIL PROTECTED]) but how do I do it dynamically? I can do a php or perl-script that will digg out the needed to-address from my mySql-database, but don't know how to do the actual forwarding?? any help is greatly appriciated! (I've subscribed to the list, but am not getting any mail yet, so please cc: [EMAIL PROTECTED]) // Kim [EMAIL PROTECTED]
RE: forwarding to a dynamic / variable address ??
You can make a script in your preferred language that reads the message, get the destination address (Delivered-To:), query for its alias in a DB, and finally reinject it into the queue using qmail-inject, sendmail or other, keeping the original sender address and optionally adding your ads, tails... .qmail-default: |/path_to_your_script Regards Wagner. > -Original Message- > From: Kim Chr. Hvidkjaer [mailto:[EMAIL PROTECTED]] > Sent: Quinta-feira, 3 de Maio de 2001 14:38 > To: [EMAIL PROTECTED] > Subject: forwarding to a dynamic / variable address ?? > > > Hello All, > > I'm trying to do a forwaring-service, where the users each have an address > (ie [EMAIL PROTECTED]) and any mail sent to this address is > forwarded to their > _actual_ address (perhaps a hotmail-address or similiar). > > I know how to forward (& [EMAIL PROTECTED]) but how do I do it > dynamically? I > can do a php or perl-script that will digg out the needed > to-address from my > mySql-database, but don't know how to do the actual forwarding?? > > any help is greatly appriciated! > > > > > (I've subscribed to the list, but am not getting any mail yet, so > please cc: > [EMAIL PROTECTED]) > > // Kim > > [EMAIL PROTECTED] > >
Re: forwarding to a dynamic / variable address ??
Kim Chr. Hvidkjaer <[EMAIL PROTECTED]> wrote: > > I'm trying to do a forwaring-service, where the users each have an address > (ie [EMAIL PROTECTED]) and any mail sent to this address is forwarded to their > _actual_ address (perhaps a hotmail-address or similiar). > > I know how to forward (& [EMAIL PROTECTED]) but how do I do it dynamically? I > can do a php or perl-script that will digg out the needed to-address from my > mySql-database, but don't know how to do the actual forwarding?? Have your script call qmail-inject, qmail-queue, or /usr/sbin/sendmail (as appropriate). There are good man pages for each of these. Charles -- --- Charles Cazabon<[EMAIL PROTECTED]> GPL'ed software available at: http://www.qcc.sk.ca/~charlesc/software/ Any opinions expressed are just that -- my opinions. ---