Koozali.org: home of the SME Server

qmail using anonymous@myplace.com to send mail

Offline swissis

  • ***
  • 61
  • +0/-0
qmail using anonymous@myplace.com to send mail
« on: June 24, 2007, 10:01:14 PM »
Hi,

I run a database with planning data and am sending some emails every day on who has to do what en when.
I have written a php page with the intelligence for that. In this php page is the sendmail command.

I then use a cron job to execute the php page and most of the mail is send correct.
The problem is that the sender of the mail is anonymous@myplace.com and it is bounced by some ISP's
How do i fix this?
...

Offline Stefano

  • *
  • 10,894
  • +3/-0
Re: qmail using anonymous@myplace.com to send mail
« Reply #1 on: June 24, 2007, 11:08:10 PM »
Quote from: "swissis"
Hi,

I run a database with planning data and am sending some emails every day on who has to do what en when.
I have written a php page with the intelligence for that. In this php page is the sendmail command.

I then use a cron job to execute the php page and most of the mail is send correct.
The problem is that the sender of the mail is anonymous@myplace.com and it is bounced by some ISP's
How do i fix this?


create an entry in a user's crontab..

pay attention to php page file permission.

HTH

ciao
Stefano

Offline swissis

  • ***
  • 61
  • +0/-0
qmail using anonymous@myplace.com to send mail
« Reply #2 on: June 25, 2007, 07:38:12 AM »
Can you please show me how this is done?

I know only the crontab command and then press insert and so on.

And what kind of attention should i pay to the php file?
...

Offline Stefano

  • *
  • 10,894
  • +3/-0
qmail using anonymous@myplace.com to send mail
« Reply #3 on: June 25, 2007, 09:28:57 AM »
Quote from: "swissis"
Can you please show me how this is done?

I know only the crontab command and then press insert and so on.

And what kind of attention should i pay to the php file?


choose a user and change his shell (man chsh)

log in console with user's account and do
Code: [Select]

crontab -e


insert a line calling your php page..

your php page must be executable from your user

HTH

Ciao

Stefano

Offline swissis

  • ***
  • 61
  • +0/-0
qmail using anonymous@myplace.com to send mail
« Reply #4 on: June 25, 2007, 11:52:22 AM »
Hi Stefano,

What do you mean by

Quote
choose a user and change his shell (man chsh)


I looked up the Manual about this but i'm a novice to this.
What is the shell good for?
...

Offline Stefano

  • *
  • 10,894
  • +3/-0
qmail using anonymous@myplace.com to send mail
« Reply #5 on: June 25, 2007, 12:13:06 PM »
Quote from: "swissis"
Hi Stefano,

What do you mean by

Quote
choose a user and change his shell (man chsh)


I looked up the Manual about this but i'm a novice to this.
What is the shell good for?


Hi..

if you are asking me such a thing, it's not a good choice what I was talking about..

so, let's try another way: can't you set the FROM address in your php page?

Ciao

Stefano

Offline Confucius

  • *****
  • 235
  • +0/-0
qmail using anonymous@myplace.com to send mail
« Reply #6 on: June 25, 2007, 12:19:09 PM »
Stefano,

From what I read he has 1 database that does all with 1 PHP script. The things your are referring too are about each user issues. While I have the impression it's a global script that only has problems with the mail-address.

Offline swissis

  • ***
  • 61
  • +0/-0
qmail using anonymous@myplace.com to send mail
« Reply #7 on: June 25, 2007, 12:20:11 PM »
Dummy
...

Offline swissis

  • ***
  • 61
  • +0/-0
qmail using anonymous@myplace.com to send mail
« Reply #8 on: June 25, 2007, 12:20:48 PM »
Hi, thats the strange thing i did set the FROM part

I have a table in my-sql where all the data is in the code above this i make a connection to the database and collect the info i need to send the mails.

