HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials

HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials (http://www.howtoforge.com/forums/index.php)
-   Server Operation (http://www.howtoforge.com/forums/forumdisplay.php?f=5)
-   -   how to configure postfix to send email out for a hosted domain (http://www.howtoforge.com/forums/showthread.php?t=13395)

nox171 13th June 2007 17:46

how to configure postfix to send email out for a hosted domain
 
Hiya all,

i'm having a problem with my Suse server.
I've installed on it ISPConfig with several websites.

Also i've an OScommerce installation running on it...
Let me describe my scenario:

a user is buying something on the shop.
When the purchase is done, oscommerce send a confirmation email to the user.
Everything is fine but not if the user's email domain is hosted on the server.

ie:
demouser@externalhost.com purchase something -> email sent correctly.
demouser@hosteddomain.com purchase something -> the postmaster (myself) receive a bouceback like this:
Code:

The e-mail system was unable to deliver the message, but did not report a specific reason.  Check the address and try again.  If it still fails, contact your system administrator.
            < server1.xxxxxxx.com #5.0.0 X-Postfix; unknown user: "demouser">

I think the mailserver is not sending the email because the email domain address is hosted on the server.
The point is that the domain has not the mailserver on my server but the client is managing it. The MX server is outside the ISPConfig server...

I hope everything is clear... :)
How can I configure postfix to look outside the server and send the email??

thanks
/nox

nox171 14th June 2007 17:00

Any idea??

falko 14th June 2007 21:43

Does demouser@hosteddomain.com exist in /etc/postfix/virtusertable? What's the output of
Code:

postconf -n
?

nox171 15th June 2007 10:59

Hi falko,
inside the vitusertable there isn't that user.

This is the output postconf -n:

Code:

alias_maps = hash:/etc/aliases
biff = no
broken_sasl_auth_clients = yes
canonical_maps = hash:/etc/postfix/canonical
command_directory = /usr/sbin
config_directory = /etc/postfix
daemon_directory = /usr/lib/postfix
debug_peer_level = 2
defer_transports =
disable_dns_lookups = no
disable_mime_output_conversion = no
html_directory = /usr/share/doc/packages/postfix/html
inet_interfaces = all
inet_protocols = all
mail_owner = postfix
mail_spool_directory = /var/mail
mailbox_command =
mailbox_size_limit = 0
mailbox_transport =
mailq_path = /usr/bin/mailq
manpage_directory = /usr/share/man
masquerade_classes = envelope_sender, header_sender, header_recipient
masquerade_domains =
masquerade_exceptions = root
message_size_limit = 10240000
mydestination = /etc/postfix/local-host-names
mydomain = myserverhosts.com
myhostname = server1.$mydomain
newaliases_path = /usr/bin/newaliases
queue_directory = /var/spool/postfix
readme_directory = /usr/share/doc/packages/postfix/README_FILES
relayhost =
relocated_maps = hash:/etc/postfix/relocated
sample_directory = /usr/share/doc/packages/postfix/samples
sender_canonical_maps = hash:/etc/postfix/sender_canonical
sendmail_path = /usr/sbin/sendmail
setgid_group = maildrop
smtp_sasl_auth_enable = no
smtp_tls_note_starttls_offer = yes
smtp_use_tls = yes
smtpd_client_restrictions =
smtpd_helo_required = no
smtpd_helo_restrictions =
smtpd_recipient_restrictions = permit_sasl_authenticated,permit_mynetworks,check_relay_domains
smtpd_sasl_auth_enable = yes
smtpd_sasl_local_domain =
smtpd_sasl_security_options = noanonymous
smtpd_sender_restrictions = hash:/etc/postfix/access
smtpd_tls_CAfile = /etc/postfix/ssl/cacert.pem
smtpd_tls_auth_only = no
smtpd_tls_cert_file = /etc/postfix/ssl/smtpd.crt
smtpd_tls_key_file = /etc/postfix/ssl/smtpd.key
smtpd_tls_loglevel = 1
smtpd_tls_received_header = yes
smtpd_tls_session_cache_timeout = 3600s
smtpd_use_tls = yes
strict_8bitmime = no
strict_rfc821_envelopes = no
tls_random_source = dev:/dev/urandom
transport_maps = hash:/etc/postfix/transport
unknown_local_recipient_reject_code = 550

Ta

falko 15th June 2007 14:35

/etc/postfix/virtusertable isn't included in your Postfix configuration. Please run
Code:

postconf -e 'virtual_maps = hash:/etc/postfix/virtusertable'
/etc/init.d/postfix restart

And then you must create the email address demouser@hosteddomain.com in ISPConfig, because if it doesn't exist, you can't send to it.

nox171 15th June 2007 16:37

Sorry, but I'm not getting that.

Why OSCommerce can send email to "users@nothosteddomain.xxx" and cannot to "@hosteddomain.xxx" ?
Just to be clear the client has just pointed one A Record on my server.
They have their own server for the website and for the email as well.

They are pointing to my server for shop.clientdomain.xxx

Thanks!

falko 16th June 2007 13:42

Quote:

Originally Posted by nox171
Why OSCommerce can send email to "users@nothosteddomain.xxx" and cannot to "@hosteddomain.xxx" ?

You must create a "CatchAll Account" if you want to send emails to @hosteddomain.xxx.

nox171 19th June 2007 13:21

Quote:

Originally Posted by falko
/etc/postfix/virtusertable isn't included in your Postfix configuration. Please run
Code:

postconf -e 'virtual_maps = hash:/etc/postfix/virtusertable'
/etc/init.d/postfix restart

And then you must create the email address demouser@hosteddomain.com in ISPConfig, because if it doesn't exist, you can't send to it.

I'm worried to do some changes to the actual configuration of the entire server because I've got a lot of website on it and they are working all fine.

So I'd like to be really sure before do anything.

I just need ISPConfig to be able to send the email to a @hosteddomain.xxx email address but without looking inside "himself".
Because, of course the user do not exists on the localhost. The email address is hosted somewhere else, where the real mailserver is.

Is there a way to do it?
Because now you gave me 2 information and I'm not sure witch way I should take.


For example if I create the user in ISPConfig and enable the "External Mailserver" option will it send the email without looking inside the server for the user?

Thanks!!

falko 20th June 2007 15:14

Well, at least you must do this:

Code:

postconf -e 'virtual_maps = hash:/etc/postfix/virtusertable'
/etc/init.d/postfix restart

Quote:

For example if I create the user in ISPConfig and enable the "External Mailserver" option will it send the email without looking inside the server for the user?
Yes.

nox171 21st June 2007 16:22

Hello again.
I did what you said Falko.
Now it seems to work with the main email "info@hosteddomain.com", this is the email address that i've add to ISPConfig,
but it is not working if a user with the same domain but a different address i.e. "not_info@hostedomain.com" purchases something!

Do I have to create every user that my client has in is mailserver??

Are we sure isn't there a solution to "route" postifix directly outside itself (localhost) to look for the user and just send the email??

Many thanks!


All times are GMT +2. The time now is 03:48.

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