PDA

View Full Version : mail() don't work, The Perfect Setup Ubuntu 6.10


antoinel12
22nd November 2006, 05:02
Hello,

I recently installed my server. It run fine except for the mail sending. My PHP scripts can't send mail with the function mail(). In phpMyVisites I can see that the function is activated on the server but not seems to work...

till
22nd November 2006, 11:56
Which messages do you get in the mail.log when you send mail?

antoinel12
22nd November 2006, 14:10
where is that file?

antoinel12
23rd November 2006, 01:16
Ok, I've got it, I'll past you in a next post what is in my log...

antoinel12
23rd November 2006, 01:44
This is what I see in pico...Nov 22 18:40:03 serveur postfix/pickup[3692]: BF25C1781FA: uid=0 from=<root>
Nov 22 18:40:03 serveur postfix/cleanup[4277]: BF25C1781FA: message-id=<20061122$
Nov 22 18:40:03 serveur postfix/qmgr[18902]: BF25C1781FA: from=<root@serveur.ant$
Nov 22 18:40:03 serveur postfix/local[4279]: BF25C1781FA: to=<administrateur@ser$
Nov 22 18:40:03 serveur postfix/qmgr[18902]: BF25C1781FA: removed

falko
23rd November 2006, 17:10
Please run tail -f /var/log/mail.log, and at the same time send an email with PHP's mail() function. What happens in the tail output?

