Linux - Server This forum is for the discussion of Linux Software used in a server related context. |
Notices |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
 |
11-29-2010, 08:24 PM
|
#1
|
Member
Registered: Nov 2006
Distribution: Ubuntu server and Ubuntu Mate
Posts: 45
Rep:
|
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
|
|
|
11-29-2010, 08:32 PM
|
#2
|
Senior Member
Registered: May 2004
Location: Orlando, FL
Distribution: Arch
Posts: 2,905
Rep:
|
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.
|
|
|
11-29-2010, 08:44 PM
|
#3
|
Member
Registered: Nov 2006
Distribution: Ubuntu server and Ubuntu Mate
Posts: 45
Original Poster
Rep:
|
Hello, thank you for the reply. Here is postconf -n
Quote:
root@myoffice:/# postconf -n
alias_database = hash:/etc/aliases
alias_maps = hash:/etc/aliases
append_dot_mydomain = no
biff = no
config_directory = /etc/postfix
default_transport = error
inet_interfaces = loopback-only
mailbox_command = procmail -a "$EXTENSION"
mailbox_size_limit = 0
mydestination = myoffice, localhost.localdomain, localhost
myhostname = myoffice
readme_directory = no
recipient_delimiter = +
relay_transport = error
smtp_tls_session_cache_database = btree:${data_directory}/smtp_scache
smtpd_banner = $myhostname ESMTP $mail_name (Ubuntu)
smtpd_tls_cert_file = /etc/ssl/certs/ssl-cert-snakeoil.pem
smtpd_tls_key_file = /etc/ssl/private/ssl-cert-snakeoil.key
smtpd_tls_session_cache_database = btree:${data_directory}/smtpd_scache
smtpd_use_tls = yes
|
And here is my /etc/hosts
Quote:
root@myoffice:/# less /etc/hosts
127.0.0.1 localhost
127.0.1.1 myoffice
# The following lines are desirable for IPv6 capable hosts
::1 localhost ip6-localhost ip6-loopback
fe00::0 ip6-localnet
ff00::0 ip6-mcastprefix
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters
|
|
|
|
11-29-2010, 09:40 PM
|
#4
|
Senior Member
Registered: May 2004
Location: Orlando, FL
Distribution: Arch
Posts: 2,905
Rep:
|
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 = +
Last edited by carlosinfl; 11-29-2010 at 09:46 PM.
|
|
1 members found this post helpful.
|
11-29-2010, 10:05 PM
|
#5
|
Member
Registered: Nov 2006
Distribution: Ubuntu server and Ubuntu Mate
Posts: 45
Original Poster
Rep:
|
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
Last edited by KPryor; 11-29-2010 at 10:35 PM.
|
|
|
11-29-2010, 10:38 PM
|
#6
|
Member
Registered: Nov 2006
Distribution: Ubuntu server and Ubuntu Mate
Posts: 45
Original Poster
Rep:
|
Never mind, I found it!!! /etc/mailname was the answer. Thanks for your assistance!
KP
|
|
|
11-30-2010, 08:15 AM
|
#7
|
Senior Member
Registered: May 2004
Location: Orlando, FL
Distribution: Arch
Posts: 2,905
Rep:
|
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.
|
|
|
11-30-2010, 11:57 AM
|
#8
|
Member
Registered: Nov 2006
Distribution: Ubuntu server and Ubuntu Mate
Posts: 45
Original Poster
Rep:
|
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 03:34 AM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|