API Can't connect to Email program

SYSTEM INFORMATION
OS type and version Ubuntu Linux 22.04.4
Webmin version 2.111
Virtualmin version 7.10.0
Related packages SUGGESTED

Hello…

I have a membership program on one virtual website within Virtualmin and I have a bulk email sending program within another virtual website within Virtualmin.

My problem is having the API from the membership program connecting to the email sending program. Each time I try to configure it I receive an error. I have another installation of Virtualmin on another server at a different IP address and I have the same issue… the API connection indicates an error.

I’ve got another installation of the same membership program on a commercial server well outside of Virtualmin. And the API connects to the email program on the website within Virtualmin with no problem.

Because I can’t connect either within the same virtualmin server or from another system running the Virtualmin environment it seems to me that there must be something in Virtualmin either blocking the outgoing API request (from the membership program) or something that if prohibiting communication between the servers when Virtualmin is on both ends of the equation!

I’d like these to connect so I don’t have to manually keep updating the emailing software. Do you have any suggestions that may allow the API to connect to the mail server when both systems have Virtualmin installed?

Dan Lewis

And that error would be? Seriously, we have virtually no useful information in this post to go on. Just some random program isn’t working. Other than it is on a Virtualmin server this may not even be related to anything Virtualmin.

1 Like

So it is that which is causing the error?

or is it

or is it some plugin module on some webserver (Apache or nginx) PHP

so little to go on.

Is the membership program calling the bulk email program API via it’s domain name?

If so, try this:

  1. make the bulk email program the default server via Virtualmin → Website Settings → Website Options
  2. configure the membership program to call the bulk email program via localhost / 127.0.0.1 or the Virtualmin IP address

Note: I am trying to sidestep anything which might block the API call. If this idea does not work then you better do that which has been recommended by @ID10T & @Stegan and provide the community more info about the error

You plan to tell us the error, or shall we just guess?

https://forum.virtualmin.com/guidelines

I was waiting to get feedback from the guy who wrote the Amember script that I am using and where the problem exists.

Here is what he said:

Hello, I have uploaded simple PHP script to reproduce an issue -

http://mypromotions.showapplications.com/test.php It just sends GET request to https://dlkdigitalmarketing.com

Please work with hosting support to troubleshoot it.

It is a connection issue and unfortunately it is out of our scope. –

Anton Orlov Support Specialist CGI Central https://www.amember.com/


The guy from MailWizz thought it may be because the serveris trying to go out of the system and then back in again. He gave me some edits for the /etc/hosts file

Edit your /etc/hosts file and add your mailwizz instances to resolve to their public IPs:
123.123.123.1 host-1.mailwizz.com
123.123.123.2 host-2.mailwizz.com

That didn’t work either

All the app says is that it encountered an error… it didn’t tell me what the error was!

Obviously there is some sort of connectivity error… what steps can I take to see what that error my be?

root@main:/etc/fail2ban/jail.d# ping host-1.mailwizz.com ping: host-1.mailwizz.com: Name or service not known root@main:/etc/fail2ban/jail.d# ping host-2.mailwizz.com ping: host-2.mailwizz.com: Name or service not known

mit@~:whois 123.123.123.1
% [whois.apnic.net]


% Whois data copyright terms    http://www.apnic.net/db/dbcopyright.html

% Information related to '123.112.0.0 - 123.127.255.255'

% Abuse contact for '123.112.0.0 - 123.127.255.255' is 'zhaoyz3@chinaunicom.cn'

inetnum:        123.112.0.0 - 123.127.255.255
netname:        UNICOM-BJ
descr:          China Unicom Beijing province network
descr:          China Unicom
country:        CN
admin-c:        CH1302-AP
tech-c:         SY21-AP
abuse-c:        AC1718-AP
status:         ALLOCATED PORTABLE
`

I still don’t see an error. What is the actual error? I have never seen or heard of Amember, and have no experience with it.

The description provided by the vendor doesn’t make sense to me. I don’t understand what they’re suggesting is happening.

Sending mail locally is simple as heck, and does not involve “trying to go out of the system and then back in again”, and certainly doesn’t need hosts files entries.

I think you need to just step back and post how you’ve configured this application to try to send mail. None of this conversation makes any sense to me. You can send mail locally as simply as echo "tested" | mail -s "Test" joe@virtualmin.com (assuming mailx package is installed to provide the mail command, but any mail command will work, you can even send mail with telnet or nc in a couple of lines). Local clients don’t need to authenticate, and you can just send via localhost, you don’t need a hostname (which is why I’m baffled by adding entries to hosts).

This isn’t about sending email. That isn’t the issue. The issue is having the API of my Membership software (aMember) connect it’s API with the bulk email software I have on Virtualmin.

I have several installations of aMember.

The API connects (to the bulk email software on a Virtualmin server) with no problem when the aMember software is on a server completely outside of the Virtualmin system.

When the aMember software is on a server that is part of the Virtualmin system and it tries to connect to the bulk mail software (which is also on a Virtualmin server) it can’t connect. Since I have more than one installation of Virtualmin (on two separate physical servers) I’ve found that the API connection doesn’t work when it originates from a website on a Virtualmin server regardless of whether that Virtualmin server is on the same system or not.

Here is the code for the API from aMember that is trying to connect to the bulk email software that is withing Virtualmin

I’ve attached the PHP file

Here is the link to download a zipped version of the API php file

these maybe example names and ips, not what you use

I gave that idea a try and it didn’t work. I’m just not sure what additional things to check. I’ve got another API from a different bulk email application that seems to work fine… I guess I’ll go back to asking either the tech suport people from aMember or MailWizz and see if they have any other additional ideas

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