I've managed to setup a simple mail server that is working on every level but with one exception: when I'm sending email to an external email address, the receiver is seeing it as coming from blabla@example.com (that is literally the domain that appears "example.com)

The mail server has been setup like this: Postfix+dovecot+squirrelmail ( with sasl ) for a specific domain: mydomain.com (it's not literally the name of the domain). I've setup the MX record for the domain, etc, etc...bottom of the line is that I can send mail from this mail server and I can receive mail if one would specifically sent it to an email address on my mail server.

Now I've setup the /etc/postfix/main.conf file like this:

smtpd_banner = $myhostname ESMTP $mail_name (Debian/GNU)

biff = no

append_dot_mydomain = no

readme_directory = no

smtpd_sasl_auth_enable = yes

smtpd_sasl_local_domain = mydomain.com

smtpd_recipient_restrictions = permit_mynetworks,permit_sasl_authenticated,reject_unauth_destination

smtpd_sasl_security_options = noanonymous




smtpd_tls_session_cache_database = btree:${data_directory}/smtpd_scache

myhostname = xxxxx.xxx.xxx.xxx

alias_maps = hash:/etc/aliases

alias_database = hash:/etc/aliases

mydomain = mydomain.com

myorigin = /etc/mailname (in /etc/mailname I have set the mailname to mydomain.com )

mydestination = mydomain.com, xxxxx.xxx.xxx.xxx, localhost.xxx.xxx.xxx, localhost

relayhost =

mynetworks = [::ffff:]/104 [::1]/128

mailbox_size_limit = 0

recipient_delimiter = +

inet_interfaces = all

What am I missing here ?

migrated from stackoverflow.com Feb 7 '11 at 13:30

This question came from our site for professional and enthusiast programmers.

  • Nevermind...like always...I'm struggling more than an hour to find a solution, I'm wasting 10-20 min to create a question for others to answer, and then 5 min after I've posted it...the solution was so easy. It was a problem with Squirrelmail. I had to enter into its configure panel and there to set the server settings->domain from example.com to mydomain.com – Progenitura Feb 7 '11 at 1:31

Make sure to check the squirrelmail configuration as well, sometimes the problem might be there.


<bot>Steal comment and put it to appriacate place</bot>

It was a problem with Squirrelmail because of wrong default domain. To fix this I had to reconfigure the squirrelmail with configuration tool config/conf.pl.

  • Select 2. Server settings
  • Select 1. Domain
  • Change from example.com to mydomain.com

This configuration will be used as default domain.

References: Squirrelmail documentation

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy