WP Mail Options
[resolved] send test mail (12 posts)

  1. atesin
    Posted 2 years ago #

    hi .. great plugin

    exactly i was looking for since i use php mail with an uncommon config

    however i like you to add an email text field and a -send test mail- button like i had seen in other plugins

    this plugin has so many configs hat i like to test it by one before use it in my site

    in the meanwhile, how can i being testing the mail function?


  2. Soli
    Plugin Author

    Posted 2 years ago #

    OK, I will take a look at it.

    Thanks for your suggestion.

  3. atesin
    Posted 2 years ago #

    can i use your plugin to pass additional parameters to configured sendmail bin ?

    php mail function usage is:

    bool mail ( string $to , string $subject , string $message [, string $additional_headers [, string $additional_parameters ]] )

    i have a bash script configured in php as sendmail bin to obfuscate and log real sendmail, i must use mail() passing a specific token trought additional parameters to work

    if any hacker/spammer reaches to upload a php script and tries to use it to use my server to send spam, he will not able unless he knows the token, anyway he will get logged

  4. Soli
    Plugin Author

    Posted 2 years ago #

    I saw the code of PHPMailer, and found these lines:

    $params = sprintf("-oi -f %s", $this->Sender);
    $rt = @mail($val, $this->EncodeHeader($this->SecureHeader($this->Subject)), $body, $header, $params);

    So, perhaps you could pass your token with the "Sender" parameter.

    For example, you set "Sender" to "xxx@yyy.com my_specific_token",

    the result should be :

    mail( $to, $subject, $msg, $header, "-oi -f xxx@yyy.com my_specific_token");
  5. Soli
    Plugin Author

    Posted 2 years ago #

    Now you can send test mail.

    Please update to V 0.2.1.

    Your feedback is appreciated.

  6. atesin
    Posted 2 years ago #

    ... For example, you set "Sender" to "xxx@yyy.com my_specific_token",

    yes it authenticate successful and tries to send the message, but it sends with the non standard header

    sendmail -oi -f myadmin@email.cl myCustomTokenJgofwbvsxxxx
    > From: myadmin@email.cl
    > Return-Path: myadmin@email.cl myCustomTokenJgofwbvsxxxx
    > ...
    < 250 Mail accepted

    and i am afraid recipient servers will reject it

    i made a test *with your new function* and logs says the message was ok and sended, but the mail yet doesnt reach my inbox :(

    another issue is my secret token IS SENDED ON THE EMAIL HEADERS

    please help .. could you add an -additional parameters- field to your plugin?, should be helpful :)

  7. Soli
    Plugin Author

    Posted 2 years ago #

    Try using 'Sendmail Program' option.

    For example, set the value to '/usr/sbin/sendmail <your params>'.

  8. atesin
    Posted 2 years ago #

    hi .. your new *send test mail* function had resulted incredible useful :)

    however i tried what you suggested using *sendmail program* but seems it discards any parameter introduced, i tried with: sendmail-wrapper myCustomTokenXxxxx, "sendmail-wrapper myCustomTokenXxxxx", sendmail-wrapper\ myCustomTokenXxxxx, etc

    .. i also tried with *custom header* option, but when i send test mail wordpress window becomes blank (bug?), maybe i am doing something wrong.. i tried with various formats like: Xheader: value, Xheader, "Xheader", 'Xheader', 'Xheader: value' but is the same

    since php mail format is: mail(to,subj,msg,add-heads,add-parms) i though i could do some injection with additional headers specifying as "','myToken" ..

    but would be better if there would be an *additional parameters* field as other blog/forum software (mybb), that way the path to sendmail would be safer; or at least if would accept parameters in *sendmail program* field

    thanks and sorry for the inconveniences

  9. atesin
    Posted 2 years ago #

    i send you my wrapper so you can watch or use,
    i use MSMTP as smtp client

    # sendmail program wrapper by atesin may2013
    # usage: cat mail.txt|sendmail-t authtoken
    # is recommended to enable php mail.log to get referer script

    # config
    MCMD='/path/to/real/smtp-client -parms'
    MFROM='"John Doe" <jdoe@example.com>'

    # write header on the log
    echo -e "***\ndate">>$MDEBUG

    # try to validate
    for i in $*
    if [ "$i" != "$MAUTH" ]
    # send mail and exit
    # if you not include a 'From' header some mails arrives weird
    echo -e "From: $MFROM\ncat"|$MCMD 2>&1 >>$MDEBUG
    exit 0

    # could not send mail
    echo -e "failed validation\nparameters: $*\nmessage:\ncat">>$MDEBUG
    exit 255

  10. Soli
    Plugin Author

    Posted 2 years ago #

    Did you set the "Mailer" option (Method to send mail) to "sendmail"?

    Do it, then set 'Sendmail Program' option to '/absolute/path/to/your/wrapper the_custom_token' and try again.

  11. atesin
    Posted 2 years ago #

    weee, yes now it works!

    i had to do some minor modifications to my script to add my "From: " header and discard original, because when mail comes with 2 From headers, mails are discarded too

    echo -e "From: $MFROM\n'grep -Pv "^From: "'"|$MCMD >>$MDEBUG 2>&1
    # ' = tilt quote

    sorry i feel a bit stupid for not to read the documentation, but the truth is i didnt find it

    anyway your plugin is terrific, i hope someday you add an *additional parameters* field so php can log it, that i think is the ONLY thing it lacks cause is very complete


  12. Soli
    Plugin Author

    Posted 2 years ago #

    I am glad your problem was resolved.

    You may saw the warning above the options:

    Warning: This plugin is only for advanced users. You should know exactly what effect each option will have on the behavior of PHPMailer when you use this plugin.

    However, I have decided to rewrite this plugin completely, make it work well and easy to use.

    Your attenton is invited.

    Again, thanks for your advice and feedback.

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • WP Mail Options
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic


No tags yet.