Go Back   HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials > Linux Forums > Server Operation

Do you like HowtoForge? Please consider supporting us by becoming a subscriber.
Reply
 
Thread Tools Display Modes
  #1  
Old 25th January 2008, 03:34
rusty rusty is offline
Member
 
Join Date: Dec 2007
Posts: 45
Thanks: 5
Thanked 0 Times in 0 Posts
Default Alias mappings

Hi.

My virtual users are working fine. mail goes to the right mailbox. However, mail that needs to be forwarded to another user on the same domain, instead goes in that user's mailbox. (ie. joe@example.com goto mike@example.com lands in Joe's mailbox.) Postfix is referring to the correct db table (if I alter the name in mysql, the mail bounces). Somehow, postfix ignores the destination address in the goto field.

I'm using postfix, dovecot, postfixadmin, amavis

Any help would be greatly appreciated.

Thanks,

Eric
Reply With Quote
Sponsored Links
  #2  
Old 25th January 2008, 18:22
falko falko is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 41,701
Thanks: 1,900
Thanked 2,745 Times in 2,578 Posts
Default

Any errors in your mail log? What's in your main.cf?
__________________
Falko
--
Download the ISPConfig 3 Manual! | Check out the ISPConfig 3 Billing Module!

FB: http://www.facebook.com/howtoforge

nginx-Webhosting: Timme Hosting | Follow me on:
Reply With Quote
  #3  
Old 27th January 2008, 00:56
rusty rusty is offline
Member
 
Join Date: Dec 2007
Posts: 45
Thanks: 5
Thanked 0 Times in 0 Posts
Default

Falko,

You're the best! Thanks for replying. First, I pasted contents of the log file. I don't see any errors. Two emails were sent at the same time, one to a virtual mailbox, and another to an alias that forwards to a virutal mailbox of another user. I can't see any difference. For the alias email, the message ends up in the recipient's mailbox instead of forwarding to another user's mailbox. Do I need to delete the recipient's mailbox now that I want it to forward to another user. To help make it clear, one employee quit, so their mail needs to forward to another employee's mailbox.

After the maillog entries, I pasted the contents of main.cf.

MAILLOG:
Jan 25 21:41:56 mail postfix/smtpd[7764]: connect from mailhost.sendersmtp.com[71.14.6.9]
Jan 25 21:41:56 mail postfix/smtpd[7766]: connect from mailhost.sendersmtp.com[71.14.6.9]
Jan 25 21:41:56 mail sqlgrey: grey: from awl match: updating 71.14.6(71.14.6.9), ric@sender.com(ric@sender.com)
Jan 25 21:41:56 mail sqlgrey: grey: from awl match: updating 71.14.6(71.14.6.9), ric@sender.com(ric@sender.com)
Jan 25 21:41:56 mail postfix/smtpd[7764]: 27E88578048: client=mailhost.sendersmtp.com[71.14.6.9]
Jan 25 21:41:56 mail postfix/cleanup[7771]: 27E88578048: message-id=<000001c85fc5$000bf9c0$06aba8c0@laptop>
Jan 25 21:41:56 mail postfix/smtpd[7766]: 2907657804D: client=mailhost.sendersmtp.com[71.14.6.9]
Jan 25 21:41:56 mail postfix/cleanup[7773]: 2907657804D: message-id=<000501c85fc5$0033a600$06aba8c0@laptop>
Jan 25 21:41:56 mail postfix/qmgr[31548]: 27E88578048: from=<ric@sender.com>, size=2962, nrcpt=1 (queue active)
Jan 25 21:41:56 mail postfix/smtpd[7764]: disconnect from mailhost.sendersmtp.com[71.14.6.9]
Jan 25 21:41:56 mail postfix/smtpd[7766]: disconnect from mailhost.sendersmtp.com[71.14.6.9]
Jan 25 21:41:56 mail postfix/qmgr[31548]: 2907657804D: from=<ric@sender.com>, size=2943, nrcpt=1 (queue active)
Jan 25 21:41:57 mail postfix/smtpd[7783]: connect from unknown[127.0.0.1]
Jan 26 02:41:57 mail postfix/smtpd[7783]: C6CE857804E: client=unknown[127.0.0.1]
Jan 25 21:41:57 mail postfix/cleanup[7771]: C6CE857804E: message-id=<000001c85fc5$000bf9c0$06aba8c0@laptop>
Jan 25 21:41:57 mail postfix/qmgr[31548]: C6CE857804E: from=<ric@sender.com>, size=3360, nrcpt=1 (queue active)
Jan 25 21:41:57 mail amavis[2783]: (02783-16) Passed CLEAN, [71.14.6.9] [71.14.6.9] <ric@sender.com> -> <mtg@nonalias.net>, Message-ID: <000001c85fc5$000bf9c0$06aba8c0@laptop>, mail_id: FGdRVLxZpJBi, Hits: 2.32, size: 2962, queued_as: C6CE857804E, 1653 ms
Jan 25 21:41:57 mail postfix/smtp[7774]: 27E88578048: to=<mtg@nonalias.net>, relay=127.0.0.1[127.0.0.1]:10024, delay=1.7, delays=0.02/0.01/0.01/1.7, dsn=2.0.0, status=sent (250 2.0.0 Ok: queued as C6CE857804E)
Jan 25 21:41:57 mail postfix/qmgr[31548]: 27E88578048: removed
Jan 26 02:41:57 mail postfix/smtpd[7783]: disconnect from unknown[127.0.0.1]
Jan 25 21:41:57 mail postfix/pipe[7785]: C6CE857804E: to=<mtg@nonalias.net>, relay=dovecot, delay=0.03, delays=0.01/0.01/0/0.01, dsn=2.0.0, status=sent (delivered via dovecot service)
Jan 25 21:41:57 mail postfix/qmgr[31548]: C6CE857804E: removed
Jan 26 02:41:57 mail postfix/smtpd[7783]: connect from unknown[127.0.0.1]
Jan 26 02:41:57 mail postfix/smtpd[7783]: F3DC4578048: client=unknown[127.0.0.1]
Jan 25 21:41:58 mail postfix/cleanup[7773]: F3DC4578048: message-id=<000501c85fc5$0033a600$06aba8c0@laptop>
Jan 25 21:41:58 mail postfix/qmgr[31548]: F3DC4578048: from=<ric@sender.com>, size=3199, nrcpt=1 (queue active)
Jan 26 02:41:58 mail postfix/smtpd[7783]: disconnect from unknown[127.0.0.1]
Jan 25 21:41:58 mail amavis[2784]: (02784-16) Passed CLEAN, [71.14.6.9] [71.14.6.9] <ric@sender.com> -> <mtb@alias.net>, Message-ID: <000501c85fc5$0033a600$06aba8c0@laptop>, mail_id: dkN9GpJf915h, Hits: 0.001, size: 2943, queued_as: F3DC4578048, 1828 ms
Jan 25 21:41:58 mail postfix/smtp[7775]: 2907657804D: to=<mtb@alias.net>, relay=127.0.0.1[127.0.0.1]:10024, delay=1.9, delays=0.02/0.01/0/1.8, dsn=2.0.0, status=sent (250 2.0.0 Ok: queued as F3DC4578048)
Jan 25 21:41:58 mail postfix/qmgr[31548]: 2907657804D: removed
Jan 25 21:41:58 mail postfix/pipe[7785]: F3DC4578048: to=<mtb@alias.net>, relay=dovecot, delay=0.05, delays=0.01/0/0/0.04, dsn=2.0.0, status=sent (delivered via dovecot service)
Jan 25 21:41:58 mail postfix/qmgr[31548]: F3DC4578048: removed

