Billing Module Multiserver Setup

Discussion in 'Plugins/Modules/Addons' started by Jeremy007, Jun 25, 2019.

  1. Jeremy007

    Jeremy007 Member

    Dear HTF Friends,

    I bought the billing module about a week ago but i am a little in the dark on how i am supposed to set it up in a multi server environment because it does not have any authentication fields.

    Currently i would to send emails out with my main billing address [email protected] but it seems to send the email only with the [email protected]. The email seems to fail, which is what i expected since it's not authenticated or sent my my mail server mail.mysite.com and instead sent by panel.mysite.com

    Setup
    Os : Linux Ubuntu 16.0.4
    Server : Nginx
    Type : Multiserver
    Mail : Dovecot

    Code:
    Jun 25 18:20:13 panel postfix/smtpd[30765]: connect from unknown[37.49.227.191]
    Jun 25 18:20:13 panel postfix/smtpd[30765]: disconnect from unknown[37.49.227.191] ehlo=1 auth=0/1 rset=1 quit=1 commands=3/4
    Jun 25 18:23:26 panel postfix/pickup[14699]: E27253F233: uid=1000 from=<ispconfig>
    Jun 25 18:23:26 panel postfix/cleanup[30832]: E27253F233: message-id=<[email protected]>
    Jun 25 18:23:26 panel postfix/qmgr[3088]: E27253F233: from=<[email protected]>, size=37278, nrcpt=1 (queue active)
    Jun 25 18:23:33 panel postfix/anvil[30767]: statistics: max connection rate 1/60s for (smtp:37.49.227.191) at Jun 25 18:20:13
    Jun 25 18:23:33 panel postfix/anvil[30767]: statistics: max connection count 1 for (smtp:37.49.227.191) at Jun 25 18:20:13
    Jun 25 18:23:33 panel postfix/anvil[30767]: statistics: max cache size 1 at Jun 25 18:20:13
    Jun 25 18:23:49 panel postfix/smtpd[30836]: connect from unknown[177.8.164.20]
    Jun 25 18:23:56 panel postfix/smtp[30834]: connect to hotmail-com.olc.protection.outlook.com[104.47.40.33]:25: Connection timed out
    Jun 25 18:24:15 panel postfix/smtpd[30836]: lost connection after CONNECT from unknown[177.8.164.20]
    Jun 25 18:24:15 panel postfix/smtpd[30836]: disconnect from unknown[177.8.164.20] commands=0/0
    Jun 25 18:24:27 panel postfix/smtp[30834]: connect to hotmail-com.olc.protection.outlook.com[104.47.42.33]:25: Connection timed out
    Jun 25 18:24:27 panel postfix/smtp[30834]: E27253F233: to=<[email protected]>, relay=none, delay=60, delays=0.01/0.01/60/0, dsn=4.4.1, status=deferred (connect to hotmail-com.olc.protection.outlook.com[104.47.42.33]:25: Connection timed out)
    Jun 25 18:27:04 panel postfix/smtpd[30969]: connect from unknown[37.49.227.191]
    Jun 25 18:27:04 panel postfix/smtpd[30969]: disconnect from unknown[37.49.227.191] ehlo=1 auth=0/1 rset=1 quit=1 commands=3/4
    Jun 25 18:30:24 panel postfix/anvil[30838]: statistics: max connection rate 1/60s for (smtp:177.8.164.20) at Jun 25 18:23:49
    Jun 25 18:30:24 panel postfix/anvil[30838]: statistics: max connection count 1 for (smtp:177.8.164.20) at Jun 25 18:23:49
    Jun 25 18:30:24 panel postfix/anvil[30838]: statistics: max cache size 1 at Jun 25 18:23:49
    Jun 25 18:30:42 panel postfix/smtpd[31113]: warning: hostname zg-0326a-81.stretchoid.com does not resolve to address 162.243.144.173: Name or service not known
    Jun 25 18:30:42 panel postfix/smtpd[31113]: connect from unknown[162.243.144.173]
    Jun 25 18:30:42 panel postfix/smtpd[31113]: disconnect from unknown[162.243.144.173] ehlo=1 quit=1 commands=2
    
    Any help would be greatly appreciated
     
  2. till

    till Super Moderator Staff Member ISPConfig Developer

    The Billing Module uses the smtp subsystem from ISPConfig to send emails and the way the ispconfig SMTP code sends emails is configured under System > Interface config. You can switch it to send by smtp there and also set authentication details if you are using a remote smtp server.
     
  3. Jeremy007

    Jeremy007 Member

    Is that the one under Interface > Main Config ? where the checkbox "Use SMTP to send system mails" is located?
    I filled it in but it doesn't seem to want to use the smtp settings because the log of "panel.mysite.com" show that is still tries to use "[email protected]" and my mail server "mail1.mysite.com" log shows no connection or anything in the log.
     
  4. till

    till Super Moderator Staff Member ISPConfig Developer

    Yes. Check the settings again to ensure you filled in server, username, and password and that you enabled the checkbox to use smtp settings. And I need to know to which exact mail sending action in the billing module you refer to.
     
  5. till

    till Super Moderator Staff Member ISPConfig Developer

    And check in the billing module that you set up the billing company settings correctly incl. valid email address.
     
  6. Jeremy007

    Jeremy007 Member

    I have added an image to show the settings, not sure if the port is correct. When i go to "select an invoice action" and i choose "Send PDF file by email" -> standard invoice email
    settings-config.jpg

    yes, the billing module company settings has the correct address : "[email protected]"
     
  7. till

    till Super Moderator Staff Member ISPConfig Developer

    The settings look right. I'll take a look into the code to see if I can find something there.
     
  8. till

    till Super Moderator Staff Member ISPConfig Developer

    I've checked the code and the billing module uses the ispconfig mail library there, so it should send by smtp when smtp is selected under system > Interface config. The from email address and from name is used from Billing Company settings, there are separate fields for that in the company details in Billing Module.
     
  9. Jeremy007

    Jeremy007 Member

    Ok, tried it out but seems to always use the [email protected]. If i try manually to telnet i see the attempt but not with the module.
     
  10. till

    till Super Moderator Staff Member ISPConfig Developer

    Please post the line that gets added in mail.log of the server that runs the ISPConfig interface when you send an email using billing module and check the mail server which you configured to send the emails in ispconfig if really no emails get send through it from ISPConfig interface.
     
  11. Jeremy007

    Jeremy007 Member

    So, i discovered that there was nothing being added at all to the log files that related to the servers in question.

    After running a couple tests i discovered that port 25 might actually be blocked. Is there any way to work around this except for unblocking port 25?
     
  12. Jeremy007

    Jeremy007 Member

    I tried to use port 587 but i get the below

    Code:
    Jul  2 17:07:38 mail1 postfix/submission/smtpd[12065]: connect from panel.mysite.com[1.2.3.4]
    Jul  2 17:07:38 mail1 postfix/submission/smtpd[12065]: warning: non-SMTP command from panel.mysite.com[1.2.3.4]: $
    Jul  2 17:07:38 mail1 postfix/submission/smtpd[12065]: disconnect from panel.mysite.com[1.2.3.4] helo=1 auth=0/1 $
    
     
  13. till

    till Super Moderator Staff Member ISPConfig Developer

    I use it on port 25 on my servers and it works fine there, never tried to use it on other ports.
     
    Jeremy007 likes this.
  14. Jeremy007

    Jeremy007 Member

    Thanks, think i will need to use that port also.
     
  15. till

    till Super Moderator Staff Member ISPConfig Developer

    Did you try to set the option "Use SSL/TLS encrypted connection for SMTP" to ssl and to starttls ? Port 587 might work when using one of these options.
     
  16. Jeremy007

    Jeremy007 Member

    I actually tried that but i kept getting an ssl error.
     
  17. Jeremy007

    Jeremy007 Member

    So i found the problem. It seems that my panel's port 25 outgoing port is blocked. Incoming works fine, connecting to the mail server from another server via port 25 works fine. I tried disabling my firewall but didn't help even after a reboot.
     
    Last edited: Jul 5, 2019
  18. adamjedgar

    adamjedgar Member

    Who is your service provider?
    Perhaps they have blocked outgoing port 25 on their network. Google Cloud does this...you have to use a mail relay provider with GCE.
     
  19. Jeremy007

    Jeremy007 Member

    Well i actually contacted them and they said it's not blocked on their side. Very strange.
     

Share This Page