• Resolved allshookup

    (@allshookup)


    When someone submits a successful form the auto confirmation email they receive has a ghost 0 Byte attachment named “cforms2”.
    How can I stop this from happening?
    Here is a link to one of the forms.
    https://www.jerrysavelle.org/contact-us/
    Submit a test form and you will receive the auto confirmation and see exactly what I am talking about.

Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Author bgermann

    (@bgermann)

    This issue was brought to my attention several times, but the reporters did not respond to my questions and I could not reproduce the issue. It is the first time that someone actually gives a URL with a demo. Thanks for that.

    So you use Postman SMTP. Did you try another plugin that sets a SMTP server for the wp_mail function? If yes, did it give you the same result?

    Thread Starter allshookup

    (@allshookup)

    Yes you are correct I was using Postman SMTP. I just now installed WP Mail SMTP and the ghost attachment is no longer included with the sent mail.
    If you would like to see the difference you can complete the contact form again.

    https://www.jerrysavelle.org/contact-us/

    Any ideas as to why this is happening with Postman SMTP? I really like that plugin.

    • This reply was modified 7 years, 11 months ago by allshookup.
    Plugin Author bgermann

    (@bgermann)

    I guess it happens, because cformsII sets PHPMailer’s AltBody, which is handled by Postman in a wrong way. By the way: Postman is not updated for over a year and the support forum has many open issues. You better stay with WP Mail SMTP.

    It’s the first time I’ve heard about a ghost attachment. If it’s a reproducible bug I can definitely look into a fix.

    (Postman author)

    Plugin Author bgermann

    (@bgermann)

    It is not just the ghost attachment that is an issue here. The mail should have Content-Type: multipart/alternative with a text and an HTML part, but Postman converts it to Content-Type: multipart/mixed with the HTML part retained. The text part however is lost and instead the ghost attachment is used.

    You can check cformsII’s lib_email.php for the email handling. phpmailer_init action is hooked to set the email’s text part as $phpmailer->AltBody. It is hooked with every wp_mail call and then reset to not interfere with other plugins using PHPMailer. As Postman does not use PHPMailer, this explains the unsent text part, but not the ghost attachment.

    Plugin Author bgermann

    (@bgermann)

    Oh, I checked a bit more and it is a cformsII bug. The bug is that with auto confirmation emails in some cases a directory is given as attachment and is silently rejected by other mail engines. Postman includes a 0 Byte file with the dirname. So your plugin behaves perfectly fine.

    I just commited a fix, which will be contained in the next release: https://github.com/bgermann/cforms2/commit/cfcc7f43c6cad21df2e0d6bfe763da6b8d1ee58a

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Unwanted File Attachments’ is closed to new replies.