Code: [Select]

       if ($email != '') {
        $msg = "Beste $voorn, je hebt de komende dagen een bijeenkomst\n\n";
        $msg .= "Wat   : $naam\n";
        $msg .= "Datum : $datum\n";
        $msg .= "Tijd  : $tijd\n";
        $msg .= "Plaats: $plaats\n";
        $msg .= "Ruimte: $ruimte\n\n";
        $msg .= "Opm.  : $opmerk\n\n";
        $msg .= "Mensen ik ben aan het testen met dit systeem.\n";
            $msg .= "Niet boos of verdrietig worden als er een mailtje dubbel komt ;-) \n";
            $msg .= "Dit bericht wordt 2 dagen van te voren verzonden, laat ff weten of dat goed is.";
       
        $receipient = $email;


        $subject = "Op $datum $tijd, $naam (dit bericht is automatisch verzonden)";

        $mailheaders = "From: info@myplace.nl <> \n";
        $mailheaders .= "Reply-To: me@myplace.nl\n\n";

        mail($receipient, $subject, $msg, $mailheaders);

        $tempnaam .= ", " . $naamcompl;
        $rows = $rows + 1;

        //echo($msg . "<br>");

       
        } //if


I the qmail log is this strange enough

Code: [Select]

2007-06-21 18:00:01.986275500 new msg 1689654
2007-06-21 18:00:01.986280500 info msg 1689654: bytes 323 from <anonymous@xxxxxxx.com> qp 32111 uid 102
2007-06-21 18:00:02.109099500 starting delivery 93875: msg 1689654 to remote xxxxxx@xxxxxxx.nl
2007-06-21 18:00:02.109105500 status: local 0/10 remote 3/20
2007-06-21 18:00:02.189665500 new msg 1690364
2007-06-21 18:00:02.189671500 info msg 1690364: bytes 651 from <anonymous@xxxxxx.com> qp 32117 uid 102
2007-06-21 18:00:02.200190500 starting delivery 93876: msg 1690364 to remote xxxxx@xxxxx.nl
2007-06-21 18:00:02.200196500 status: local 0/10 remote 4/20
...

Offline swissis

  • ***
  • 61
  • +0/-0
qmail using anonymous@myplace.com to send mail
« Reply #9 on: June 25, 2007, 12:22:49 PM »
Confucius, you are right.

I used to work for many years but some ISP's are rejecting my mails now
...

Offline Confucius

  • *****
  • 235
  • +0/-0
qmail using anonymous@myplace.com to send mail
« Reply #10 on: June 25, 2007, 12:32:01 PM »
You tried to change the From: address already to a full name. You have nothing between the < > now. Might be that this is the reason for not being able to see who it's from.

Offline swissis

  • ***
  • 61
  • +0/-0
qmail using anonymous@myplace.com to send mail
« Reply #11 on: June 25, 2007, 12:38:51 PM »
Right,

So you mean i have to change
Code: [Select]

$mailheaders = "From: info@myplace.nl <> \n";
$mailheaders .= "Reply-To: me@myplace.nl\n\n";

mail($receipient, $subject, $msg, $mailheaders);


into

Code: [Select]

$mailheaders = "From: <info@myplace.nl> \n";
$mailheaders .= "Reply-To: me@myplace.nl\n\n";

mail($receipient, $subject, $msg, $mailheaders);
...

Offline Confucius

  • *****
  • 235
  • +0/-0
qmail using anonymous@myplace.com to send mail
« Reply #12 on: June 25, 2007, 12:56:08 PM »
No, more like :

Code: [Select]
$mailheaders = "From: info@myplace.nl <info@myplace.nl> \n";

Offline swissis

  • ***
  • 61
  • +0/-0
qmail using anonymous@myplace.com to send mail
« Reply #13 on: June 25, 2007, 01:00:03 PM »
okee, i just tried it but without effect.

In the qmail log is still

2007-06-25 13:02:58.863278500 new msg 1690223
2007-06-25 13:02:58.863284500 info msg 1690223: bytes 700 from <anonymous@xxxxxx.com> qp 15760 uid 102
2007-06-25 13:02:58.870144500 starting delivery 99382: msg 1690223 to remote m.xxxxxx@xxxx.nl
2007-06-25 13:02:58.870150500 status: local 0/10 remote 1/20
...

Offline Confucius

  • *****
  • 235
  • +0/-0
qmail using anonymous@myplace.com to send mail
« Reply #14 on: June 25, 2007, 01:12:43 PM »
Weird... tired it myself... send out as root@myspace.nl

Checking for reasons...

info@myspace.nl is an existing/known alias ??