Go Back   HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials > ISPConfig 3 > General

Do you like HowtoForge? Please consider supporting us by becoming a subscriber.
Reply
 
Thread Tools Display Modes
  #1  
Old 17th September 2012, 12:30
ayok ayok is offline
Junior Member
 
Join Date: Sep 2012
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default Cron job sends duplicate e-mails

Hi,
I am a PHP programmer but not really good with linux programming. So please be patient with me. I am busy now with a site which needs to work with the cron job. The admin panel of the server is ISPConfig 3.0.4.6. So that's why I am trying to find help here.

The cron job is working well, it executes every task with just this command:
Code:
* * * * * http://www.site.com/emails.php
However, when I tried to setup cron job to execute a script which sends emails, it sends me duplicate emails. So instead of receiving one emails I could receive 2 - 3 emails which is unexpected.

I have report this with the system administrator, but he ignores me, instead he accuse me that the mistake lays on the script. I have assured him that there is nothing wrong with the script because I've tested it with simple PHP mail(). Now the project stucks with this problem. And he, of course, is very busy with other things.

So, could someone please help me here? Thank you in advanced.

Greetings,
ayok
Reply With Quote
Sponsored Links
  #2  
Old 18th September 2012, 10:31
ayok ayok is offline
Junior Member
 
Join Date: Sep 2012
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Has nobody ever used ispconfig cron job for mailinglist??
Reply With Quote
  #3  
Old 18th September 2012, 13:43
falko falko is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lneburg, Germany
Posts: 41,701
Thanks: 1,900
Thanked 2,713 Times in 2,556 Posts
Default

Do you have root access to the server? If so, what's in the mail log when the script is called?

Do you have the same problem when you call the script in a browser?
__________________
Falko
--
Download the ISPConfig 3 Manual! | Check out the ISPConfig 3 Billing Module!

FB: http://www.facebook.com/howtoforge

nginx-Webhosting: Timme Hosting | Follow me on:
Reply With Quote
  #4  
Old 18th September 2012, 14:10
ayok ayok is offline
Junior Member
 
Join Date: Sep 2012
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Quote:
Originally Posted by falko View Post
Do you have root access to the server? If so, what's in the mail log when the script is called?

Do you have the same problem when you call the script in a browser?
Hi. Thanks for the reply.
Yes I have the root access to mail log, I see my e-mail is called two times. But I don't really understand what causes it. And I don't really know how to analyse it.

What I got is:
Code:
postfix/smtp[1883]: EFE3D2C01DA: to=<my email>, relay= 127.bla bla, delay=4, delays= and so on.
postfix/qmgr[2916]: EFE3D2C01DA: removed
postfix/smtp[3593]: 6F97C2C01D3: to=<my email>, relay= xx.xchg01.blabla, delay=4, delays= and so on.
postfix/qmgr[2916]: 6F97C2C01D3: removed
Then again
Code:
postfix/smtp[1883]: 2D7122C0164: to=<my email>, relay= 127.bla bla, delay=4, delays= and so on.
postfix/qmgr[2916]: 2D7122C0164: removed
postfix/smtp[3652]: 0F8A32C01D3: to=<my email>, relay= xx.xchg01.blabla, delay=4, delays= and so on.
postfix/qmgr[2916]: 0F8A32C01D3: removed
I have tested in browser and it gave me different result. In IE and firefox, it sends once, but in chrome it sends two times.
Reply With Quote
  #5  
Old 19th September 2012, 01:26
pititis pititis is offline
Senior Member
 
Join Date: Dec 2010
Location: Mnchen
Posts: 364
Thanks: 38
Thanked 87 Times in 68 Posts
Default

Check the message headers for both emails, the answer is there.
Reply With Quote
  #6  
Old 19th September 2012, 10:33
ayok ayok is offline
Junior Member
 
Join Date: Sep 2012
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thanks!
I have tested 2 different emails, both are duplicated, but have different header.

The first one,
Code:
amavis[26497]: (26497-03) Passed BAD-HEADER, <web@server> -> <my email>, quarantine: U/badh-Uo+mu32fsdf, Message-ID: <msg id>, mail_id: etc..
The other one, looks better but still duplicated
Code:
amavis[27881]: (27881-08-2) Passed CLEAN, <no-reply@yoursite.com> ->, Message-ID: <msg id> etc...
I still don't see the cause, and don't know the solution.

Btw, how can I copy the line?

Last edited by ayok; 19th September 2012 at 10:47.
Reply With Quote
  #7  
Old 19th September 2012, 12:39
pititis pititis is offline
Senior Member
 
Join Date: Dec 2010
Location: Mnchen
Posts: 364
Thanks: 38
Thanked 87 Times in 68 Posts
 
Default

Hello,

Your script is using a bad/missing header to send email and amavis tagged it as quarantine . It passes CLEAN because in your spam filter policy is defined so (check your policy). After the email is tagged an email is send to the quarantine admin (with information about the bad headers).


- Google the problem with de bad headers (you will find tons of info)
- If you want, you can tunning your amavis setting.

Cheers
Reply With Quote
Reply

Bookmarks

Tags
cronjob, email

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Cron job runs on both master and mirror server, why? snowfly Installation/Configuration 7 15th May 2013 21:37
Cron job has stopped working erkan Installation/Configuration 9 21st August 2012 13:57
Cron Job delgado2061 Installation/Configuration 0 1st January 2011 03:09
Problem getting cron job to run and in need of help :) MrCompTech General 7 27th July 2010 09:50
Freebsd 6.1 support misterm Installation/Configuration 10 9th April 2009 09:29


All times are GMT +2. The time now is 14:04.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.