Custom Email Header per MTA?

Forum to discuss Features/Usage/Bugs of Multiple MTA Addon

Custom Email Header per MTA?

Postby sendmedia » Wed Oct 16, 2013 5:44 am

Hi,

I know iv posted alot of questions on these forums the past few days, but i thought id post them here so other users dont ask the same question as im sure at some point other people will want to know this stuff too.

My question is, is there any way of adding a custom email header per MTA?

For for example

MTA1 = X-MC-Subaccount: mail1
MTA2 = X-MC-Subaccount: mail2
MTA3 = X-MC-Subaccount: mail3

and so on?

I need this feature added please.
sendmedia
 
Posts: 30
Joined: Thu Oct 10, 2013 12:08 pm

Re: Custom Email Header per MTA?

Postby sendmedia » Wed Oct 16, 2013 6:03 am

or i might be able to do this myself. But need a little help.

Am i right in saying to add email headers i need to edit the following file:

/admin/functions/api/ss_email.php

If so then where it has this bit:

Code: Select all
if ((int)$this->statid > 0) {
         $extra_headers[] = 'List-Unsubscribe: <%%HEADER_UNSUBSCRIBELINK%%>';
         $extra_headers[] = 'X-Mailer-RecptId: %%HEADER_SUBSCRIBERID%%';
         $extra_headers[] = 'X-Mailer-SID: ' . (int)$this->statid;
      }


I'll change it to the following:

Code: Select all
if ((int)$this->statid > 0) {
         $extra_headers[] = 'List-Unsubscribe: <%%HEADER_UNSUBSCRIBELINK%%>';
         $extra_headers[] = 'X-Mailer-RecptId: %%HEADER_SUBSCRIBERID%%';
         $extra_headers[] = 'X-Mailer-SID: ' . (int)$this->statid;
if ($from = '[email protected]') {
   $extra_headers[] = 'X-MC-Subaccount: mail1';
}
if ($from = '[email protected]') {
   $extra_headers[] = 'X-MC-Subaccount: mail2';
}
if ($from = '[email protected]') {
   $extra_headers[] = 'X-MC-Subaccount: mail3';
}
if ($from = '[email protected]') {
   $extra_headers[] = 'X-MC-Subaccount: mail4';
}
      }


Would that work? If so then theres 1 thing i need help with. You can see iv used $from to get the from address the emails will be sent from, but no where in that php file can i find the correct variable to use which stores the from address, do you know what it is and will my above modification work once i use the right from variable?

Thanks
sendmedia
 
Posts: 30
Joined: Thu Oct 10, 2013 12:08 pm

Re: Custom Email Header per MTA?

Postby MaBoRaK » Wed Oct 16, 2013 7:56 am

loading.......

Excellent implementation.

At this point the FROM MAIL is the same assigned in the MTA details.

Image

And the custom mail from configured in your mta

Image

So you can access to the Current MAIL FROM ( reply or bounce ) with:

