View Full Version : Postfix not honoring email aliases for local delivery
rneilson
9th March 2007, 19:40
I have a hosting server, configured as per the Perfect Setup (Opensuse 10), with ISPConfig installed. Everything seems to be working - uptime has been over a month, now, with the only problems I've had so far being domain registration hiccups which have nothing to do with my server.
However, one of my customers is testing a web order form, and I've run into a problem: while emails incoming from outside servers work fine, local deliveries don't seem to be using email aliases properly.
Eg.
Username: example.admin
Primary email: example.admin@example.com
Alias: info@example.com
If I send an email to info@example.com from outside, it works without a problem. If I send it from an another domain also hosted on the site, admin@example2.com, it bounces back with the following error:
This is the Postfix program at host main.example.com. I'm sorry to have to inform you that your message could not be delivered to one or more recipients. It's attached below. For further assistance, please send mail to <postmaster> If you do so, please include this problem report. You can delete your own text from the attached returned message. The Postfix program <info@example.com>: unknown user: "info"
I checked all the threads on Postfix problems I could, and the following have already been ruled out:
- The server's FQDN is main.example.com
- The $myhostname parameter in main.cf is main.example.com
- main.example.com is not used as a virtual domain for any email or web services. www.example.com and example.com are, however.
- All DNS entries are correct. Again, outside email works fine with the alias rewriting.
- alias_maps = hash:/etc/aliases
- virtual_maps = hash:/etc/postfix/virtusertable
- mydestination = /etc/postfix/local-host-names
- example.admin@example.com and info@example.com are both present in /etc/postfix/virtusertable and point to example.admin
- example.com is listed in /etc/postfix/local-host-names
Any help would be greatly appreciated!
falko
10th March 2007, 12:59
What's in your mail log when this happens?
rneilson
10th March 2007, 16:37
Here's /var/log/mail (snippet):
Mar 10 09:28:11 main imapd: Connection, ip=[::ffff:127.0.0.1]
Mar 10 09:28:11 main imapd: LOGIN, user=admin, ip=[::ffff:127.0.0.1], protocol=IMAP
Mar 10 09:28:11 main postfix/sendmail[27970]: warning: inet_protocols: IPv6 support is disabled: Address family not supported by protocol
Mar 10 09:28:11 main postfix/sendmail[27970]: warning: inet_protocols: configuring for IPv4 support only
Mar 10 14:28:11 main postfix/postdrop[27974]: warning: inet_protocols: IPv6 support is disabled: Address family not supported by protocol
Mar 10 14:28:11 main postfix/postdrop[27974]: warning: inet_protocols: configuring for IPv4 support only
Mar 10 09:28:11 main postfix/cleanup[27978]: warning: inet_protocols: IPv6 support is disabled: Address family not supported by protocol
Mar 10 09:28:11 main postfix/cleanup[27978]: warning: inet_protocols: configuring for IPv4 support only
Mar 10 09:28:11 main postfix/pickup[27598]: 6E8BF251B1B: uid=30 from=<admin@example.com>
Mar 10 09:28:11 main imapd: LOGOUT, user=admin, ip=[::ffff:127.0.0.1], headers=0, body=0, rcvd=2332, sent=648, time=0
Mar 10 09:28:11 main postfix/trivial-rewrite[27982]: warning: inet_protocols: IPv6 support is disabled: Address family not supported by protocol
Mar 10 09:28:11 main postfix/trivial-rewrite[27982]: warning: inet_protocols: configuring for IPv4 support only
Mar 10 09:28:11 main postfix/cleanup[27978]: 6E8BF251B1B: message-id=<75c55d0680c4aa677d46294bc448fc5c@localhost>
Mar 10 09:28:11 main postfix/qmgr[14599]: 6E8BF251B1B: from=<admin@example.com>, size=2424, nrcpt=1 (queue active)
Mar 10 09:28:11 main postfix/local[27986]: warning: inet_protocols: IPv6 support is disabled: Address family not supported by protocol
Mar 10 09:28:11 main postfix/local[27986]: warning: inet_protocols: configuring for IPv4 support only
Mar 10 09:28:11 main postfix/bounce[27990]: warning: inet_protocols: IPv6 support is disabled: Address family not supported by protocol
Mar 10 09:28:11 main postfix/bounce[27990]: warning: inet_protocols: configuring for IPv4 support only
Mar 10 09:28:11 main imapd: Connection, ip=[::ffff:127.0.0.1]
Mar 10 09:28:11 main postfix/local[27986]: 6E8BF251B1B: to=<test@example.com>, relay=local, delay=0.43, delays=0.26/0.03/0/0.14, dsn=5.1.1, status=bounced (unknown user: "test")
Mar 10 09:28:11 main postfix/cleanup[27978]: BF3D7251B1C: message-id=<20070310142811.BF3D7251B1C@main.example.com>
Mar 10 09:28:11 main postfix/bounce[28000]: warning: inet_protocols: IPv6 support is disabled: Address family not supported by protocol
Mar 10 09:28:11 main postfix/bounce[28000]: warning: inet_protocols: configuring for IPv4 support only
Mar 10 09:28:11 main postfix/qmgr[14599]: BF3D7251B1C: from=<>, size=4302, nrcpt=1 (queue active)
Mar 10 09:28:11 main postfix/bounce[27990]: 6E8BF251B1B: sender non-delivery notification: BF3D7251B1C
Mar 10 09:28:11 main postfix/qmgr[14599]: 6E8BF251B1B: removed
Mar 10 09:28:11 main imapd: LOGIN, user=admin, ip=[::ffff:127.0.0.1], protocol=IMAP
Mar 10 09:28:11 main postfix/local[27986]: BF3D7251B1C: to=<admin@example.com>, relay=local, delay=0.18, delays=0.09/0/0/0.09, dsn=2.0.0, status=sent (delivered to maildir)
Mar 10 09:28:11 main postfix/qmgr[14599]: BF3D7251B1C: removed
test@example.com is an alias I've set up for admin@example.com.
Thanks
falko
11th March 2007, 20:23
What's in /etc/postfix/main.cf (please strip out the comments), /etc/postfix/virtusertable, and /etc/postfix/local-host-names?
rneilson
12th March 2007, 05:04
/etc/postfix/main.cf
queue_directory = /var/spool/postfix
command_directory = /usr/sbin
daemon_directory = /usr/lib/postfix
mail_owner = postfix
myhostname = main.markanthonymedia.com
myorigin = $mydomain
unknown_local_recipient_reject_code = 550
debugger_command =
PATH=/bin:/usr/bin:/usr/local/bin:/usr/X11R6/bin
xxgdb $daemon_directory/$process_name $process_id & sleep 5
sendmail_path = /usr/sbin/sendmail
newaliases_path = /usr/bin/newaliases
mailq_path = /usr/bin/mailq
setgid_group = maildrop
html_directory = /usr/share/doc/packages/postfix/html
manpage_directory = /usr/share/man
sample_directory = /usr/share/doc/packages/postfix/samples
readme_directory = /usr/share/doc/packages/postfix/README_FILES
inet_protocols = all
biff = no
mail_spool_directory = /var/mail
canonical_maps = hash:/etc/postfix/canonical
relocated_maps = hash:/etc/postfix/relocated
transport_maps = hash:/etc/postfix/transport
sender_canonical_maps = hash:/etc/postfix/sender_canonical
masquerade_exceptions = root
masquerade_classes = envelope_sender, header_sender, header_recipient
program_directory = /usr/lib/postfix
inet_interfaces = all
masquerade_domains =
defer_transports =
mynetworks_style = subnet
disable_dns_lookups = no
relayhost =
mailbox_command =
mailbox_transport =
strict_8bitmime = no
disable_mime_output_conversion = no
smtpd_sender_restrictions = hash:/etc/postfix/access
smtpd_client_restrictions =
smtpd_helo_required = no
smtpd_helo_restrictions =
strict_rfc821_envelopes = no
smtpd_recipient_restrictions = permit_sasl_authenticated,permit_mynetworks,check_ relay_domains
smtp_sasl_auth_enable = no
smtpd_sasl_auth_enable = yes
smtpd_use_tls = yes
smtp_use_tls = yes
alias_maps = hash:/etc/aliases
mailbox_size_limit = 0
message_size_limit = 10240000
receive_override_options = no_address_mappings
smtpd_sasl_local_domain =
smtpd_sasl_security_options = noanonymous
broken_sasl_auth_clients = yes
smtpd_tls_auth_only = no
smtp_tls_note_starttls_offer = yes
smtpd_tls_key_file = /etc/postfix/ssl/smtpd.key
smtpd_tls_cert_file = /etc/postfix/ssl/smtpd.crt
smtpd_tls_CAfile = /etc/postfix/ssl/cacert.pem
smtpd_tls_loglevel = 1
smtpd_tls_received_header = yes
smtpd_tls_session_cache_timeout = 3600s
tls_random_source = dev:/dev/urandom
virtual_maps = hash:/etc/postfix/virtusertable
mydestination = /etc/postfix/local-host-names
mynetworks = 127.0.0.0/8
home_mailbox = Maildir/
/etc/postfix/local-host-names
localhost
main.markanthonymedia.com
localhost.main.markanthonymedia.com
localhost.markanthonymedia.com
localhost.localdomain
www.markanthonymedia.com
www.stylistschoice.ca
www.barberschoice.ca
www.clarissa-santiago.net
mail.markanthonymedia.com
www.phyne.ca
www.artefis.com
www.recaredy.com
www.estheticschoice.ca
www.alleynohhh.com
www.pulpmag.net
www.phynemodelagency.com
www.esb.ca
www.digitalmindmedia.ca
markanthonymedia.com
mail.clarissa-santiago.net
webmail.markanthonymedia.com
clarissa-santiago.net
phyne.ca
mail.phyne.ca
barberschoice.ca
stylistchoice.ca
artefis.com
mail.artefis.com
recaredy.com
estheticschoice.ca
mail.recaredy.com
alleynohhh.com
pulpmag.net
phynemodelagency.com
esb.ca
digitalmindmedia.ca
#### MAKE MANUAL ENTRIES BELOW THIS LINE! ####
/etc/postfix/virtusertable (snippet only - I don't want the users of twenty sites plastered all over the forums)
sales@www.markanthonymedia.com markanthony
info@www.markanthonymedia.com markanthony
ma@www.markanthonymedia.com markanthony
markanthony@www.markanthonymedia.com markanthony
sales@markanthonymedia.com markanthony
info@markanthonymedia.com markanthony
ma@markanthonymedia.com markanthony
markanthony@markanthonymedia.com markanthony
administrator@www.markanthonymedia.com administrator
administrator@markanthonymedia.com administrator
test@www.markanthonymedia.com testing
testing@www.markanthonymedia.com testing
test@markanthonymedia.com testing
testing@markanthonymedia.com testing
#### MAKE MANUAL ENTRIES BELOW THIS LINE! ####
falko
12th March 2007, 15:11
Ok, and now I need to know the real email addresses instead of test@example.com and admin@example.com.
rneilson
12th March 2007, 16:55
In this case, so I wasn't cluttering anyone else's mailbox, I set up the username testing, which has test@markanthonymedia.com as an alias, just so I could confirm the behaviour with a fresh email. (The original user who noticed the problem is on another site I host.) The user testing then forwards to administrator@markanthonymedia.com.
The original notice was when a PHP script mailed to an alias - I got the undeliverable message error, since wwwrun's email forwards to me. I also tried sending to info@markanthonymedia.com, with the same result (info is an alias for markanthony).
falko
13th March 2007, 20:00
What's in test@markanthonymedia.com .procmailrc file (in his homedir)?
Please run
postconf -e 'inet_protocols = ipv4'
/etc/init.d/postfix restart
to get rid of the inet_protocols warning in your mail log.
rneilson
14th March 2007, 06:30
Thanks, I was wondering how to get that error out.
The user is testing, not test - perhaps I should've made it testuser or something. The email test@markanthonymedia.com is just an alias of testing@markanthonymedia.com.
The .procmailrc for testing, however, is as follows:
MAILDIR=$HOME/Maildir/
DEFAULT=$MAILDIR
ORGMAIL=$MAILDIR
INCLUDERC=/srv/www/web1/user/testing/.mailsize.rc
## INCLUDERC=/srv/www/web1/user/testing/.quota.rc
## INCLUDERC=/srv/www/web1/user/testing/.antivirus.rc
## INCLUDERC=/srv/www/web1/user/testing/.local-rules.rc
## INCLUDERC=/srv/www/web1/user/testing/.html-trap.rc
## INCLUDERC=/srv/www/web1/user/testing/.spamassassin.rc
## INCLUDERC=/srv/www/web1/user/testing/.autoresponder.rc
falko
14th March 2007, 23:26
And what's in the .forward file (in the same directory)?
rneilson
15th March 2007, 19:58
.forward is this:
administrator@markanthonymedia.com
falko
16th March 2007, 19:28
Looks ok.
What's the output of grep testing /etc/passwd?
rneilson
17th March 2007, 01:19
grep testing /etc/passwd :
testing:x:10058:10001:Testing:/srv/www/web1/user/testing:/bin/false
falko
17th March 2007, 23:17
Looks ok. And what's the output of
grep 10058 /etc/passwd?
rneilson
18th March 2007, 05:47
testing:x:10058:10001:Testing:/srv/www/web1/user/testing:/bin/false
falko
19th March 2007, 14:22
I was thinking that maybe there are two or more users with the same user id in /etc/passwd, but this isn't the case. To be honest, I have no idea what's wrong with your system...
rneilson
20th March 2007, 03:36
Beats me, too. The best I can figure out is that for local deliveries, ie between two email addresses on the same system, postfix isn't consulting the virtusertable at all, but just /etc/aliases, which of course doesn't include any of the aliases specified by ISPConfig. And I can't figure out a way to force it.
Any hints on configuring the fallback_transport option in postfix?
rneilson
20th March 2007, 03:39
Sorry, I should also note that this is a big problem for me. I've got several sites with an info@blah.com address, which is used by online ordering forms for the site in question. I can get the sites to change that, and create blah.info@blah.com addresses (which won't collide in local delivery) and get the PHP programmers to use that, but it seems clumsy and hackish, and means one more thing to spell out for programmers doing work for any of my sites.
till
20th March 2007, 09:53
The best I can figure out is that for local deliveries, ie between two email addresses on the same system, postfix isn't consulting the virtusertable at all,
I dont think that. Local delivery works perfectly on all my servers. ISPConfig uses a standard setup with system users that is used on many bon ISPConfig servewrs as well for years.
rneilson
20th March 2007, 22:41
My problem seems to be similar to the one in this thread (http://www.howtoforge.com/forums/showthread.php?t=11498). He's using opensuse 10.2, the same as me. And I've confirmed this behaviour with multiple accounts. If there is an entry in /etc/aliases for the username portion of the email address (i.e. a system username, not an alias set up in ISPConfig), then the mail is delivered. If the recipient is only in virtusertable, then email originating on another server is processed fine, but if the origin and destination are both hosted on my server, it will fail.
Maybe there's something missing from the default configuration of opensuse 10.2's postfix package? Do your servers have an entry for fallback_transport (or something related) in /etc/postfix/main.cf?
falko
21st March 2007, 15:36
Maybe there's something missing from the default configuration of opensuse 10.2's postfix package? Do your servers have an entry for fallback_transport (or something related) in /etc/postfix/main.cf?
Not in my main.cf, but in postconf -d (shows the default values that are used unless they are overriden by main.cf):
fallback_relay =
fallback_transport =
rneilson
21st March 2007, 16:32
How about anything related to local_recipient_maps?
falko
21st March 2007, 16:53
I have local_recipient_maps = in the output of postconf -d, but not in main.cf.
rneilson
22nd March 2007, 06:37
Interesting. Mine is:
local_recipient_maps = proxy:unix:passwd.byname $alias_maps
Think I should try setting it to blank?
till
22nd March 2007, 12:12
Think I should try setting it to blank?
yes, please try that and restart postfix.
vBulletin® v3.8.4, Copyright ©2000-2010, Jelsoft Enterprises Ltd.