[JDEV] Email trasnport

Kevin Smathers ks at micky.hpl.hp.com
Mon Dec 3 12:18:29 CST 2001


Hi Julian,

It is pretty easy to insert a new agent into the sendmail.cf file; you
have to add two or three lines.  One or two to define the new delivery 
agent, and one to let the mail system know when it should use that 
delivery agent.

For setting this up I recommend getting the Sendmail reference guide
from O'Reilly as there really isn't any good source of documentation
for how to write your own delivery rules other than that reference.

Here is an example from a change that I did to my local system to 
gateway email into JADE.

--- cut here ---
*** sendmail.cf	2001/11/08 22:59:32	1.1
--- sendmail.cf	2001/11/12 21:45:48
***************
*** 754,759 ****
--- 754,767 ----
  
  # short circuit local delivery so forwarded email works
  R$=L < @ $=w . >	$#local $: @ $1			special local names
+ #
+ # -- ICE
+ #
+ R$+ . agent / $* < @ $=w . >	$#mail2agent $@ $2 $: $1	agent delivery
+ R$+ . agent < @ $=w . >		$#mail2agent $@ localhost $: $1
+ #
+ # -- ICE
+ #
  R$+ < @ $=w . >		$#local $: $1			regular local name
  
  # not local -- try mailer table lookup
***************
*** 1461,1466 ****
--- 1469,1484 ----
  SAddDomain=50
  R$* < @ $* > $* 	$@ $1 < @ $2 > $3	already fully qualified
  R$+			$@ $1 < @ *LOCAL* >	add local qualification
+ 
+ #
+ # -- ICE
+ #
+ Mmail2agent,		P=/usr/share/coolagent/mail2agent, F=lsDFMA:/|@qPhn9, S=EnvFromL/HdrFromL, R=EnvToL/HdrToL,
+ 		T=DNS/RFC822/X-Unix,
+ 		A=mail2agent $u $h
+ #
+ # -- ICE
+ #
  
  Mlocal,		P=/usr/bin/procmail, F=lsDFMAw5:/|@qSPfhn9, S=EnvFromL/HdrFromL, R=EnvToL/HdrToL,
  		T=DNS/RFC822/X-Unix,
--- cut here ---

In this case I added a new rule so that 'username.agent at host' would
ultimately be delivered through the 'mail2agent' mail delivery agent.
In my case this is a shell script that forwards the e-mail to my 
agent subsystem.  

You can write rules to grab any part of the address and use it to
key on how the mail should be delivered though; just write the rules.

Cheers,
-kls

On Mon, Dec 03, 2001 at 09:26:58AM -0800, Julian Fitzell wrote:
> As far as I know, all the current SMTP transports work by acting as
> their own SMTP server on the SMTP port.  So all you need to do is
> specify the machine running the SMTP transport as an MX host for your
> domain in your DNS record and it should handle the email for you.
> 
> Admittedly in many cases this isn't a good thing.  I already run a real
> SMTP server on my jabber machine so I don't have this option... I've
> often thought of modifying the code so you can forward messages to a
> certain virtual domain through to the transport on the command line but
> have never got around to it.
> 
> Julian
> 
> 
> Glenn MacGregor wrote:
> 
>  > Hello,
>  >
>  >
>  >
>  > I am looking into getting the email transport working.  I have it
>  > working so I can send a jabber message to user%email server at email
>  > service and it goes to user at email server.  I am not sure how to get to
>  > go the other way, meaning that if I send an email to a user how does it
>  > get to the jabber system?
>  >
>  >
>  >
>  >     Thanks
>  >
>  >
>  >
>  >         Glenn
>  >
> 
> 
> 
> _______________________________________________
> jdev mailing list
> jdev at jabber.org
> http://mailman.jabber.org/listinfo/jdev

-- 
          //                               .--=,
 .....::://::::::::::::::::::::::::::::.. (o O &   kevin_smathers at hp.com
:::::::://:::://://://:/:://::||_//       / V  K   
 :::::://:::://:/:|//'/' // _,|'         r ,  'qk   
  :'''/____ // /  //  |_// // ||        .'~.  .~`, 
                                   kls   \_/-=\_/



More information about the JDev mailing list