Code: Select all
if ((int)$this->statid > 0) {
         $extra_headers[] = 'List-Unsubscribe: <%%HEADER_UNSUBSCRIBELINK%%>';
         $extra_headers[] = 'X-Mailer-RecptId: %%HEADER_SUBSCRIBERID%%';
         $extra_headers[] = 'X-Mailer-SID: ' . (int)$this->statid;
$from = Mta_API::Singleton()->mta['current_mta']['mail_from'];  // <---- HERE 
if ($from = '[email protected]') {
   $extra_headers[] = 'X-MC-Subaccount: mail1';
}
if ($from = '[email protected]') {
   $extra_headers[] = 'X-MC-Subaccount: mail2';
}
if ($from = '[email protected]') {
   $extra_headers[] = 'X-MC-Subaccount: mail3';
}


For reply:

Code: Select all
Mta_API::Singleton()->mta['current_mta']['mail_reply'];


for bounce:

Code: Select all
Mta_API::Singleton()->mta['current_mta']['mail_bounce'];



Please try.

connection closed.
CEO in Maborak Technologies and Interspire Addons Developer
MaBoRaK
Site Admin
 
Posts: 120
Joined: Thu Jul 18, 2013 10:41 am

Re: Custom Email Header per MTA?

Postby sendmedia » Wed Oct 16, 2013 9:01 am

Right iv edited the code to the following:

Code: Select all
if ((int)$this->statid > 0) {
         $extra_headers[] = 'List-Unsubscribe: <%%HEADER_UNSUBSCRIBELINK%%>';
         $extra_headers[] = 'X-Mailer-RecptId: %%HEADER_SUBSCRIBERID%%';
         $extra_headers[] = 'X-Mailer-SID: ' . (int)$this->statid;
         $fromemail = Mta_API::Singleton()->mta['current_mta']['mail_from'];
         if ($fromemail = '[email protected]') {
               $extra_headers[] = 'X-MC-Subaccount: mail1';
         }
         if ($fromemail = '[email protected]') {
            $extra_headers[] = 'X-MC-Subaccount: mail2';
         }
         if ($fromemail = '[email protected]') {
            $extra_headers[] = 'X-MC-Subaccount: mail3';
         }
         if ($fromemail = '[email protected]') {
            $extra_headers[] = 'X-MC-Subaccount: mail4';
         }
         if ($fromemail = '[email protected]') {
            $extra_headers[] = 'X-MC-Subaccount: mail5';
         }
      }


But it doesnt seem to work, i think the problem is the code which gets the free email address

Code: Select all
$fromemail = Mta_API::Singleton()->mta['current_mta']['mail_from'];


Are you sure that piece of code will work in the file where editing?
sendmedia
 
Posts: 30
Joined: Thu Oct 10, 2013 12:08 pm

Re: Custom Email Header per MTA?

Postby sendmedia » Wed Oct 16, 2013 9:02 am

*from email address

cant edit my post for some reason to make the change.
sendmedia
 
Posts: 30
Joined: Thu Oct 10, 2013 12:08 pm

Re: Custom Email Header per MTA?

Postby sendmedia » Wed Oct 16, 2013 9:07 am

After looking at this again no headers what so ever are showing in the emails.

Code: Select all
$extra_headers[] = 'List-Unsubscribe: <%%HEADER_UNSUBSCRIBELINK%%>';
         $extra_headers[] = 'X-Mailer-RecptId: %%HEADER_SUBSCRIBERID%%';
         $extra_headers[] = 'X-Mailer-SID: ' . (int)$this->statid;


the above headers dont show either, i tried different ESPs and also the localhost one and all the test emails iv sent have'nt shown the headers.

Maybe its because i did a test smtp connection email and not a real campaign, ill do more testing now.
sendmedia
 
Posts: 30
Joined: Thu Oct 10, 2013 12:08 pm

Re: Custom Email Header per MTA?

Postby sendmedia » Wed Oct 16, 2013 9:19 am

Ok another update, i had the actually send an email campaign out for the headers to be added.

How ever now we have another problem, ALL the extra headers are showing, even if the from email address does not match :(

I need some help on this please.
sendmedia
 
Posts: 30
Joined: Thu Oct 10, 2013 12:08 pm

Re: Custom Email Header per MTA?

Postby MaBoRaK » Wed Oct 16, 2013 1:18 pm

loading.......

Please post your complete PHP file.

connection closed.
CEO in Maborak Technologies and Interspire Addons Developer
MaBoRaK
Site Admin
 
Posts: 120
Joined: Thu Jul 18, 2013 10:41 am

Re: Custom Email Header per MTA?

Postby sendmedia » Wed Nov 06, 2013 4:08 am

Hey,

I'll pay you $100 if you can get this working please....

Thanks
sendmedia
 
Posts: 30
Joined: Thu Oct 10, 2013 12:08 pm


Return to Multiple MTA with IP Monitor

 


  • Related topics
    Replies
    Views
    Last post

Who is online

Users browsing this forum: No registered users and 1 guest

cron