Author Topic: Weclome Email, again and again, several times an hour  (Read 727 times)

BenCloud

  • Newbie
  • *
  • Posts: 12
    • View Profile
Weclome Email, again and again, several times an hour
« on: January 18, 2018, 03:39:58 PM »
I know I get a welcome e-mail when a pilot makes a new registration. But I always get welcome emails (20-30 / day) without anyone registering :o

BenCloud

  • Newbie
  • *
  • Posts: 12
    • View Profile
Re: Weclome Email, again and again, several times an hour
« Reply #1 on: January 19, 2018, 12:10:42 PM »
 ??? I think it can be that every time my pilots log in I get this email. A pilot has logged in with Firefox. And * ping * you have a new email: Welcome to ...

is that possible? Can someone help me?  :o

VAM

  • Administrator
  • Hero Member
  • *****
  • Posts: 1325
    • View Profile
    • virtual Airlines Manager
Re: Weclome Email, again and again, several times an hour
« Reply #2 on: January 24, 2018, 11:45:43 PM »
Email is not generated while login, the welcome is only generated when a user is registering into the VA
Also email is generated while inserting a flight and changing the callsign.
VAM Creator and programmer.

BenCloud

  • Newbie
  • *
  • Posts: 12
    • View Profile
Re: Weclome Email, again and again, several times an hour
« Reply #3 on: January 24, 2018, 11:53:05 PM »

BenCloud

  • Newbie
  • *
  • Posts: 12
    • View Profile
Re: Weclome Email, again and again, several times an hour
« Reply #4 on: January 24, 2018, 11:56:30 PM »
And i have some problems with the email system.

When a pilot report his flight than he is changed the location but the flight time is zero “0” I reading in the forum this thread

...
a few VA had an issue with mailer. When a VAM pirep is sent also a email is sent to the administrators, if this fails it will fail all the pirep.

file : VAM/receivevampirep.php

remove these lines (almost at the end)

Code: [Select]
$mail = new vam_mailer();
$mail->mail_flight_report_compose($gvauser_id,$type,$dep,$arr);

maybe this is your case and this will fix the issue.

Now it’s working, but I have no more validation email now.
I think there is something wrong. Can you help me?

VAM

  • Administrator
  • Hero Member
  • *****
  • Posts: 1325
    • View Profile
    • virtual Airlines Manager
Re: Weclome Email, again and again, several times an hour
« Reply #5 on: January 25, 2018, 08:06:57 AM »
if you are receiving the same welcome email with the same frequency it looks like in your server there is a cronjob that is triggering the emails. Can you check that?
That behavior is not part of VAM, so maybe the issue is on your hosting provider.
Can you open a support ticket regrading this and ask them what is the source of those emails?


VAM Creator and programmer.

BenCloud

  • Newbie
  • *
  • Posts: 12
    • View Profile
Re: Weclome Email, again and again, several times an hour
« Reply #6 on: January 26, 2018, 06:12:59 AM »
Yesterday I re-uploaded the complete VAMCORE folder and reloaded my server again. I deleted the old one. Nothing.
then i searched for automatic processes from the provider. Nothing
I get the emails from staff@bc-airlinealliance.de. I have set up two email mailboxes on my host server. everything without forwards. :

staff@bc-airlinealliance.de and admin@bc-airlinealliance.de.

staff@bc-airlinealliance.de I entered only on the Email configurations page in the admin panel!

Staff Email                           Ceo Email                            
staff@bc-airlinealliance.de     admin@bc-airlinealliance.de    

that is also the register text that I get constantly.
again 2 times at AM 02:40 tonight.

Picture:  https://drive.google.com/open?id=1UOWD7zYOB2pr-szbt-Hznq2TOQVzpydU


I have these emails in my admin mailbox. they were sent via my staff account. I see in the staff mailbox I find nothing. This is empty except for old validation emails


greetings

VAM

  • Administrator
  • Hero Member
  • *****
  • Posts: 1325
    • View Profile
    • virtual Airlines Manager
Re: Weclome Email, again and again, several times an hour
« Reply #7 on: January 26, 2018, 07:56:28 AM »
Yesterday I re-uploaded the complete VAMCORE folder and reloaded my server again. I deleted the old one. Nothing.
then i searched for automatic processes from the provider. Nothing
I get the emails from staff@bc-airlinealliance.de. I have set up two email mailboxes on my host server. everything without forwards. :

staff@bc-airlinealliance.de and admin@bc-airlinealliance.de.

staff@bc-airlinealliance.de I entered only on the Email configurations page in the admin panel!

Staff Email                           Ceo Email                            
staff@bc-airlinealliance.de     admin@bc-airlinealliance.de    

that is also the register text that I get constantly.
again 2 times at AM 02:40 tonight.

