HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials

HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials (http://www.howtoforge.com/forums/index.php)
-   Server Operation (http://www.howtoforge.com/forums/forumdisplay.php?f=5)
-   -   Postfix: Generic mapping not working (http://www.howtoforge.com/forums/showthread.php?t=19899)

DanielB 28th January 2008 23:41

Postfix: Generic mapping not working
 
Hi!

It seems that my generic map does not work.

I have followed the guide "Howto: ISP-style Email Server with Debian-Etch and Postfix 2.3" (http://workaround.org/articles/ispmail-etch/) (postfix, mysql, dovecot, amavisd-new, clamav, spamassasin). I am using the latest postix 2.4.5 on a Ubuntu 7.10 amd64 server and everything works fine except for one thing -- the generic mapping.

I have, let say, a mylocaldomain.com which is my name of my local network and an external domain called mydomain.com.

The problem is that when I am sending an email, the recived mail get the headings:

X-Virus-Scanned: Debian amavisd-new at mydomain.com
Received: from mail.mydomain.com ([127.0.0.1])
by localhost (mail.mydomain [127.0.0.1]) (amavisd-new, port 10024)


and,

Received: from [192.168.1.10] (user.mylocaldomain.com [192.168.1.10])
by mail.mydomain.com (Postfix)


So my question is, why is user.mylocaldomain.com shown? And also, why is my local IP shown (192.168.1.10)? How can I rewrite this with generic maps (or should I do something else?)

This is the output from postconf -n:

alias_database = hash:/etc/aliases
alias_maps = hash:/etc/aliases
append_dot_mydomain = no
biff = no
config_directory = /etc/postfix
content_filter = smtp-amavis:[127.0.0.1]:10024
inet_interfaces = all
local_recipient_maps =
mailbox_size_limit = 0
masquerade_domains = mail.mydomain.com mydomain.com
mydestination = mail.mydomain.com localhost.mydomain.com localhost localhost.mylocaldomain.com server.mylocaldomain.com
mydomain = mydomain.com
myhostname = mail.mydomain.com
mynetworks = 192.168.1.0/24, 127.0.0.0/8
myorigin = /etc/mailname
proxy_interfaces = xxx.yyy.zzz.www (my ip of mydomain.com)
receive_override_options = no_address_mappings
recipient_delimiter = +
relayhost =
smtp_generic_maps = hash:/etc/postfix/generic
smtp_tls_session_cache_database = btree:${queue_directory}/smtp_scache
smtpd_banner = $myhostname ESMTP $mail_name (Ubuntu)
smtpd_recipient_restrictions = permit_mynetworks,permit_sasl_authenticated,reject _unauth_destination
smtpd_sasl_auth_enable = yes
smtpd_sasl_path = private/auth
smtpd_sasl_type = dovecot
smtpd_tls_CAfile = /etc/ssl/rootca.pem
smtpd_tls_auth_only = yes
smtpd_tls_cert_file = /etc/ssl/cert/mail.mydomain.com.pem
smtpd_tls_key_file = /etc/ssl/key/mail.mydomain.com.pem
smtpd_tls_session_cache_database = btree:${queue_directory}/smtpd_scache
smtpd_use_tls = yes
virtual_alias_maps = mysql:/etc/postfix/mysql-virtual-alias-maps.cf,mysql:/etc/postfix/mysql-email2email.cf
virtual_gid_maps = static:5000
virtual_mailbox_domains = mysql:/etc/postfix/mysql-virtual-mailbox-domains.cf
virtual_mailbox_maps = mysql:/etc/postfix/mysql-virtual-mailbox-maps.cf
virtual_transport = dovecot
virtual_uid_maps = static:5000


Note that I have the line: smtp_generic_maps = hash:/etc/postfix/generic. In this "generic"-file I have tried many different mappings without success. It seems that this file is not read, I am not sure. Note also "receive_override_options = no_address_mappings" but this only effects the received mails and not when you send, or?

I have added the following to my master.cf:

# DOVECOT:
dovecot unix - n n - - pipe
flags=DRhu user=vmail:vmail argv=/usr/lib/dovecot/deliver -d ${recipient}
#
# AMAVIS:
smtp-amavis unix - - n - 2 smtp
-o smtp_data_done_timeout=1200
-o smtp_send_xforward_command=yes
-o disable_dns_lookups=yes
-o max_use=20
-o smtp_generic_maps=
-o disable_mime_output_conversion=yes
#
#
127.0.0.1:10025 inet n - - - - smtpd
-o content_filter=
-o local_recipient_maps=
-o relay_recipient_maps=
-o smtpd_restriction_classes=
-o smtpd_delay_reject=no
-o smtpd_client_restrictions=permit_mynetworks,reject
-o smtpd_helo_restrictions=
-o smtpd_sender_restrictions=
-o smtpd_recipient_restrictions=permit_mynetworks,rej ect
-o smtpd_data_restrictions=reject_unauth_pipelining
-o smtpd_end_of_data_restrictions=
-o mynetworks=127.0.0.0/8
-o smtpd_error_sleep_time=0
-o smtpd_soft_error_limit=1001
-o smtpd_hard_error_limit=1000
-o smtpd_client_connection_count_limit=0
-o smtpd_client_connection_rate_limit=0
-o receive_override_options=no_header_body_checks,no_ unknown_recipient_checks
-o local_header_rewrite_clients=
-o smtpd_authorized_xforward_hosts=127.0.0.0/8


As far as I under stand is that when I am sending an email it goes first to Amavis on port 10024. Since the transport map for Amavis includes "smtp_generic_maps= ", the "generic"-file is not used at this stage. The email is then sent to port 10025 where Postfix take over to finally send the email. Since the transpost map for "127.0.0.1:10025" does NOT contain "smtp_generic_maps= " the generic map should be used, but it doesn't. Or?

I have one more question. Let say that some of you solve my problem and the generic mapping works! How can I do the following:

user.mylocaldomian.com myname.domain.com #(case 1)
user.mylocaldomian.com myname.otherdomain.com #(case 2)


I don't know if you understand what I am trying to say. Let say I host two domains on my server (my work mail and private mail). If I am the user on a local machine and want to send a mail using "myname.domain.com" I want the generic map to use "case 1" but if I instead use "myname.otherdomain.com", the "case 2" should be mapped.

I guess I don't really understand the generic mapping because I can not see how this can be done. So how do you do something like this?

Regards,
Daniel


All times are GMT +2. The time now is 14:04.

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