News:

You may pay someone to create your store, or you visit our seminar and become a professional yourself with the silver certification

Main Menu

Could not instantiate mail function on admin email

Started by sandomatyas, February 13, 2025, 11:18:07 AM

Previous topic - Next topic

sandomatyas

Lately, I've noticed something strange in my VirtueMart shop. When customers place an order, they receive their email confirmation, but the admins sometimes receive it and sometimes don't.

I dug a bit deeper and found this:
When VM sends the vendor email, there is a Reply-To address, which is set to the customer's email. However, in the last few months, SpamAssassin has been refusing to send the email, and I receive the error message: "Could not instantiate mail function."

I contacted the hosting provider, and they claimed that it's not standard to have a Gmail address in the Reply-To field because Gmail's settings do not allow this.

When I modified some core code to remove the Reply-To field, I started receiving all the emails.

Would it be possible to disable this Reply-To setting?

hazael

What your hosting administrator mentioned might not be entirely accurate. Everything works perfectly fine for me, and my mail system functions without any issues.

It's possible that your mail server has a low reputation, which could be causing the emails to not reach the recipients. If you share your domain address, I can take a look and help identify any potential issues.

sandomatyas

I found these references:

https://help.mailblue.io/hc/en-gb/articles/12132937274780-How-can-I-ensure-that-my-emails-arrive-successfully-at-Gmail#h_01HKW2RNT45B8NA2DXVBKNW0QN

https://www.lexo.ch/blog/2024/11/solved-spf-setting-does-not-apply-to-return-path-causing-more-spam-and-phishing-e-mails-spamassassin-postfix/

Also figured out that SpamAssassin rules like FORGED_REPLYTO and FROM_DIFFERENT_DOMAINS can add several points to the spam score.

On some mail servers (like ours), outgoing emails are spam-filtered too, not just incoming. As far as I know this is a common practice on stricter setups. In such cases, if the Reply-To address is an external domain (e.g. gmail.com) while the From is a local domain (e.g. shop@mydomain.com), the server may flag or reject the message as spam before it's even sent.

This happens because:

SpamAssassin increases the spam score when Reply-To differs from From or the envelope sender.

SPF and DMARC alignment checks can be stricter depending on how the MTA interprets the headers.

By default, VirtueMart sets the customer email address as Reply-To in vendor confirmation emails. While that may be acceptable in many cases, it breaks deliverability in stricter environments.

It would be great to have a configuration option (even hidden) to disable the Reply-To header entirely, so that only the From address is used.

Thanks a lot for considering!