If you use the mailcmd option and not externnotify to identify a simple script, you will not need to create the email again as it will be already available via STDIN. You only need to look for delivery destinations (/^To:\s(.*)$/) and use something like Net::SMTP to route exactly as desired.
Brandon. On Tue, Jun 9, 2009 at 11:39 AM, Ken Rice<[email protected]> wrote: > Theres a really simple solution for this... Use the external notify option > of asterisk to fire a simple shell script that checks the mailbox number and > then sends the email out appropriately... This will allow you to use smtp > relays that are not listed in DNS or are even publically available > > >> From: "Brandon B." <[email protected]> >> Reply-To: Commercial and Business-Oriented Asterisk Discussion >> <[email protected]> >> Date: Tue, 9 Jun 2009 11:35:39 -0600 >> To: <[email protected]>, Commercial and Business-Oriented Asterisk >> Discussion <[email protected]> >> Subject: Re: [asterisk-biz] How do i enter two different SMTP in Asterisk >> VoiceMail >> >> On Tue, Jun 9, 2009 at 12:50 AM, Trixter aka Bret >> McDanel<[email protected]> wrote: >>> does asterisk do it that way or does it look up the first A record it >>> gets and use that and only that ?? If that is the case, and it does not >>> even support MX records then the correct answer would probably be closer >>> to "asterisk does not do that". >> >> The Asterisk voicemail application does not route email message, and >> like many other programs that create email messages (logwatch, >> mailman) it passes the emails to a mail submission agent >> (sendmail/exim with the correct command line arguments) and the mail >> submission agent submits them to the locally running smtp server which >> them uses the local configuration or DNS information to route the >> message properly. >> >> "'asterisk does not do that'" -- are you quoting yourself? >> >>> I really dont know but if I had to guess I would say that its not using >>> MX records, because it wants a smtp server, and given the way other >>> things in asterisk are done its likely that it does not try a secondary >>> A record if the primary is down. >> >> I do know, and I'm not guessing that Asterisk is not using MX records. >> Since Asterisk is not a SMTP server it will not try to delivery to >> secondary A records (since there is no such thing) but neither will it >> try to a secondary MX records. >> >> "given the way other things in asterisk are done its likely that it >> does not try a secondary A record if the primary is down" >> >> Considering the obvious fact that Asterisk is not a SMTP server and >> that there is no such thing as secondary A records, who are you to >> slam Asterisk like this? >> >>> You can still trick asterisk by using something similar to >>> ultramonkey.org (although you may not have to go quite as far as >>> ultramonkey would take you) so that asterisk thinks its just connecting >>> to a single host all the time, and if it fails its transparently >>> switched to the backup system. >> >> Ultramonkey.org? That is absurd. First, because the situation will not >> be improved with a highly reliable SMTP transactions since the >> delivery of Asterisk emails to the SMTP server is naturally to a local >> SMTP server (i.e. not across a network), and secondly, assuming that >> software from ultramonkey.org would help distribute or make more >> reliable outgoing SMTP transactions, the original question stated that >> two email accounts were involved, so it's unlikely that some kind of >> multiple server solution is reasonable. >> >>> Of course a more elegant solution would be, assuming its not there which >>> is an assumption I did make, to add the functionality to try multiple >>> hosts in order until it gets something resembling a success code (2xx, >>> usually 200), and if it runs out of hosts then queue and schedule an >>> event to try again in some timeout interval until the queue is empty. >>> But hey, for all I know it already does this, I really havent looked and >>> barely read the posts in this thread. >> >> I am 100% confident sendmail, postfix and exim properly handle SMTP >> delivery issues, so how can you justify calling for functionality >> within Asterisk to do this same task? >> >> Brandon B. >> >> _______________________________________________ >> --Bandwidth and Colocation Provided by http://www.api-digital.com-- >> >> asterisk-biz mailing list >> To UNSUBSCRIBE or update options visit: >> http://lists.digium.com/mailman/listinfo/asterisk-biz > > > > _______________________________________________ > --Bandwidth and Colocation Provided by http://www.api-digital.com-- > > asterisk-biz mailing list > To UNSUBSCRIBE or update options visit: > http://lists.digium.com/mailman/listinfo/asterisk-biz > _______________________________________________ --Bandwidth and Colocation Provided by http://www.api-digital.com-- asterisk-biz mailing list To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-biz