MAIN.CF
alias_database = hash:/etc/aliases
alias_maps = hash:/etc/aliases
broken_sasl_auth_clients = yes
command_directory = /usr/sbin
config_directory = /etc/postfix
content_filter = smtp-amavis:[127.0.0.1]:10024
daemon_directory = /usr/libexec/postfix
debug_peer_level = 2
html_directory = no
inet_interfaces = all
mail_owner = postfix
mailq_path = /usr/bin/mailq.postfix
manpage_directory = /usr/share/man
mydestination = $myhostname, localhost.$mydomain, localhost, mail.$mydomain
mydomain = myserver.com
myhostname = mail.myserver.com
mynetworks = 127.0.0.0/8
myorigin = $myhostname
newaliases_path = /usr/bin/newaliases.postfix
queue_directory = /var/spool/postfix
readme_directory = /usr/share/doc/postfix-2.3.3/README_FILES
receive_override_options = no_address_mappings
recipient_delimiter = +
relayhost =
sample_directory = /usr/share/doc/postfix-2.3.3/samples
sendmail_path = /usr/sbin/sendmail.postfix
setgid_group = postdrop
smtpd_banner = $myhostname ESMTP $mail_name ($mail_version)
smtpd_recipient_restrictions = permit_mynetworks,permit_sasl_authenticated,reject _unauth_destination, check_policy_service inet:127.0.0.1:2501
smtpd_sasl_auth_enable = yes
smtpd_sasl_path = private/auth
smtpd_sasl_security_options = noanonymous
smtpd_sasl_type = dovecot
smtpd_tls_auth_only = yes
smtpd_tls_cert_file = /etc/pki/tls/certs/mail.myserver.com.crt
smtpd_tls_key_file = /etc/pki/tls/private/mail.myserver.com.pem
smtpd_tls_loglevel = 1
smtpd_tls_received_header = yes
smtpd_tls_security_level = may
smtpd_tls_session_cache_database = btree:/var/spool/postfix/mtpd_tls_session_cache
tls_random_source = dev:/dev/urandom
unknown_local_recipient_reject_code = 550
virtual_alias_maps = mysql:/etc/postfix/mysql_virtual_alias_maps.cf
virtual_gid_maps = static:5000
virtual_mailbox_base = /home/vmail
virtual_mailbox_domains = mysql:/etc/postfix/mysql_virtual_domains_maps.cf
virtual_mailbox_maps = mysql:/etc/postfix/mysql_virtual_mailbox_maps.cf
virtual_transport = dovecot
virtual_uid_maps = static:5000
Reply With Quote
  #4  
