Need help for sending with mail()

14 posts / 0 new
Last post
#1 Mon, 08/22/2011 - 18:22
zylnia

Need help for sending with mail()

hello i set up a domain (domain.com) with virtualmin, but i cannot send email with mail() (not using any smtp), and i cannot receive email sent to for example contact@domain.com.

my domain is registered at another host company OVH, so the primary and secondary DNS server are at htis webhosting company 's. The dedicated server is at Onlline.

What should i do to make it work? the website is working because in the zone configuration the A record point to the ip of my dedicated server at Online.

What are the tweaking at OVH and Online to make mail() and the reception of email working?

thank you for your help !

Mon, 08/22/2011 - 21:34
andreychek

Howdy,

What you may want to do is look in your email logs to see what's happening with those emails... those are located in /var/log/mail.lor or /var/log/maillog.

Also, if your DNS is hosted elsewhere, be sure to disable the "DNS Domain" feature on your Virtual Server. That can be tweaked by going into Edit Virtual Server -> Enabled Features.

-Eric

Tue, 08/23/2011 - 08:28
zylnia

Hello this is a fresh excerpt of var/log/mail.log : i hope it contains necessary information. What i think is there is a smtp problem isn't it?

Aug 23 15:19:37 sd-23481 postfix/error[2744]: DADCC8116E: to=thomasannuaires@yopmail.com, relay=none, delay=935, delays=933/1/0/0.09, dsn=4.3.0, status=deferred (unknown mail transport error) Aug 23 15:24:36 sd-23481 postfix/qmgr[18324]: DFA3381163: from=gammaseotools@sd-23481.localdomain, size=717, nrcpt=1 (queue active) Aug 23 15:24:36 sd-23481 postfix/qmgr[18324]: A71DA8115D: from=gammaseotools@sd-23481.localdomain, size=708, nrcpt=1 (queue active) Aug 23 15:24:36 sd-23481 postfix/smtp[3181]: fatal: unknown service: smtp/tcp Aug 23 15:24:36 sd-23481 postfix/smtp[3182]: fatal: unknown service: smtp/tcp Aug 23 15:24:37 sd-23481 postfix/qmgr[18324]: warning: private/smtp socket: malformed response Aug 23 15:24:37 sd-23481 postfix/qmgr[18324]: warning: transport smtp failure -- see a previous warning/fatal/panic logfile record for the problem description Aug 23 15:24:37 sd-23481 postfix/master[18322]: warning: process /usr/lib/postfix/smtp pid 3181 exit status 1 Aug 23 15:24:37 sd-23481 postfix/master[18322]: warning: /usr/lib/postfix/smtp: bad command startup -- throttling Aug 23 15:24:37 sd-23481 postfix/qmgr[18324]: warning: private/smtp socket: malformed response Aug 23 15:24:37 sd-23481 postfix/qmgr[18324]: warning: transport smtp failure -- see a previous warning/fatal/panic logfile record for the problem description Aug 23 15:24:37 sd-23481 postfix/master[18322]: warning: process /usr/lib/postfix/smtp pid 3182 exit status 1 Aug 23 15:24:37 sd-23481 postfix/error[3183]: DFA3381163: to=patrimoine62@gmail.com, relay=none, delay=42597, delays=42596/1/0/0.1, dsn=4.3.0, status=deferred (unknown mail transport error) Aug 23 15:24:37 sd-23481 postfix/error[3184]: A71DA8115D: to=zylnia@free.fr, relay=none, delay=55077, delays=55076/1/0/0.13, dsn=4.3.0, status=deferred (unknown mail transport error)

Tue, 08/23/2011 - 08:32
andreychek

Ah, it looks like the Postfix "smtp" service is failing.

My suggestion would be to restart Postfix with "/etc/init.d/postfix restart", and look at the logs immediately after that happens, to see what errors show up then.

Also, can you attach your /etc/postfix/master.cf file? It sounds like there may be a problem with something in it.

Thanks!

-Eric

Tue, 08/23/2011 - 09:09
zylnia

hi irestarted postfix and attached the master.cf file.

Thank you for your responsive help !

Tue, 08/23/2011 - 09:14
andreychek

After restarting Postfix, I suspect you'll see some errors in the mail log... can you post those errors in here?

Thanks!

-Eric

