2

I have installed a server mail in a dedicated server and I have PowerMTA installed also, our server has a main IP address and 50 additional ones,Multiple VMTA are configured. Now I need to send email with php through PowerMTA and be able to choose each time a different IP. I know I have to use PHPMailer or another library but I do not have any idea on how to send emails via PowerMTA and choose the IP or the vmta (contain the IP and the domain) to use.

Any help would be much appreciated

Thank you

Chaanbi Kada
  • 371
  • 1
  • 3
  • 5
  • 1
    Welcome to Stackoverflow! Can you please elaborate your question having your effort like code or something so that people could get your problem early and help you? Thanks! – Enamul Hassan Jul 18 '16 at 00:39

1 Answers1

3

You will need to refer to the PowerMTA documentation for this, which is not officially available online (see chapter 8).

You select a specific virtual MTA in PowerMTA by setting a custom message header called x-virtual-mta when you submit messages to the MTA, which is done using addCustomHeader in PHPMailer, passing whatever name you need to use for your VMTA:

$mail->addCustomHeader('x-virtual-mta', 'my-vmta-name');

You need to ensure that your source IP is permitted to select VMTAs via this method in your PowerMTA config, for example:

<source 127.0.0.1>
    process-x-virtual-mta yes   # allow selection of a VirtualMTA
    always-allow-relaying yes   # allow feeding from 127.0.0.1
</source>

I would avoid embedding IP addresses in your code; stick to using VMTA names.

Robert
  • 7,394
  • 40
  • 45
  • 64
Synchro
  • 35,538
  • 15
  • 81
  • 104