Redirecting to the pipe channel BEFORE routing to mailhost

Hi all,

I need to redirect all incoming email to a certain account to an external program. I set the maildeliveryoption attribute of that account to "program" and "mailprogramdeliveryinfo to the name of the module i registered with "imsimta program -a ...." .

The problem is that the messaging server routes the message to the backend due to the mailhost attribute before checking it's maildeliveryoption attribute, so the message is routed to the backend which then tries to give it to the program specified. Unfortunately, the program is only available on the frontend server.

How can I tell the messaging server to pipe the message to my program for a certain account? I guess that a well written rewrite rule would do the job, but I can't find how...

Thanks in advance..

[808 byte] By [incacgila] at [2007-11-26 23:45:55]
# 1
You really need to start out with the version of your server. I may have an answer for you, if you're on a current version. Otherwise, you may be out of luck.
jay_plesseta at 2007-7-11 15:18:34 > top of Java-index,E-Mail, Calendar, & Collaboration,Sun Java System Messaging Server...
# 2
I'm running Messaging Server 6.2 on a RedHat Enterprise AS 3u8
incacgila at 2007-7-11 15:18:34 > top of Java-index,E-Mail, Calendar, & Collaboration,Sun Java System Messaging Server...
# 3
That's a help.Unfortunately, with additional thought, I haven't come up with a sure-fire way to use the pipe channel for what you're trying to do.You may be able to use a sieve script to do something, but that's not pipe nor what you've asked for.
jay_plesseta at 2007-7-11 15:18:34 > top of Java-index,E-Mail, Calendar, & Collaboration,Sun Java System Messaging Server...
# 4

Hi,

The DELIVERY_OPTIONS MTA option controls whether an email is passed to the backend mailhost for processing.

By default, 'program' has the following delivery parameter set:

program=$M%$P@pipe-daemon

You can add a hash out the front:

#program=$M%$P@pipe-daemon

As per the Messaging Admin Guide (Delivery Options Processing) a character prefix of # (hash) "Sets a flag saying expansion of this delivery option does not need to take place on the entry抯 designated mailhost."

I recommend you try this is your test environment first though. Also, note carefully the spaces in front of the second/third etc. lines in the default value of the DELIVERY_OPTIONS in the messaging guide... they are essential!!

Regards,

Shane.

shane_hjortha at 2007-7-11 15:18:34 > top of Java-index,E-Mail, Calendar, & Collaboration,Sun Java System Messaging Server...
# 5
Do I need to set this parameter in the option.dat file? Where can I find the defaults?
incacgila at 2007-7-11 15:18:34 > top of Java-index,E-Mail, Calendar, & Collaboration,Sun Java System Messaging Server...
# 6

Hi,

> Do I need to set this parameter in the option.dat

> file?

Yes.

> Where can I find the defaults?

Defaults are documented in the 2005Q4 Messaging Server Admin Guide in the section mentioned in my previous post. Recommend you download the manual in PDF form, and search for the section -- it is all explained there (default settings, what each flag does etc. etc.)

Regards,

Shane.

shane_hjortha at 2007-7-11 15:18:34 > top of Java-index,E-Mail, Calendar, & Collaboration,Sun Java System Messaging Server...
# 7

Ok I've read the Admin Guide, and set this in my option.dat file:

DELIVERY_OPTIONS=*mailbox=$M%$\\$2I$_+$2S@ims-ms-daemon, \

&members=*, \

*native=$M@native-daemon, \

/hold=@hold-daemon:$A, \

*unix=$M@native-daemon, \

&file=+$F@native-daemon, \

&@members_offline=*, \

#program=$M%$P@pipe-daemon, \

#forward=**, \

*^!autoreply=$M+$D@bitbucket

After a nice cnbuild/restart of the imsimta, now if I send a message to the user which has maildeliveryoption=program , the message isn't even logged in the mail.log_current. A "normal" user just works fine. I've tried to set the DELIVERY_OPTIONS in option.dat using the exact default (e.g. without the # before the program option), and it works fine. I've also tries to toggle the white space at the start of each line after the first. No result in either case.

I've tried to set a "fake" mailprogramdeliveryinfo for the user whom messages need to be piped, using a dummy name not registered with the imsimta program command, expecting to see an error in the case the previous test was hung in processing the message at the "program" side, but even in this case i saw no messages in the mail.log .

Thanks again for your advices, I feel the solution is near!

incacgila at 2007-7-11 15:18:34 > top of Java-index,E-Mail, Calendar, & Collaboration,Sun Java System Messaging Server...
# 8

Hi,

If you run:

./imsimta test -rewrite <email address with program delivery enabled>

on the *relay system* that you modified the option.dat file; what do you get?

For example a user I tested has this:

user005%testprogram@pipe-daemon (orig user005@domain1.com, inter user005@domain1.com, host pipe-daemon) *NOTIFY-FAILURES* *NOTIFY-DELAYS*

Regards,

Shane.,

shane_hjortha at 2007-7-11 15:18:34 > top of Java-index,E-Mail, Calendar, & Collaboration,Sun Java System Messaging Server...