Picture:  https://drive.google.com/open?id=1UOWD7zYOB2pr-szbt-Hznq2TOQVzpydU


I have these emails in my admin mailbox. they were sent via my staff account. I see in the staff mailbox I find nothing. This is empty except for old validation emails


greetings

I do not know what is happeinignin your server. You can get the raw access log from your server and get what php pages are executed. for example you can see what php pages were executed around 2:40 AM that usually everybody is slepping. This will tell you what php is triggering the email, also review your cronojobs just in case.
VAM Creator and programmer.

Timothee

  • Jr. Member
  • **
  • Posts: 73
    • View Profile
Re: Weclome Email, again and again, several times an hour
« Reply #8 on: February 02, 2018, 11:24:39 AM »
Hey

I'm not sure if I understand your problem correctly but we had a similiar issue but never as many e-mails like you do.

The problem is, a register e-mail is always sent when someone calls pilot_insert.php. Some bots follow every link on a website and will also call this file. This will generate an e-mail without actually someone register on the website.

pilot_insert.php inserts a user only if a password was set in the register form. To solve the problem I moved thet two lines of code for the e-mail inside this check.

Code: [Select]
if ($_POST["password"])
{
  $encryptpassword = md5($pass);
  echo '<br>';
  $sql1 = "insert into gvausers (register_date,activation,name,surname,callsign,email,password,ivaovid,hub_id,country,city,reg_comments,birth_date,vatsimid,language)
              values (now(),0,'$name','$surname','_NEW_','$email','$encryptpassword','$ivao','$hub_id','$country','$city','$notes','$birthday','$vatsim','$language');";
  if (!$result = $db->query($sql1)) {
    die('There was an error running the query [' . $db->error . ']');
  }
  // Send mail to the pilot
  $mail = new vam_mailer();
  $mail->mail_register_compose($email);
}


BenCloud

  • Newbie
  • *
  • Posts: 12
    • View Profile
Re: Weclome Email, again and again, several times an hour
« Reply #9 on: February 06, 2018, 01:44:02 AM »
 :) Thanks... can you explain that more exactly?
What do I have to change where?

Thank You !  :D

Timothee

  • Jr. Member
  • **
  • Posts: 73
    • View Profile
Re: Weclome Email, again and again, several times an hour
« Reply #10 on: February 06, 2018, 09:57:23 PM »
The check in pilot_insert.php looks like this per default:
Code: [Select]
if ($_POST["password"])
{
  [...]
}
// Send mail to the pilot
$mail = new vam_mailer();
$mail->mail_register_compose($email);

Put the lines for mailiing inside the if which starts on line 68:
Code: [Select]
if ($_POST["password"])
{
  [...]

  // Send mail to the pilot
  $mail = new vam_mailer();
  $mail->mail_register_compose($email);
}
« Last Edit: February 06, 2018, 09:59:14 PM by Timothee »

BenCloud

  • Newbie
  • *
  • Posts: 12
    • View Profile
Re: Weclome Email, again and again, several times an hour
« Reply #11 on: February 06, 2018, 10:11:13 PM »
 :-* Many many thanks. It works! Great work! I can not tell you how happy I am. Big Hug. Ben

BilKapek

  • Full Member
  • ***
  • Posts: 144
    • View Profile
    • Freedom Sim
Re: Weclome Email, again and again, several times an hour
« Reply #12 on: February 08, 2018, 07:07:19 PM »
Hi
For clarity in the code I recommend separating in an instance specific to email
like this
Code: [Select]
// Send mail to the pilot
if(isset($_POST['name']) && !empty($_POST['name']) AND isset($_POST['email']) && !empty($_POST['email'])){
     
      $mail = new vam_mailer();
      $mail->mail_register_compose($email);
};

for the robots that visit your site you can block them on the file or folder of your choice
create a robots.txt file and add what is
Code: [Select]
User-agent: *
Disallow: /pilot_insert.php
I hope this will help you
Sam.

VAM

  • Administrator
  • Hero Member
  • *****
  • Posts: 1325
    • View Profile
    • virtual Airlines Manager
Re: Weclome Email, again and again, several times an hour
« Reply #13 on: February 20, 2018, 11:44:23 PM »
Hi
For clarity in the code I recommend separating in an instance specific to email
like this
Code: [Select]
// Send mail to the pilot
if(isset($_POST['name']) && !empty($_POST['name']) AND isset($_POST['email']) && !empty($_POST['email'])){
     
      $mail = new vam_mailer();
      $mail->mail_register_compose($email);
};

for the robots that visit your site you can block them on the file or folder of your choice
create a robots.txt file and add what is
Code: [Select]
User-agent: *
Disallow: /pilot_insert.php
I hope this will help you
Sam.

awesome solution. I did not see that!!
Thanks for support other users. I will this fix to VAM files.
VAM Creator and programmer.