Once again, I need your help. I just hope this is the appropriate place for this. If not, let me know and I'll move the message.

I have set up LAMP on a server, which is also running Postfix. I set postfix to send outgoing mail through a company smtp server over port 25 (relay_host=[smtpserver.company.com]:25). On this server, I have two virtual domains. One is using the hostname of the machine as the fqdn (host.mydomain.com) and the other is using a completely different domain and tld (www.mydomain.org). I have SPToolkit set up  on both domains. When I send an email via SPT on the host using the hostname, the mail sends without issue. However, when I try to send an email via SPT from www.mydomain2.org (virtual host) the email will not send. I have tried setting it up as a virtual domain in Postfix, but that did nothing. I tried adding it to mydestination in main.cf I get no change. I've spent nearly a week researching this and playing arround with the configuration with absolutely no luck. Does anyone know what I am doing wrong?

Here's my main.cf as it currently stands, with names changed. I do not have virtual aliases setup here.

#myorigin = /etc/mailname

smtpd_banner = $myhostname ESMTP $mail_name (Debian/GNU)
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

readme_directory = no

# TLS parameters
smtpd_tls_session_cache_database = btree:${data_directory}/smtpd_scache
smtp_tls_session_cache_database = btree:${data_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.

smtpd_relay_restrictions = permit_mynetworks permit_sasl_authenticated defer_unauth_destination
myhostname = host.mydomain.com
alias_maps = hash:/etc/aliases
alias_database = hash:/etc/aliases
myorigin = /etc/mailname
mydestination = host.mydomain.com, localhost.mydomain.com, , localhost
relayhost = [smtpserver.mydomain.com
mynetworks = [::ffff:]/104 [::1]/128
mailbox_size_limit = 0
recipient_delimiter = +

Thank you for your help. I can attempt to explain this better if need be. To summarize

Domain one - same as hostname - sends email as expected

Domain two - set up as a virtual host - email from this address will not go out.

BTW, the dns, mx records, etc for domain two have been registered and are active.



Jeremy Davis's picture

Are you sure that it's not sending and just being intercepted somewhere?

I would be digging into the logs for ideas on what might be going wrong. If the mail is not sending then the postfix logs (should be in /var/log) should give you good pointers. If nothing there then perhaps check your SMTP logs; perhaps that will shed some light on it?

Add new comment