antoinel12
24th November 2006, 05:57
Thanks, here is what I see :
Nov 23 22:45:03 serveur postfix/pickup[28231]: 976341781E6: uid=0 from=<root>
Nov 23 22:45:03 serveur postfix/cleanup[28701]: 976341781E6: message-id=<20061124034503.976341781E6@serveur.antoinel12.is-a-geek.net>
Nov 23 22:45:03 serveur postfix/qmgr[9049]: 976341781E6: from=<root@serveur.antoinel12.is-a-geek.net>, size=563, nrcpt=1 (queue active)
Nov 23 22:45:03 serveur postfix/local[28703]: 976341781E6: to=<administrateur@serveur.antoinel12.is-a-geek.net>, orig_to=<root>, relay=local, delay=1.1, delays=1/0.02/0/0.02, dsn=2.0.0, status=sent (delivered to maildir)
Nov 23 22:45:03 serveur postfix/qmgr[9049]: 976341781E6: removed
Nov 23 22:50:03 serveur postfix/pickup[28231]: A60A51781E6: uid=0 from=<root>
Nov 23 22:50:03 serveur postfix/cleanup[28768]: A60A51781E6: message-id=<20061124035003.A60A51781E6@serveur.antoinel12.is-a-geek.net>
Nov 23 22:50:03 serveur postfix/qmgr[9049]: A60A51781E6: from=<root@serveur.antoinel12.is-a-geek.net>, size=563, nrcpt=1 (queue active)
Nov 23 22:50:03 serveur postfix/local[28770]: A60A51781E6: to=<administrateur@serveur.antoinel12.is-a-geek.net>, orig_to=<root>, relay=local, delay=1.1, delays=1.1/0.02/0/0.02, dsn=2.0.0, status=sent (delivered to maildir)
Nov 23 22:50:03 serveur postfix/qmgr[9049]: A60A51781E6: removed
Nov 23 22:52:59 serveur postfix/smtpd[28829]: connect from localhost.localdomain[127.0.0.1]
Nov 23 22:52:59 serveur postfix/smtpd[28829]: 33567178207: client=localhost.localdomain[127.0.0.1]
Nov 23 22:52:59 serveur postfix/cleanup[28832]: 33567178207: message-id=<eb13eb060e1edb803012076505465010@stats.antoinel12. is-a-geek.net>
Nov 23 22:52:59 serveur postfix/qmgr[9049]: 33567178207: from=<phpmyvisites@gmail.com>, size=13901, nrcpt=1 (queue active)
Nov 23 22:52:59 serveur postfix/smtpd[28829]: disconnect from localhost.localdomain[127.0.0.1]
Nov 23 22:52:59 serveur postfix/smtpd[28829]: connect from localhost.localdomain[127.0.0.1]
Nov 23 22:52:59 serveur postfix/smtpd[28829]: 4A647178208: client=localhost.localdomain[127.0.0.1]
Nov 23 22:52:59 serveur postfix/cleanup[28832]: 4A647178208: message-id=<5178b8c337016ec8309b090b7d2140ea@stats.antoinel12. is-a-geek.net>
Nov 23 22:52:59 serveur postfix/qmgr[9049]: 4A647178208: from=<phpmyvisites@gmail.com>, size=9834, nrcpt=1 (queue active)
Nov 23 22:52:59 serveur postfix/smtpd[28829]: disconnect from localhost.localdomain[127.0.0.1]
Nov 23 22:52:59 serveur postfix/smtpd[28829]: connect from localhost.localdomain[127.0.0.1]
Nov 23 22:52:59 serveur postfix/smtpd[28829]: 5CF10178209: client=localhost.localdomain[127.0.0.1]
Nov 23 22:52:59 serveur postfix/cleanup[28832]: 5CF10178209: message-id=<150f3f82e471eea662690079b8c16cd9@stats.antoinel12. is-a-geek.net>
Nov 23 22:52:59 serveur postfix/qmgr[9049]: 5CF10178209: from=<phpmyvisites@gmail.com>, size=9842, nrcpt=1 (queue active)
Nov 23 22:52:59 serveur postfix/smtpd[28829]: disconnect from localhost.localdomain[127.0.0.1]
Nov 23 22:52:59 serveur postfix/smtpd[28829]: connect from localhost.localdomain[127.0.0.1]
Nov 23 22:52:59 serveur postfix/smtpd[28829]: 6E19017820A: client=localhost.localdomain[127.0.0.1]
Nov 23 22:52:59 serveur postfix/cleanup[28832]: 6E19017820A: message-id=<8e95c88589c7b66b20d6914df9bc8f72@stats.antoinel12. is-a-geek.net>
Nov 23 22:52:59 serveur postfix/qmgr[9049]: 6E19017820A: from=<phpmyvisites@gmail.com>, size=13915, nrcpt=1 (queue active)
Nov 23 22:52:59 serveur postfix/smtpd[28829]: disconnect from localhost.localdomain[127.0.0.1]
Nov 23 22:52:59 serveur postfix/smtpd[28829]: connect from localhost.localdomain[127.0.0.1]
Nov 23 22:52:59 serveur postfix/smtpd[28829]: 828A717820B: client=localhost.localdomain[127.0.0.1]
Nov 23 22:52:59 serveur postfix/cleanup[28832]: 828A717820B: message-id=<478cde5786d120c83e19154c942c8296@stats.antoinel12. is-a-geek.net>
Nov 23 22:52:59 serveur postfix/qmgr[9049]: 828A717820B: from=<phpmyvisites@gmail.com>, size=9842, nrcpt=1 (queue active)
Nov 23 22:52:59 serveur postfix/smtpd[28829]: disconnect from localhost.localdomain[127.0.0.1]
Nov 23 22:53:29 serveur postfix/smtp[28833]: connect to gmail-smtp-in.l.google.com[64.233.167.114]: Connection timed out (port 25)
Nov 23 22:53:29 serveur postfix/smtp[28834]: connect to gmail-smtp-in.l.google.com[64.233.163.27]: Connection timed out (port 25)
Nov 23 22:53:29 serveur postfix/smtp[28835]: connect to gmail-smtp-in.l.google.com[64.233.167.114]: Connection timed out (port 25)
Nov 23 22:53:29 serveur postfix/smtp[28836]: connect to gmail-smtp-in.l.google.com[64.233.163.114]: Connection timed out (port 25)
Nov 23 22:53:29 serveur postfix/smtp[28837]: connect to gmail-smtp-in.l.google.com[64.233.167.114]: Connection timed out (port 25)
Nov 23 22:53:59 serveur postfix/smtp[28833]: connect to gmail-smtp-in.l.google.com[64.233.167.27]: Connection timed out (port 25)
Nov 23 22:53:59 serveur postfix/smtp[28834]: connect to gmail-smtp-in.l.google.com[64.233.163.114]: Connection timed out (port 25)
Nov 23 22:53:59 serveur postfix/smtp[28835]: connect to gmail-smtp-in.l.google.com[64.233.167.27]: Connection timed out (port 25)
Nov 23 22:53:59 serveur postfix/smtp[28836]: connect to gmail-smtp-in.l.google.com[64.233.163.27]: Connection timed out (port 25)
Nov 23 22:53:59 serveur postfix/smtp[28837]: connect to gmail-smtp-in.l.google.com[64.233.167.27]: Connection timed out (port 25)
Nov 23 22:54:29 serveur postfix/smtp[28833]: connect to alt2.gmail-smtp-in.l.google.com[64.233.183.114]: Connection timed out (port 25)
Nov 23 22:54:29 serveur postfix/smtp[28834]: connect to alt1.gmail-smtp-in.l.google.com[64.233.185.114]: Connection timed out (port 25)
Nov 23 22:54:29 serveur postfix/smtp[28835]: connect to alt2.gmail-smtp-in.l.google.com[66.249.93.114]: Connection timed out (port 25)
Nov 23 22:54:29 serveur postfix/smtp[28836]: connect to alt2.gmail-smtp-in.l.google.com[64.233.183.114]: Connection timed out (port 25)
Nov 23 22:54:29 serveur postfix/smtp[28837]: connect to alt1.gmail-smtp-in.l.google.com[66.249.83.114]: Connection timed out (port 25)



I don't understand all these connections too google mail...

I tried with the send stats to user's email function

falko
25th November 2006, 14:40
Are you trying to send to an gmail account?
Please check if you are blacklisted: http://www.mxtoolbox.com/blacklists.aspx

Also make sure your ISP doesn't block port 25.

antoinel12
25th November 2006, 19:02
RESULT: serveur.antoinel12.is-a-geek.net

Banner: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond

Do I need to configure something in my domain name acount (Dyndns)

falko
26th November 2006, 16:51
You're on lots of blacklists, and besides I can't connect to your mail server. Make sure Postfix is running and that your firewall doesn't block port 25.

antoinel12
27th November 2006, 03:28
What I do to not be on a blacklist? I did nothing bad, I've just installed my server since 2 week. Like you said, it looklike to have a problem to access postfix. The port forwarding for port 25 is activated in my router and in the firewall of ISPconfig. Postfix is running...

I don't know what to do, I folowed the Perfect Setup guide...

falko
27th November 2006, 15:47
First, I guess your server is on a dynamic IP address. Most dynamic IP addresses are blacklisted by default because they are abused by lots of spammers. There's nothing you can do about it. If you still want to send mails with your server, you should relay through another mail server: http://www.howtoforge.com/forums/showthread.php?t=72&highlight=relayhost

Also, you should ask your ISP if they block port 25.