How to change Postfix return-path
I just set up an internal mail server for my office using Postfix, Dovecot and Squirrelmail. It works great except for one tiny problem. When I send mail, I address it to user@myoffice (no .com, .net, etc) and it works perfectly. However, somewhere in my work, I screwed up and for whatever dumb reason put myoffice.net somewhere in there and now the return-path always shows up as user@myoffice.net instead of just user@myoffice. Does anyone know how to fix the return-path so that when someone clicks reply it goes to user@myoffice? I've Googled and searched here without finding my answer, apologies if it's out there and I've just failed to see it. Rest assured I have done a couple hours of searching before finally asking for help.
Thank you! KP |
Can you please post the compete output of 'postconf -n' here so we can review your configuration?
Also it wouldn't hurt to see your '/etc/hosts' file as well. |
Hello, thank you for the reply. Here is postconf -n
Quote:
Quote:
|
I don't know what your servers FQDN is but regardless if it's only internal and doesn't have a .tld, it's still a factor. So your config looks like it's missing some parameters where you problems appears to be coming from:
You're missing or need to correct: mydomain = foo.com myhostname = mail.foo.com myorigin = foo.com mydestination = $myhostname localhost.$mydomain localhost Make those configuration changes in '/etc/postfix/main.cf' & run 'postfix reload' and let me know. Hope that helps! Below is my configuration you can try and use for a reference. Be sure to backup your old before you make ANY changes: # Paths queue_directory = /var/spool/postfix command_directory = /usr/sbin daemon_directory = /usr/lib/postfix mail_owner = postfix sendmail_path = /usr/sbin/sendmail newaliases_path = /usr/bin/newaliases manpage_directory = /usr/share/man sample_directory = /etc/postfix/sample # Domain settings myhostname = mail.mydomain.tld mydomain = mydomain.tld myorigin = $mydomain mydestination = $myhostname, $mydomain, mail.$mydomain # TLS settings smtpd_tls_security_level = may smtpd_tls_cert_file = / smtpd_tls_key_file = / smtpd_tls_session_cache_database = btree:/var/lib/postfix/smtpd_scache smtp_tls_session_cache_database = btree:/var/lib/postfix/smtp_scache smtpd_tls_loglevel = 2 # Network settings inet_interfaces = all inet_protocols = ipv4 mynetworks = $config_directory/mynetworks relayhost = # Email and mailbox settings alias_maps = hash:/etc/postfix/aliases alias_database = $alias_maps home_mailbox = mail/ message_size_limit = 20480000 # SMTP settings smtpd_recipient_restrictions = permit_mynetworks, reject_unauth_destination, reject_non_fqdn_recipient, reject_unknown_recipient_domain, reject_non_fqdn_helo_hostname, reject_invalid_helo_hostname, reject_rbl_client zen.spamhaus.org, reject_rbl_client bl.spamcop.net, check_client_access hash:/etc/postfix/client_access smtpd_sender_restrictions = permit_mynetworks # Misc recipient_delimiter = + |
Thanks for the info. Unfortunately, it's still doing the same thing. However, I found a work-around I hadn't thought of. Something I should have thought of all along. I just need to go into the options in the squirrelmail and it has a place where you can set your reply-to address. It isn't perfect, as I'll have to go into every users options and do this, but at least it will work. I just can't figure out where the ".net" is being pulled from to put in the return-path. Very strange.
Thanks! KP |
Never mind, I found it!!! /etc/mailname was the answer. Thanks for your assistance!
KP |
Oh I didn't know you were using Debian or Ubuntu. Yes, '/etc/mailname' is the problem and Postfix reads straight from that file. I still recommend adding or adjusting your main.cf as posted above but glad it was sorted out and everything's working.
|
Yes, I probably should have mentioned what distro I was using, sorry about that.
I will definitely do what you suggest with my main.cf. Thank you so much for your help! KP |
All times are GMT -5. The time now is 10:23 AM. |