LinuxQuestions.org
Support LQ: Use code LQ3 and save $3 on Domain Registration
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices



Reply
 
Search this Thread
Old 11-29-2010, 08:24 PM   #1
KPryor
Member
 
Registered: Nov 2006
Distribution: Linux Mint, Ubuntu 10.10 Desktop and Server
Posts: 36

Rep: Reputation: 15
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
 
Old 11-29-2010, 08:32 PM   #2
carlosinfl
Senior Member
 
Registered: May 2004
Location: Orlando, FL
Distribution: Arch
Posts: 2,905

Rep: Reputation: 73
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.
 
Old 11-29-2010, 08:44 PM   #3
KPryor
Member
 
Registered: Nov 2006
Distribution: Linux Mint, Ubuntu 10.10 Desktop and Server
Posts: 36

Original Poster
Rep: Reputation: 15
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
 
Old 11-29-2010, 09:40 PM   #4
carlosinfl
Senior Member
 
Registered: May 2004
Location: Orlando, FL
Distribution: Arch
Posts: 2,905

Rep: Reputation: 73
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.
 
Old 11-29-2010, 10:05 PM   #5
KPryor
Member
 
Registered: Nov 2006
Distribution: Linux Mint, Ubuntu 10.10 Desktop and Server
Posts: 36

Original Poster
Rep: Reputation: 15
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.
 
Old 11-29-2010, 10:38 PM   #6
KPryor
Member
 
Registered: Nov 2006
Distribution: Linux Mint, Ubuntu 10.10 Desktop and Server
Posts: 36

Original Poster
Rep: Reputation: 15
Never mind, I found it!!! /etc/mailname was the answer. Thanks for your assistance!
KP
 
Old 11-30-2010, 08:15 AM   #7
carlosinfl
Senior Member
 
Registered: May 2004
Location: Orlando, FL
Distribution: Arch
Posts: 2,905

Rep: Reputation: 73
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.
 
Old 11-30-2010, 11:57 AM   #8
KPryor
Member
 
Registered: Nov 2006
Distribution: Linux Mint, Ubuntu 10.10 Desktop and Server
Posts: 36

Original Poster
Rep: Reputation: 15
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
 
  


Reply

Tags
postfix


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to configure postfix to reject mails having invalid return path badboynick21 Linux - Server 17 09-14-2010 01:28 PM
CLI how to change Return-Path in mail donnied Linux - Newbie 2 08-22-2008 06:10 PM
Postfix change return-path and writing own script for master.cf alitrix Linux - Server 7 07-25-2008 01:49 PM
SLES 10 - Postfix mailer config - Return Path overwritten HuffmanT Linux - Enterprise 1 05-26-2008 11:12 PM
Postfix: why is 'Return-Path' of bounce message empty Chowroc Linux - Networking 1 12-28-2005 04:52 AM


All times are GMT -5. The time now is 10:32 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration