DaemonForums  

Go Back   DaemonForums > FreeBSD > FreeBSD Ports and Packages

FreeBSD Ports and Packages Installation and upgrading of ports and packages on FreeBSD.

Reply
 
Thread Tools Display Modes
  #1   (View Single Post)  
Old 1st June 2010
xiphias xiphias is offline
Port Guard
 
Join Date: May 2008
Posts: 31
Default postfix aliases configuration error

Hi,

postfix seems to be ignoring my aliases file. There are no errors output when postfix starts, nor any errors logged while it is running. I'm pretty sure I will have an error somewhere but can't see the wood for the trees.

main.cf:
Code:
queue_directory = /var/spool/postfix
command_directory = /usr/local/sbin
daemon_directory = /usr/local/libexec/postfix
data_directory = /var/db/postfix
append_dot_mydomain = no
mail_owner = postfix
myhostname = coppermine.abcdef.co.uk
myorigin = $myhostname
inet_interfaces = 172.16.1.1, localhost
mydestination = $myhostname, coppermine, coppermine.intranet.abcdef.co.uk, localhost.        $mydomain, localhost
unknown_local_recipient_reject_code = 550
mynetworks = 127.0.0.0/8, 172.16.1.0/24, 172.16.4.0/24
alias_maps = hash:/etc/aliases
alias_database = hash:/etc/aliases
transport_maps = hash:/usr/local/etc/postfix/transport
smtpd_client_restrictions = permit_mynetworks, reject
message_size_limit = 52428800
mailbox_size_limit = 5242880000
debug_peer_level = 2
debugger_command =
     PATH=/bin:/usr/bin:/usr/local/bin:/usr/X11R6/bin
     ddd $daemon_directory/$process_name $process_id & sleep 5
sendmail_path = /usr/local/sbin/sendmail
newaliases_path = /usr/local/bin/newaliases
mailq_path = /usr/local/bin/mailq
setgid_group = maildrop
html_directory = /usr/local/share/doc/postfix
manpage_directory = /usr/local/man
sample_directory = /usr/local/etc/postfix
readme_directory = /usr/local/share/doc/postfix
/etc/aliases:
Code:
root:   philip@vm-lxsrv-001.intranet.abcdef.co.uk

# Basic system aliases -- these MUST be present
MAILER-DAEMON: postmaster
postmaster: root

# General redirections for pseudo accounts
_dhcp:  root
_pflogd: root
bin:    root
bind:   root
daemon: root
games:  root
kmem:   root
mailnull: postmaster
man:    root
news:   root
nobody: root
operator: root
pop:    root
proxy:  root
smmsp:  postmaster
sshd:   root
system: root
toor:   root
tty:    root
usenet: news
uucp:   root

# NETWORK OPERATIONS MAILBOX NAMES
abuse:  root
# noc:      root
security:   root

# SUPPORT MAILBOX NAMES FOR SPECIFIC INTERNET SERVICES
ftp:        root
ftp-bugs:   ftp
/usr/local/etc/postfix/transport:
Code:
.intranet.abcdef.co.uk  :
*                          smtp:relay.isp.net
Code:
coppermine# postmap -q root hash:/etc/aliases
philip@vm-lxsrv-001.intranet.abcdef.co.uk
and, finally the log output when I try to send a mail to root:
Code:
Jun  1 20:36:32 coppermine postfix/pickup[47277]: 6770E2288F: uid=0 from=<root>
Jun  1 20:36:32 coppermine postfix/cleanup[47582]: 6770E2288F: message-id=<20100601203632.6770E2288F@coppermine.abcdef.co.uk>
Jun  1 20:36:32 coppermine postfix/qmgr[47278]: 6770E2288F: from=<root@coppermine.abcdef.co.uk>, size=349, nrcpt=1 (queue active)
Jun  1 20:36:32 coppermine postfix/smtp[47584]: 6770E2288F: to=<root@coppermine.abcdef.co.uk>, orig_to=<root>, relay=relay.isp.net[xxx.xxx.xxx.xxx]:25, delay=0.47, delays=0.04/0.02/0.15/0.26, dsn=2.0.0, status=sent (250 X-ISPnet-Relay: 61607e369755bd544f3912b44ee78834)
Jun  1 20:36:32 coppermine postfix/qmgr[47278]: 6770E2288F: removed
Someone please put me out of my misery,
Phil
Reply With Quote
  #2   (View Single Post)  
