Email forms not working on sites

OS type and version Ubuntu Linux 22.04.3
Virtualmin version 7.7 Pro

So I have all my DNS managed in cloudflare. BIND is apparently enabled on my Virutalmin instance and I can get to the sites no issue. But for whatever reason mail is not working…ie: if a site has a contact form, or I want to change my wordpress email it sends an email to the new one…those Emails never send.

We’d need to see the relevant log. Relevant entries from mail.log or the relevant lines from the journal for the postfix unit (run journalctl -fu postfix and then try to send mail while watching…the entries that appear at the moment you try to send are the relevant entries).

Also, if you’re using chroot jails, you need to understand them and the implications of using them. See this thread for a very similar problem which was caused by using chroot jails without equipping the jail with the tools needed to send mail: Can't send mail from WordPress forms

I should probably point out that the thread only actually begins to be about the problem around here (and a little further down, if you’re using chroot jails and an execution mode that is subject to jails): Can't send mail from WordPress forms - #55 by Joe

Everything before that is noise, unrelated to the issue.

I did the journalctl -fu postfix then sent a form…no entry loaded.

Funny enough i may have found my issue. SMTP for Virtualmin is 587 right? My Virtualmin instance is on a VM on a windows box. The VM has NAT enabled but the windows box does not have 587 open…

Yup my VM didnt have the port open

SMTP is port 25, always, not just Virtualmin.

587 is submission, which is SMTP with authentication required. (Which is to say, it is to allow your mail clients, such as Thunderbird or Outlook, to relay mail through your server. SMTP is for mail servers to talk to each other, such as your server sending mail to users on another server.)

Local users don’t need a port to drop mail into the queue, and localhost is not firewalled even if you are using a script that sends via SMTP to localhost:25, so I don’t think ports are relevant to your problem.

Unless, of course, everything is working now, in which case, great, I guess!? I remain confused how it could have fixed the problem, though.

well its for sure a step in the right direction by checking port checker on the the IP. Its open now. Now i just gotta figure out this:

This is the mail system at host

I'm sorry to have to inform you that your message could not
be delivered to one or more recipients. It's attached below.

For further assistance, please send mail to postmaster.

If you do so, please include this problem report. You can
delete your own text from the attached returned message.

                   The mail system

<>: host[]
    said: 550-5.7.26 This mail is unauthenticated, which poses a security risk
    to the 550-5.7.26 sender and Gmail users, and has been blocked. The sender
    must 550-5.7.26 authenticate with at least one of SPF or DKIM. For this
    message, 550-5.7.26 DKIM checks did not pass and SPF check for
    [virtualmin.mydomain 550-5.7.26] did not pass with ip:
    [my.public.ip.addresss]. The sender should visit 550-5.7.26 for 550 5.7.26
    instructions on setting up authentication.
    t9-20020a0c8d89000000b0064f47cde8e0si10451523qvb.381 - gsmtp (in reply to
    end of DATA command)

Looks like you don’t have dkim or spf setup correctly use something like to check what records you have for a given domain, if they fail use the virtualmin ui to create the correct records. If you use your own name servers no further action is required else you need to copy the generated records to your dns provider

1 Like

Ok cool. i use Cloudflare DNS and BIND is enabled on my server. Usually what I do is check want BIND generated and make sure I have the same ones in Cloudflare

You don’t need bind if you use cloudflare make sure the cloudflare records are correct

is there anything “wrong” with using both? i find that BIND will add any needed records so i can see what exactly i need in Cloudflare.

If your namesevers are cloudflare your local bind setup will have no effect at all you just need to copy the dns records across. I may be wrong but I think virtualmin has an issue displaying the records at some point. So if you do have bind running you can copy the records to cloudflare dns, making sure that line breaks are removed

But are using gpl or pro … there may be a difference

If you disable BIND in Virtualmin, you’ll get a page called “Suggested DNS Records”, which does the same thing without needing to run BIND.

Virtualmin Pro can also directly manage Cloudflare DNS.


This topic was automatically closed 8 days after the last reply. New replies are no longer allowed.