Old 27th January 2008, 15:52
falko falko is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 41,701
Thanks: 1,900
Thanked 2,745 Times in 2,578 Posts
Default

What's in /etc/postfix/mysql_virtual_alias_maps.cf?
__________________
Falko
--
Download the ISPConfig 3 Manual! | Check out the ISPConfig 3 Billing Module!

FB: http://www.facebook.com/howtoforge

nginx-Webhosting: Timme Hosting | Follow me on:
Reply With Quote
  #5  
Old 27th January 2008, 20:18
rusty rusty is offline
Member
 
Join Date: Dec 2007
Posts: 45
Thanks: 5
Thanked 0 Times in 0 Posts
Default

See below for the file requested.

My mysql database was setup by the script that comes with postfixadmin.

As mentioned in my initial post, if I alter the address field in the alias table, delivery fails completely (so it is sucessfully accessing the mysql db).

I have also used this file with the last line commented and all the others uncommented:
mysql_virtual_alias_maps.cf
*********
user = myuser
password = mypassword
hosts = 127.0.0.1
dbname = mail
#table = alias
#select_field = goto
#where_field = address
#additional_conditions = and active = '1'
query = SELECT goto FROM alias WHERE address='%s' AND active = '1'
Reply With Quote
  #6  
Old 28th January 2008, 18:00
falko falko is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 41,701
Thanks: 1,900
Thanked 2,745 Times in 2,578 Posts
Default

Looks good.
What's in your alias table?
Code:
SELECT * FROM alias;
__________________
Falko
--
Download the ISPConfig 3 Manual! | Check out the ISPConfig 3 Billing Module!

FB: http://www.facebook.com/howtoforge

nginx-Webhosting: Timme Hosting | Follow me on:
Reply With Quote
  #7  
Old 28th January 2008, 20:07
rusty rusty is offline
Member
 
Join Date: Dec 2007
Posts: 45
Thanks: 5
Thanked 0 Times in 0 Posts
Default

mysql> SELECT * FROM alias;
+-------------------------------+-------------------------------+--------------------+---------------------+---------------------+--------+
| address | goto | domain | created | modified | active |
+-------------------------------+-------------------------------+--------------------+---------------------+---------------------+--------+

Does this answer your question, or do you need to see the actual data?
Reply With Quote
  #8  
Old 29th January 2008, 21:21
falko falko is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 41,701
Thanks: 1,900
Thanked 2,745 Times in 2,578 Posts
Default

If the table is empty, then it's clear why it's not working, but if the forward is in there, then I don't know what's wrong...
__________________
Falko
--
Download the ISPConfig 3 Manual! | Check out the ISPConfig 3 Billing Module!

FB: http://www.facebook.com/howtoforge

nginx-Webhosting: Timme Hosting | Follow me on:
Reply With Quote
  #9  
Old 29th January 2008, 23:01
rusty rusty is offline
Member
 
Join Date: Dec 2007
Posts: 45
Thanks: 5
Thanked 0 Times in 0 Posts
Default

Yes, the table has data in it. I have examined it and it looks correct. Thanks for trying.

Could you answer one question? Does it look like the Dovecot service is involved in delivery to the mailbox? Here is an entry in the log:

Jan 29 15:56:06 mail postfix/pipe[28583]: 4AD4C57805F: to=<mtb@domain.net>, relay=dovecot, delay=0.03, delays=0.01/0.01/0/0.02, dsn=2.0.0, status=sent (delivered via dovecot service)

Should I look there for the problem? I've been assuming Postfix is controlling 100% of the delivery.
Reply With Quote
  #10  
Old 30th January 2008, 16:38
falko falko is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 41,701
Thanks: 1,900
Thanked 2,745 Times in 2,578 Posts
 
Default

Quote:
Originally Posted by rusty
Jan 29 15:56:06 mail postfix/pipe[28583]: 4AD4C57805F: to=<mtb@domain.net>, relay=dovecot, delay=0.03, delays=0.01/0.01/0/0.02, dsn=2.0.0, status=sent (delivered via dovecot service)

Should I look there for the problem? I've been assuming Postfix is controlling 100% of the delivery.
That's strange. Normally the delivery is done by Postfix, and Dovecot is used only for fetching mails from the server.
__________________
Falko
--
Download the ISPConfig 3 Manual! | Check out the ISPConfig 3 Billing Module!

FB: http://www.facebook.com/howtoforge

nginx-Webhosting: Timme Hosting | Follow me on:
Reply With Quote
The Following User Says Thank You to falko For This Useful Post:
rusty (31st January 2008)
Reply

Bookmarks

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 delivery problem erebus Installation/Configuration 8 29th July 2014 21:17
Cannot add the email alias: contact or contacts swieep General 4 22nd October 2007 20:47
Access Problem with Apache2 Alias Heinz Installation/Configuration 3 18th November 2006 16:19
Alias for multiple users erk General 4 16th November 2005 17:52
Alias outside of Web1? Bedevere Installation/Configuration 3 8th September 2005 03:15


All times are GMT +2. The time now is 11:51.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.