Old 1st June 2010
J65nko J65nko is offline
Administrator
 
Join Date: May 2008
Location: Budel - the Netherlands
Posts: 4,125
Default

Did you run [/usr/local/bin/newaliases to 'compile' the plain text /etc/aliases file into database format?
__________________
You don't need to be a genius to debug a pf.conf firewall ruleset, you just need the guts to run tcpdump
Reply With Quote
  #3   (View Single Post)  
Old 2nd June 2010
xiphias xiphias is offline
Port Guard
 
Join Date: May 2008
Posts: 31
Default

I had been using /usr/bin/newaliases, so I checked mailer.conf to ensure it was pointing at the right version. I also ran /usr/local/bin/newaliases directly just to be absolutely sure, but it doesn't make a difference.

postmap uses the db file (even though you specify the plain text file) for lookups, so the db file is (read: should be) correct as postmap is returning the alias correctly.
Reply With Quote
  #4   (View Single Post)  
Old 2nd June 2010
J65nko J65nko is offline
Administrator
 
Join Date: May 2008
Location: Budel - the Netherlands
Posts: 4,125
Default

Last December I assisted somebody with setting up Mailman+Postfix. There were some confusing issues with aliases too, because /etc/mail also has an aliases file.

If you are really desperate you could add your root alias to the /etc/mail/aliases file and run newaliases on it.

When you alias the root account to a local user account on the postfix box itself, does the alias work then?
__________________
You don't need to be a genius to debug a pf.conf firewall ruleset, you just need the guts to run tcpdump
Reply With Quote
  #5   (View Single Post)  
Old 5th June 2010
polera's Avatar
polera polera is offline
New User
 
Join Date: Dec 2009
Posts: 2
Default

You should be able to verify your alias_maps setting with:

Code:
# postconf alias_maps
That will return something along the lines of

Code:
# alias_maps = hash:/etc/aliases
Make sure that's the file that your aliases are configured in. Then run:

Code:
# newaliases
          # postfix reload
That should do it for you.

If the above doesn't work, you might try aliasing root to a local user:
Code:
root:  philip
Works for me on FreeBSD 8.0-RELEASE
Reply With Quote
  #6   (View Single Post)  
Old 5th June 2010
xiphias xiphias is offline
Port Guard
 
Join Date: May 2008
Posts: 31
Default

/etc/mail/aliases is a symlink to /etc/aliases on my machine.

Code:
coppermine $ postconf alias_maps
alias_maps = hash:/etc/aliases
coppermine $ ls -l /etc/aliases*
-rw-r--r--  1 root  wheel   1656 Jun  1 20:48 /etc/aliases
-rw-r--r--  1 root  wheel  16384 Jun  5 17:01 /etc/aliases.db
coppermine $ ls -l /etc/mail/aliases*
lrwxr-xr-x  1 root  wheel  12 Jun  1 19:29 /etc/mail/aliases -> /etc/aliases
lrwxr-xr-x  1 root  wheel  15 Jun  1 19:28 /etc/mail/aliases.db -> /etc/aliases.db
I tried aliasing root to a local user and it still tries to relay it out to root@coppermine.abcdef.co.uk, so it would seem it doesn't realise that it's the destination for it's hostname. I will leave it a few days, then rewrite the config from scratch, see if I manage any better.

By the way, I'm using FreeBSD 7.1 RELEASE p11 i386, I also have a postfix configured in a similar way on a Debian desktop and that works fine.
Reply With Quote
Reply

Thread Tools
Display Modes

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 On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Postfix and Dovecot SMTP auth configuration hints J65nko OpenBSD Packages and Ports 0 5th February 2010 02:53 AM
PF Configuration for newbie slakic OpenBSD Security 1 20th August 2009 02:35 PM
k3b, configuration. maxrussell FreeBSD Ports and Packages 4 3rd March 2009 04:23 AM
Postfix error on 7.1 windependence FreeBSD Ports and Packages 3 2nd February 2009 10:42 AM
Working Configuration for Openbsd 4.0 - Postfix - SASL - TLS roundkat Guides 0 4th May 2008 05:38 PM


All times are GMT. The time now is 08:48 AM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Content copyright © 2007-2010, the authors
Daemon image copyright ©1988, Marshall Kirk McKusick