HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials

HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials (http://www.howtoforge.com/forums/index.php)
-   Installation/Configuration (http://www.howtoforge.com/forums/forumdisplay.php?f=16)
-   -   Small error with mail script on my website (http://www.howtoforge.com/forums/showthread.php?t=24025)

jorizzzz 9th June 2008 18:09

Small error with mail script on my website
 
I've got a strange problem with a mail script on my website. This script is a contact form that emails me with questions from users. But since i've began using an external mail server, the emails aren't delivered any more. I've done the following things:

- Deleted my old mail accounts on the server
- Deleted the mx records
- set the mailserver (domain -> options -> mailserver) to external

If i'm checking my log files while sending an e-mail, it says that it deliveres it to www-data@YH-Linux01.mydomain.com instead of csd@mydomain.nl what i've entered in the mail form..

YH-Linux01.mydomain.nl is the hostname of my server...

Here is a piece of code of the mail form:

Code:

mail("$ContactWebsiteNaam <$ContactEmail>","$ContactOnderwerp","$Body","$Hoofd");
Where $ContactEmail is csd@mydomain.nl

How can i correct these problems? This is the message from my mail.log:

Code:

Jun  9 18:06:37 YH-Linux01 postfix/local[29337]: AC67F1D005B: to=<www-data@YH-Linux01.mydomain.nl>, relay=local, delay=0.07, delays=0.03/0/0/0.04, dsn=2.0.0, status=sent (delivered to command: procmail -a "$EXTENSION")
As you can see, it is not mailed to my domain but to the hostname of my server...

falko 10th June 2008 14:32

What's in /etc/postfix/main.cf and /etc/hosts? What's the output of
Code:

hostname -f
?

jorizzzz 10th June 2008 14:42

Quote:

Originally Posted by falko (Post 130417)
What's in /etc/postfix/main.cf and /etc/hosts? What's the output of
Code:

hostname -f
?

Main.cf:
Code:

# Debian specific:  Specifying a file name will cause the first
# line of that file to be used as the name.  The Debian default
# is /etc/mailname.
#myorigin = /etc/mailname

smtpd_banner = $myhostname ESMTP $mail_name (Ubuntu)
biff = no

# appending .domain is the MUA's job.
append_dot_mydomain = no

# Uncomment the next line to generate "delayed mail" warnings
#delay_warning_time = 4h

# TLS parameters
smtpd_tls_cert_file = /etc/postfix/ssl/smtpd.crt
smtpd_tls_key_file = /etc/postfix/ssl/smtpd.key
smtpd_use_tls = yes
smtpd_tls_session_cache_database = btree:${queue_directory}/smtpd_scache
smtp_tls_session_cache_database = btree:${queue_directory}/smtp_scache

# See /usr/share/doc/postfix/TLS_README.gz in the postfix-doc package for
# information on enabling SSL in the smtp client.

message_size_limit = 20971520
myhostname = YH-Linux01.mydomain.nl
alias_maps = hash:/etc/aliases
alias_database = hash:/etc/aliases
myorigin = /etc/mailname
#mydestination = YH-Linux01.mydomain.nl, localhost.mydomain.nl, localhost
relayhost =
mynetworks = 127.0.0.0/8
mailbox_command = procmail -a "$EXTENSION"
mailbox_size_limit = 0
message_size_limit = 25000000
recipient_delimiter = +
inet_interfaces = all
inet_protocols = all
smtpd_sasl_local_domain =
smtpd_sasl_auth_enable = yes
smtpd_sasl_security_options = noanonymous
broken_sasl_auth_clients = yes
smtpd_recipient_restrictions = permit_sasl_authenticated,permit_mynetworks,reject_unauth_destination
smtpd_tls_auth_only = no
smtp_use_tls = yes
smtp_tls_note_starttls_offer = yes
smtpd_tls_CAfile = /etc/postfix/ssl/cacert.pem
smtpd_tls_loglevel = 1
smtpd_tls_received_header = yes
smtpd_tls_session_cache_timeout = 3600s
tls_random_source = dev:/dev/urandom

virtual_maps = hash:/etc/postfix/virtusertable

mydestination = /etc/postfix/local-host-names

smtpd_helo_required = yes
disable_vrfy_command = yes
strict_rfc821_envelopes = yes

maps_rbl_domains =
            multi.uribl.com,
            dsn.rfc-ignorant.org,
            dul.dnsbl.sorbs.net,
            list.dsbl.org,
            sbl-xbl.spamhaus.org,
            bl.spamcop.net,
            dnsbl.sorbs.net,
            cbl.abuseat.org,
            ix.dnsbl.manitu.net,
            combined.rbl.msrbl.net,
            rabl.nuclearelephant.com

smtpd_recipient_restrictions =
            permit_sasl_authenticated,
            permit_mynetworks,
            reject_invalid_hostname,
            reject_non_fqdn_hostname,
            reject_non_fqdn_sender,
            reject_unknown_sender_domain,
            reject_unknown_recipient_domain,
            reject_maps_rbl,
            check_relay_domains

/etc/hosts:
Code:

127.0.0.1      localhost.localdomain          localhost
xxx.xxx.xxx.xxx  YH-Linux01.mydomain.nl      YH-Linux01

I've hidden the actual IP address

Output of hostname -f:
Code:

YH-Linux01.mydomain.nl

falko 11th June 2008 13:02

What's in /etc/postfix/local-host-names, /etc/mailname, and /etc/aliases?

jorizzzz 11th June 2008 13:44

Quote:

Originally Posted by falko (Post 130589)
What's in /etc/postfix/local-host-names, /etc/mailname, and /etc/aliases?

Local-host-names:
Code:

localhost
YH-Linux01.mydomain.nl
localhost.YH-Linux01.mydomain.nl
localhost.mydomain.nl
localhost.localdomain
mydomain.nl

and ofcourse the domains of my clients

/etc/mailname:
Code:

YH-Linux01.mydomain.nl
/etc/aliases:
Code:

# Added by installer for initial user
root:  fred
clamav: root


falko 12th June 2008 14:34

The problem is that mydomain.nl is listed in /etc/postfix/local-host-names. Did you set the Co-Domain mydomain.nl to external mailserver as well in ISPConfig (go to Co-Domains, select mydomain.nl, and then go to the Options tab)?

jorizzzz 13th June 2008 16:06

Quote:

Originally Posted by falko (Post 130828)
The problem is that mydomain.nl is listed in /etc/postfix/local-host-names. Did you set the Co-Domain mydomain.nl to external mailserver as well in ISPConfig (go to Co-Domains, select mydomain.nl, and then go to the Options tab)?

Yes it is set to external mailserver. The ispconfig messages aren't coming in as well... These are sent to the same e-mail address.

What is the best option for this? Remove the entry in local-host-names?

falko 14th June 2008 19:44

Quote:

Originally Posted by jorizzzz (Post 131035)
Yes it is set to external mailserver.

On the Co-Domains tab, or only for the main domain of the site?

Quote:

Originally Posted by jorizzzz (Post 131035)
What is the best option for this? Remove the entry in local-host-names?

No, because ISPConfig will overwrite your changes...


All times are GMT +2. The time now is 11:40.

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