Leandro Bertolami ha scritto:
Stefano,

Thanks for your response. I tried removing the bind parameter and adding
mail.smtp.localaddr but still cant make it work.

Here is the config

<mailet match="SubjectIs=xxx.xxx.xxx.91" class="RemoteDelivery">
            <outgoing>file://var/mail/outgoing-91/</outgoing>
            <mail.smtp.localaddr>xxx.xxx.xxx.91</mail.smtp.localaddr>

  <delayTime>  5 minutes </delayTime>
            <delayTime> 10 minutes </delayTime>
            <delayTime> 45 minutes </delayTime>
            <delayTime>  2 hours </delayTime>
            <delayTime>  3 hours </delayTime>
            <delayTime>  6 hours </delayTime>
            <maxRetries> 25 </maxRetries>
            <deliveryThreads> 1 </deliveryThreads>
            <sendpartial>false</sendpartial>
            <bounceProcessor>bounces</bounceProcessor>
        </mailet>

         <mailet match="SubjectIs=xxx.xxx.xxx.90" class="RemoteDelivery">
            <outgoing>file://var/mail/outgoing/</outgoing>
            <mail.smtp.localaddr>xxx.xxx.xxx.90</mail.smtp.localaddr>
            <delayTime>  5 minutes </delayTime>
            <delayTime> 10 minutes </delayTime>
            <delayTime> 45 minutes </delayTime>
            <delayTime>  2 hours </delayTime>
            <delayTime>  3 hours </delayTime>
            <delayTime>  6 hours </delayTime>
            <maxRetries> 25 </maxRetries>
            <deliveryThreads> 1 </deliveryThreads>
            <sendpartial>false</sendpartial>
            <bounceProcessor>bounces</bounceProcessor>
         </mailet>

It sends both mails from the .90 IP, but with this config it's working ok
(but only for 2 ip's, I tried with 3 but didn work)

      <mailet match="SubjectIs=xxx.xxx.xxx.91" class="RemoteDelivery">
            <outgoing>file://var/mail/outgoing-91/</outgoing>
            <bind>xxx.xxx.xxx.91</bind>
            ...
         </mailet>


         <mailet match="SubjectIs=xxx.xxx.xxx.90" class="RemoteDelivery">
            <outgoing>file://var/mail/outgoing/</outgoing>
            <mail.smtp.localaddr>xxx.xxx.xxx.90</mail.smtp.localaddr>
          ...
        </mailet>

If I add this to the mailets, the mals for .92 came with the IP .90.

 <mailet match="SubjectIs=206.212.241.92" class="RemoteDelivery">
            <outgoing> file://var/mail/outgoing-92/ </outgoing>
            <mail.smtp.localaddr>206.212.241.92</mail.smtp.localaddr>


I think I'm getting closer. Any Ideas?

Thanks again for your time!

Hi Leandro,

I just had a fast review of javamail code and it seems that the mail.smtp.localaddr configuration should work... BUT

I read in javamail docs that if a mail.smtp.localhost configuration is present then it override in some case the mail.smtp.localaddr, and indeed we have this code in the RemoteDelivery:

        //Set the hostname we'll use as this server
if (getMailetContext().getAttribute(Constants.HELLO_NAME) != null) { props.put("mail.smtp.localhost", getMailetContext().getAttribute(Constants.HELLO_NAME));
        } else {
String defaultDomain = (String) getMailetContext().getAttribute(Constants.DEFAULT_DOMAIN);
            if (defaultDomain != null) {
                props.put("mail.smtp.localhost", defaultDomain);
            }
        }

But this mail.smtp.localhost should only be used by javamail for the HELO command and not for the IP used as source of the connection.

Javamail uses the com.sun.mail.util.SocketFetcher class to retrieve the socket. You could try writing a small test for SocketFetcher to see if it correctly uses the bind to the local ip.

Stefano

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to