Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I'm trying to configure my postfix so all mail that goes through that has tld dev would be redirected to a root user, here is my config files:

[alexus@wcmisdlin02 postfix]$ tail -1 main.cf 
transport_maps = hash:/etc/postfix/transport
[alexus@wcmisdlin02 postfix]$ tail -1 transport
.dev    :redirect root
[alexus@wcmisdlin02 postfix]$ 

or if you want to see the whole thing

[alexus@wcmisdlin02 postfix]$ postconf -n
alias_database = hash:/etc/aliases
alias_maps = hash:/etc/aliases
command_directory = /usr/sbin
config_directory = /etc/postfix
daemon_directory = /usr/libexec/postfix
data_directory = /var/lib/postfix
debug_peer_level = 2
html_directory = no
inet_interfaces = localhost
inet_protocols = all
mail_owner = postfix
mailq_path = /usr/bin/mailq.postfix
manpage_directory = /usr/share/man
mydestination = $myhostname, localhost.$mydomain, localhost
newaliases_path = /usr/bin/newaliases.postfix
queue_directory = /var/spool/postfix
readme_directory = /usr/share/doc/postfix-2.6.6/README_FILES
relayhost = uftwfmail
sample_directory = /usr/share/doc/postfix-2.6.6/samples
sendmail_path = /usr/sbin/sendmail.postfix
setgid_group = postdrop
transport_maps = hash:/etc/postfix/transport
unknown_local_recipient_reject_code = 550
[alexus@wcmisdlin02 postfix]$ grep -v ^# transport
.dev    :redirect root
[alexus@wcmisdlin02 postfix]$ sudo postmap transport && service postfix reload
[alexus@wcmisdlin02 postfix]$ 

here is tail -f maillog

May 19 17:01:21 wcmisdlin02 postfix/pickup[461]: 53C54201CDA: uid=0 from=<root>
May 19 17:01:21 wcmisdlin02 postfix/cleanup[513]: 53C54201CDA: message-id=<20110519210121.53C54201CDA@wcmisdlin02.uftmasterad.org>
May 19 17:01:21 wcmisdlin02 postfix/qmgr[462]: 53C54201CDA: from=<root@wcmisdlin02.uftmasterad.org>, size=442, nrcpt=1 (queue active)
May 19 17:01:21 wcmisdlin02 postfix/smtp[732]: fatal: valid hostname or network address required in server description: redirect root
May 19 17:01:22 wcmisdlin02 postfix/qmgr[462]: warning: private/smtp socket: malformed response
May 19 17:01:22 wcmisdlin02 postfix/qmgr[462]: warning: transport smtp failure -- see a previous warning/fatal/panic logfile record for the problem description
May 19 17:01:22 wcmisdlin02 postfix/master[1832]: warning: process /usr/libexec/postfix/smtp pid 732 exit status 1
May 19 17:01:22 wcmisdlin02 postfix/master[1832]: warning: /usr/libexec/postfix/smtp: bad command startup -- throttling
May 19 17:01:22 wcmisdlin02 postfix/error[598]: 53C54201CDA: to=<test@test.dev>, relay=none, delay=1.1, delays=0.07/1/0/0.03, dsn=4.3.0, status=deferred (unknown mail transport error)

i've tried with FQDN in my transport

[root@wcmisdlin02 postfix]# tail -1 transport
.dev    :redirect alexus@wcmisdlin02.uftmasterad.org
[root@wcmisdlin02 postfix]# 

here is tail -f /var/log/maillog

May 19 17:08:54 wcmisdlin02 postfix/pickup[1139]: 88565201D3B: uid=0 from=<root>
May 19 17:08:54 wcmisdlin02 postfix/cleanup[1162]: 88565201D3B: message-id=<20110519210854.88565201D3B@wcmisdlin02.uftmasterad.org>
May 19 17:08:54 wcmisdlin02 postfix/qmgr[1140]: 88565201D3B: from=<root@wcmisdlin02.uftmasterad.org>, size=442, nrcpt=1 (queue active)
May 19 17:08:54 wcmisdlin02 postfix/smtp[1218]: fatal: valid hostname or network address required in server description: redirect alexus@wcmisdlin02.uftmasterad.org
May 19 17:08:55 wcmisdlin02 postfix/qmgr[1140]: warning: private/smtp socket: malformed response
May 19 17:08:55 wcmisdlin02 postfix/qmgr[1140]: warning: transport smtp failure -- see a previous warning/fatal/panic logfile record for the problem description
May 19 17:08:55 wcmisdlin02 postfix/master[1832]: warning: process /usr/libexec/postfix/smtp pid 1218 exit status 1
May 19 17:08:55 wcmisdlin02 postfix/master[1832]: warning: /usr/libexec/postfix/smtp: bad command startup -- throttling
May 19 17:08:55 wcmisdlin02 postfix/error[1143]: 88565201D3B: to=<test@test.dev>, relay=none, delay=1.1, delays=0.11/1/0/0.02, dsn=4.3.0, status=deferred (unknown mail transport error)
share|improve this question
add comment

3 Answers 3

up vote 1 down vote accepted

Your /etc/postfix/transport is invalid. According to http://www.postfix.org/transport.5.html it should contain something like

.dev   local:

then all mails to *.dev will go to the account specified by the local part in front of the @. With only the transport_maps it is not possible to also redirect local parts to local aliases.

share|improve this answer
    
for whatever reason all the sudden, postfix stop making local deliveries, even though nothing was changed. I still have transport_maps = hash:/etc/postfix/transport in my main.cf and * local:alexus in transport and I get status=bounced (unknown user: "alexus ") in my maillog –  alexus May 24 '11 at 17:40
    
The file should contain exactly what I wrote (no alexus added!). If you want a catch-all way to get all mails to a local user named alexus, then you have to add luser_relay=alexus to main.cf –  mailq Jun 9 '11 at 11:18
add comment

Transports is used to tell postfix how to send the message to the next hop, not for rewriting. What you want is address rewriting or perhaps an alias. http://www.postfix.org/ADDRESS_REWRITING_README.html is a good starting place. Depending on your setup you may be able to use the generic map, also detailed at the above link.

Transport maps are used for example when overruling MX records or routing domain to a different server, not when you want one address to be changed to another.

share|improve this answer
add comment

You could try to setup .dev domain as postfix Mail forwarding domain using virtual delivery mechanism, but I'm not sure how it will work with fake TLD.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.