Tue, 08/23/2011 - 12:07
zylnia

indeed there are some weird stuff like my ip been blacklisted...

Tue, 08/23/2011 - 12:42
andreychek

Well, I'm not seeing those "smtp" process errors that were in there previously. And your system seems to be both sending and receiving emails.

Are you still experiencing the same problems that you had previously?

As far as the blacklisted IP goes -- that's just a temporary ban, and your IP doesn't show up in the common blacklists, such as the ones here:

http://www.anti-abuse.org/multi-rbl-check/

So, I'm not seeing any serious errors in your logs there, you may want to try it again.

-Eric

Tue, 08/23/2011 - 15:48
zylnia

hi Eric, i tried to send and email and here is the return error i have. I think something is wrong with the MX record? Please notice that Free.fr is the sister company of online.net (where my dedicated server is rent) why does it say unknown? I still cannot use the mail() function (without specifying the smtp server), and in roundcube. but i can send an email to myself both with mail() and roundcube.

>>>>>>>>>>>>>>>>>>>>
Sujet:
test
De :
zylnia <zylnia@free.fr>
Date :
Tue, 23 Aug 2011 22:10:50 +0200
Pour :
contact@gammaseotools.com
Received:
from [192.168.0.90] (unknown [88.176.211.184]) by smtp2-g21.free.fr (Postfix) with ESMTP id 62B624B0156 for <contact@gammaseotools.com>; Tue, 23 Aug 2011 22:10:31 +0200 (CEST)
ID du message :
<4E54094A.2050808@free.fr>
Agent utilisateur:
Mozilla/5.0 (Windows; U; Windows NT 6.1; fr; rv:1.9.2.20) Gecko/20110804 Thunderbird/3.1.12
Version de MIME:
1.0
Content-Type:
text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding:
7bit
Wed, 08/24/2011 - 08:58
andreychek

Howdy,

The IP "88.xxx.xxx.184" that is listed in the received headers, is that your servers IP address?

-Eric

Wed, 08/24/2011 - 11:22 (Reply to #10)
zylnia

Hi Eric, this IP is not my server, mine is 88.191.129.202.

I can now send email with mail(), and free.fr has lifted the ban on my IP. Why can i send only to myself?

I first hosted gammaseotools.com on my dedicated server at OVH, but now have moved to the online.net Dedibox. So the zone file still exists on my Dedibox, should i delete gammaseotools.com from the OVH server (Zone file and virtual server? for your information i made a screenshot of the configuration at OVH (the registrar)

Wed, 08/24/2011 - 13:02
andreychek

Howdy,

If you have a DNS zone file for a domain, but you don't intend on hosting DNS for that domain -- I would suggest removing that DNS zone... that could certainly cause problems.

I'd also suggest attempting to send an email to a different account -- perhaps a Gmail account -- and then review the logs to see what happens to that email. If it works going to a Gmail account, then it may be related to just that one domain that you once hosted.

-Eric

Wed, 08/24/2011 - 14:21 (Reply to #12)
zylnia

here is the log after sending a mail to gmail, seems all good.

Aug 24 20:32:33 sd-23481 postfix/qmgr[4771]: 1691981162: from=gammaseotools@sd-23481.localdomain, size=667, nrcpt=1 (queue active) Aug 24 20:32:33 sd-23481 postfix/smtp[5702]: 1691981162: to=gammatools@gmail.com, relay=gmail-smtp-in.l.google.com[74.125.79.27]:25, delay=0.57, delays=0.21/0.02/0.13/0.21, dsn=2.0.0, status=sent (250 2.0.0 OK 1314210753 t1si1448456eef.116) Aug 24 20:32:33 sd-23481 postfix/qmgr[4771]: 1691981162: removed

Since gammaseotools.com dns are set to ns17.ovh.net (primary) and dns17.ovh.net, there is a zone file at ovh for this domain, i removed the zone file on my Dedibox in Bind is it ok?

Wed, 08/24/2011 - 15:00
andreychek

Looks like that email to Gmail went through just fine.

As far as your other domain goes -- normally, you can remove DNS settings by just going into Edit Virtual Server -> Enabled Features, and disable the "BIND DNS Domain" feature.

If you don't have that domain setup in Virtualmin, then yeah, you can simply remove the BIND zone file (and the related configuration).

-Eric

Topic locked