postfix+domains

This is a discussion on postfix+domains within the alt.comp.mail.postfix forums, part of the Mail Servers and Related category; Hello, I have a postfix mail server in Slackware. In main.cf I have this configuration: myhostname = domain.com myorigin = ...


Go Back   Usenet Forums > Mail Servers and Related > alt.comp.mail.postfix

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 07-13-2007
sg_pl
 
Posts: n/a
Default postfix+domains

Hello,


I have a postfix mail server in Slackware. In main.cf I have this
configuration:

myhostname = domain.com
myorigin = domain.com
mydomain = domain.com
alias_maps = hash:/etc/aliases
virtual_maps = hash:/etc/postfix/virtual
inet_interfaces = all
mydestination = $mydomain, xxx.domain.com, yyy.domain.com, otherdomain.com
relay_domains = $mydestination

The mail server works fine but when I send email from address
aaa@xxx.domain.com or xxx@otherdomain.com then my recipient in the mail
properties have information is that email is from aaa@xxx.domain.com but the
second email is from xxx@domain.com instead of xxx@otherdomain.com. What is
wrong in the configuration of postfix?

Thanks for help, Best Regards
Sebastian


Reply With Quote
  #2 (permalink)  
Old 07-14-2007
Alexander Dalloz
 
Posts: n/a
Default Re: postfix+domains

Am Fri, 13 Jul 2007 07:43:08 +0200 schrieb sg_pl:

> Hello,
>
>
> I have a postfix mail server in Slackware. In main.cf I have this
> configuration:
>
> myhostname = domain.com
> myorigin = domain.com
> mydomain = domain.com
> alias_maps = hash:/etc/aliases
> virtual_maps = hash:/etc/postfix/virtual inet_interfaces = all
> mydestination = $mydomain, xxx.domain.com, yyy.domain.com,
> otherdomain.com relay_domains = $mydestination
>
> The mail server works fine but when I send email from address
> aaa@xxx.domain.com or xxx@otherdomain.com then my recipient in the mail
> properties have information is that email is from aaa@xxx.domain.com but
> the second email is from xxx@domain.com instead of xxx@otherdomain.com.
> What is wrong in the configuration of postfix?
>
> Thanks for help, Best Regards
> Sebastian


Sorry, your posting lacks important information: how do you send mail
out? Using which mail client? And provide mail log content for the cases
where you see the described results. And according the results: where
exactly do the false mail addresses appear - as the header From or the
envelope sender? If you can't answer this question, then provide full
mail headers as well.

Alexander

P.S. Providing Postfix setup information it is more reliable to print out
"postconf -n" rather than showing main.cf content.
Reply With Quote
  #3 (permalink)  
Old 07-17-2007
sg_pl
 
Posts: n/a
Default Re: postfix+domains


Użytkownik "Alexander Dalloz" <adalloz@arcor.de> napisał w wiadomości
news:pan.2007.07.14.22.43.54@arcor.de...
> Am Fri, 13 Jul 2007 07:43:08 +0200 schrieb sg_pl:
>
>> Hello,
>>
>>
>> I have a postfix mail server in Slackware. In main.cf I have this
>> configuration:
>>
>> myhostname = domain.com
>> myorigin = domain.com
>> mydomain = domain.com
>> alias_maps = hash:/etc/aliases
>> virtual_maps = hash:/etc/postfix/virtual inet_interfaces = all
>> mydestination = $mydomain, xxx.domain.com, yyy.domain.com,
>> otherdomain.com relay_domains = $mydestination
>>
>> The mail server works fine but when I send email from address
>> aaa@xxx.domain.com or xxx@otherdomain.com then my recipient in the mail
>> properties have information is that email is from aaa@xxx.domain.com but
>> the second email is from xxx@domain.com instead of xxx@otherdomain.com.
>> What is wrong in the configuration of postfix?
>>
>> Thanks for help, Best Regards
>> Sebastian

>
> Sorry, your posting lacks important information: how do you send mail
> out? Using which mail client? And provide mail log content for the cases
> where you see the described results. And according the results: where
> exactly do the false mail addresses appear - as the header From or the
> envelope sender? If you can't answer this question, then provide full
> mail headers as well.
>
> Alexander
>
> P.S. Providing Postfix setup information it is more reliable to print out
> "postconf -n" rather than showing main.cf content.


Hi

Im sending mail from mail client (Outlook Express), yes the false mail
adress is in mail header. Below the configuration and log. The mail adreess
should be testing@otherdomain.com but there is testing@domain.com - why?

Regards
Sebastian

Jul 17 07:40:11 domain postfix/smtpd[10054]: connect from
unknown[195.250.249.165]
Jul 17 07:40:11 domain postfix/smtpd[10054]: CDF1A1269C8:
client=unknown[195.250.249.165], sasl_method=LOGIN, sasl_username=testing
Jul 17 07:40:11 domain postfix/cleanup[10086]: CDF1A1269C8:
message-id=<007601c7c837$6ebf8470$75010a0a@admin>
Jul 17 07:40:11 domain postfix/qmgr[11757]: CDF1A1269C8:
from=testing@domain.com, size=3096, nrcpt=1 (queue active)
Jul 17 07:40:12 domain postfix/smtp[10056]: CDF1A1269C8:
to=<jn@poczta.onet.pl>, relay=mx.poczta.onet.pl[213.180.130.86], delay=1,
status=deferred (host mx.poczta.onet.pl[213.180.130.86] said: 450 4.7.1 W$
Jul 17 07:40:14 domain postfix/smtpd[10054]: disconnect from
unknown[195.250.249.165]




alias_maps = hash:/etc/aliases
broken_sasl_auth_clients = yes
command_directory = /usr/sbin
config_directory = /etc/postfix
daemon_directory = /usr/libexec/postfix
debug_peer_level = 2
default_destination_concurrency_limit = 10
html_directory = no
inet_interfaces = all
local_destination_concurrency_limit = 2
mail_name = SG Server 2.23
mail_owner = postfix
mail_spool_directory = /var/spool/mail
mailbox_command = /usr/bin/procmail
mailbox_size_limit = 51200000
mailq_path = /usr/bin/mailq
manpage_directory = /usr/local/man
maximal_queue_lifetime = 2d
message_size_limit = 15120000
mydestination = $mydomain, xxx.domain.com, yyy.domain.com, otherdomain.com
mydomain = domain.com
myhostname = domain.com
mynetworks = 10.10.3.0/24, 127.0.0.0/8
myorigin = domain.com
newaliases_path = /usr/bin/newaliases
queue_directory = /var/spool/postfix
queue_minfree = 10000000
queue_run_delay = 30m
readme_directory = no
relay_domains = $mydestination
sample_directory = /etc/postfix
sender_canonical_maps = hash:/etc/postfix/sender_canonical
sendmail_path = /usr/sbin/sendmail
setgid_group = postdrop
smtpd_banner = $hostname SG Server 2.23
smtpd_recipient_limit = 200
smtpd_recipient_restrictions = permit_sasl_authenticated, permit_mynetworks,
reject_unauth_destination
smtpd_sasl_auth_enable = yes
smtpd_sasl_security_options = noanonymous
smtpd_sender_login_maps = hash:/etc/postfix/login_maps
smtpd_sender_restrictions = reject_sender_login_mismatch
unknown_local_recipient_reject_code = 450


Reply With Quote
  #4 (permalink)  
Old 07-17-2007
Alexander Dalloz
 
Posts: n/a
Default Re: postfix+domains

Am Tue, 17 Jul 2007 08:02:57 +0200 schrieb sg_pl:

> Hi
>
> Im sending mail from mail client (Outlook Express), yes the false mail
> adress is in mail header. Below the configuration and log. The mail
> adreess should be testing@otherdomain.com but there is
> testing@domain.com - why?


Hm, you are still not precise whether it is the envelope sender address
you are speaking about or the From: address. From pasted log snipplet I
conclude it is the envelope sender information.

Both information should be set by the MUA (mail client, OE in your case).
Have you ensured that the client setup has all the required information
set properly?

> Regards
> Sebastian
>
> Jul 17 07:40:11 domain postfix/smtpd[10054]: connect from
> unknown[195.250.249.165]
> Jul 17 07:40:11 domain postfix/smtpd[10054]: CDF1A1269C8:
> client=unknown[195.250.249.165], sasl_method=LOGIN,
> sasl_username=testing Jul 17 07:40:11 domain postfix/cleanup[10086]:
> CDF1A1269C8: message-id=<007601c7c837$6ebf8470$75010a0a@admin> Jul 17
> 07:40:11 domain postfix/qmgr[11757]: CDF1A1269C8:
> from=testing@domain.com, size=3096, nrcpt=1 (queue active) Jul 17
> 07:40:12 domain postfix/smtp[10056]: CDF1A1269C8:
> to=<jn@poczta.onet.pl>, relay=mx.poczta.onet.pl[213.180.130.86],
> delay=1, status=deferred (host mx.poczta.onet.pl[213.180.130.86] said:
> 450 4.7.1 W$ Jul 17 07:40:14 domain postfix/smtpd[10054]: disconnect
> from unknown[195.250.249.165]



> mydestination = $mydomain, xxx.domain.com, yyy.domain.com,

otherdomain.com
> mydomain = domain.com
> myhostname = domain.com
> mynetworks = 10.10.3.0/24, 127.0.0.0/8
> myorigin = domain.com
> newaliases_path = /usr/bin/newaliases queue_directory = /var/spool/

postfix
> queue_minfree = 10000000
> queue_run_delay = 30m
> readme_directory = no
> relay_domains = $mydestination
> sample_directory = /etc/postfix
> sender_canonical_maps = hash:/etc/postfix/sender_canonical
> sendmail_path = /usr/sbin/sendmail
> setgid_group = postdrop
> smtpd_banner = $hostname SG Server 2.23


Why do you not advertise ESMTP? Guess that is not intended, so mangling
the banner without knowing the RFCs has the risc to do the wrong things.

Btw. is your mail host really just named with the domain and has no
hostname part ($myhostname)?

$ postconf -d append_dot_mydomain
append_dot_mydomain = yes

That is a default. So if your MUA does not set a FQDN envelope sender
address, Postfix will append what is specified in $myorigin. And that is,
in your case, domain.com.

Alexander

Reply With Quote
  #5 (permalink)  
Old 07-17-2007
Martin Gregorie
 
Posts: n/a
Default Re: postfix+domains

sg_pl wrote:
> Użytkownik "Alexander Dalloz" <adalloz@arcor.de> napisał w wiadomości
> news:pan.2007.07.14.22.43.54@arcor.de...
>> Am Fri, 13 Jul 2007 07:43:08 +0200 schrieb sg_pl:
>>
>>> Hello,
>>>
>>>
>>> I have a postfix mail server in Slackware. In main.cf I have this
>>> configuration:
>>>
>>> myhostname = domain.com
>>> myorigin = domain.com
>>> mydomain = domain.com
>>> alias_maps = hash:/etc/aliases
>>> virtual_maps = hash:/etc/postfix/virtual inet_interfaces = all
>>> mydestination = $mydomain, xxx.domain.com, yyy.domain.com,
>>> otherdomain.com relay_domains = $mydestination
>>>
>>> The mail server works fine but when I send email from address
>>> aaa@xxx.domain.com or xxx@otherdomain.com then my recipient in the mail
>>> properties have information is that email is from aaa@xxx.domain.com but
>>> the second email is from xxx@domain.com instead of xxx@otherdomain.com.
>>> What is wrong in the configuration of postfix?
>>>
>>> Thanks for help, Best Regards
>>> Sebastian

>> Sorry, your posting lacks important information: how do you send mail
>> out? Using which mail client? And provide mail log content for the cases
>> where you see the described results. And according the results: where
>> exactly do the false mail addresses appear - as the header From or the
>> envelope sender? If you can't answer this question, then provide full
>> mail headers as well.
>>
>> Alexander
>>
>> P.S. Providing Postfix setup information it is more reliable to print out
>> "postconf -n" rather than showing main.cf content.

>
> Hi
>
> Im sending mail from mail client (Outlook Express), yes the false mail
> adress is in mail header. Below the configuration and log. The mail adreess
> should be testing@otherdomain.com but there is testing@domain.com - why?
>
> Regards
> Sebastian
>
> Jul 17 07:40:11 domain postfix/smtpd[10054]: connect from
> unknown[195.250.249.165]
> Jul 17 07:40:11 domain postfix/smtpd[10054]: CDF1A1269C8:
> client=unknown[195.250.249.165], sasl_method=LOGIN, sasl_username=testing
> Jul 17 07:40:11 domain postfix/cleanup[10086]: CDF1A1269C8:
> message-id=<007601c7c837$6ebf8470$75010a0a@admin>
> Jul 17 07:40:11 domain postfix/qmgr[11757]: CDF1A1269C8:
> from=testing@domain.com, size=3096, nrcpt=1 (queue active)
> Jul 17 07:40:12 domain postfix/smtp[10056]: CDF1A1269C8:
> to=<jn@poczta.onet.pl>, relay=mx.poczta.onet.pl[213.180.130.86], delay=1,
> status=deferred (host mx.poczta.onet.pl[213.180.130.86] said: 450 4.7.1 W$
> Jul 17 07:40:14 domain postfix/smtpd[10054]: disconnect from
> unknown[195.250.249.165]
>
>
>
>
> alias_maps = hash:/etc/aliases
> broken_sasl_auth_clients = yes
> command_directory = /usr/sbin
> config_directory = /etc/postfix
> daemon_directory = /usr/libexec/postfix
> debug_peer_level = 2
> default_destination_concurrency_limit = 10
> html_directory = no
> inet_interfaces = all
> local_destination_concurrency_limit = 2
> mail_name = SG Server 2.23
> mail_owner = postfix
> mail_spool_directory = /var/spool/mail
> mailbox_command = /usr/bin/procmail
> mailbox_size_limit = 51200000
> mailq_path = /usr/bin/mailq
> manpage_directory = /usr/local/man
> maximal_queue_lifetime = 2d
> message_size_limit = 15120000
> mydestination = $mydomain, xxx.domain.com, yyy.domain.com, otherdomain.com
> mydomain = domain.com
> myhostname = domain.com
> mynetworks = 10.10.3.0/24, 127.0.0.0/8
> myorigin = domain.com
> newaliases_path = /usr/bin/newaliases
> queue_directory = /var/spool/postfix
> queue_minfree = 10000000
> queue_run_delay = 30m
> readme_directory = no
> relay_domains = $mydestination
> sample_directory = /etc/postfix
> sender_canonical_maps = hash:/etc/postfix/sender_canonical
> sendmail_path = /usr/sbin/sendmail
> setgid_group = postdrop
> smtpd_banner = $hostname SG Server 2.23
> smtpd_recipient_limit = 200
> smtpd_recipient_restrictions = permit_sasl_authenticated, permit_mynetworks,
> reject_unauth_destination
> smtpd_sasl_auth_enable = yes
> smtpd_sasl_security_options = noanonymous
> smtpd_sender_login_maps = hash:/etc/postfix/login_maps
> smtpd_sender_restrictions = reject_sender_login_mismatch
> unknown_local_recipient_reject_code = 450
>
>

Postfix rewrites From: addresses so they match $mydomain. This prevents
its clients from sending mail with forged or misconfigured From: domain
names.


--
martin@ | Martin Gregorie
gregorie. | Essex, UK
org |
Reply With Quote
  #6 (permalink)  
Old 07-17-2007
Alexander Dalloz
 
Posts: n/a
Default Re: postfix+domains

Am Tue, 17 Jul 2007 12:52:39 +0100 schrieb Martin Gregorie:

> Postfix rewrites From: addresses so they match $mydomain. This prevents
> its clients from sending mail with forged or misconfigured From: domain
> names.


I doubt this statement in its general form is correct.

Alexander
Reply With Quote
  #7 (permalink)  
Old 07-17-2007
Martin Gregorie
 
Posts: n/a
Default Re: postfix+domains

Alexander Dalloz wrote:
> Am Tue, 17 Jul 2007 12:52:39 +0100 schrieb Martin Gregorie:
>
>> Postfix rewrites From: addresses so they match $mydomain. This prevents
>> its clients from sending mail with forged or misconfigured From: domain
>> names.

>
> I doubt this statement in its general form is correct.
>

It certainly seemed to do that for me when I was setting my rig up and
using mutt to generate test e-mails. Now all my mail goes out through
Evolution and I see the following behavior:

- if I send mail "From: me@account.isp.org" via my Postfix it always
gets rewritten to "From: me@mydomain.org". The Postfix host name
is host.mydomain.org, mydomain is defaulted and myorigin=$mydomain

- the only way I can get mail out the door marked as
"From: me@account.isp.org" is to bypass Postfix by pointing
Evolution directly at my ISP's mailserver

The only other form of address rewriting I use is /etc/aliases.db to
redirect incoming mail as appropriate, e.g. system mail to root is
redirected to my usual mailbox. Here's my setup:

# postconf -n
alias_database = hash:/etc/aliases
alias_maps = hash:/etc/aliases
always_bcc = ma
command_directory = /usr/sbin
config_directory = /etc/postfix
daemon_directory = /usr/libexec/postfix
debug_peer_level = 2
delay_warning_time = 4h
html_directory = no
inet_interfaces = all
local_recipient_maps = proxy:unix:passwd.byname $alias_maps
mail_owner = postfix
mailq_path = /usr/bin/mailq.postfix
manpage_directory = /usr/share/man
mydestination = $myhostname, localhost.$mydomain, localhost, $mydomain,
account.isp.org
mynetworks = 192.168.7.0/24, 127.0.0.0/8
myorigin = $mydomain
newaliases_path = /usr/bin/newaliases.postfix
queue_directory = /var/spool/postfix
readme_directory = /usr/share/doc/postfix-2.2.8/README_FILES
relay_domains = $mydomain
relayhost = smtp.isp.org
sample_directory = /usr/share/doc/postfix-2.2.8/samples
sendmail_path = /usr/sbin/sendmail.postfix
setgid_group = postdrop
unknown_local_recipient_reject_code = 550


--
martin@ | Martin Gregorie
gregorie. | Essex, UK
org |
Reply With Quote
  #8 (permalink)  
Old 07-17-2007
Alexander Dalloz
 
Posts: n/a
Default Re: postfix+domains

Am Tue, 17 Jul 2007 19:34:18 +0100 schrieb Martin Gregorie:

> Alexander Dalloz wrote:
>> Am Tue, 17 Jul 2007 12:52:39 +0100 schrieb Martin Gregorie:
>>
>>> Postfix rewrites From: addresses so they match $mydomain. This
>>> prevents its clients from sending mail with forged or misconfigured
>>> From: domain names.

>>
>> I doubt this statement in its general form is correct.
>>

> It certainly seemed to do that for me when I was setting my rig up and
> using mutt to generate test e-mails. Now all my mail goes out through
> Evolution and I see the following behavior:
>
> - if I send mail "From: me@account.isp.org" via my Postfix it always
> gets rewritten to "From: me@mydomain.org". The Postfix host name is
> host.mydomain.org, mydomain is defaulted and myorigin=$mydomain
>
> - the only way I can get mail out the door marked as
> "From: me@account.isp.org" is to bypass Postfix by pointing Evolution
> directly at my ISP's mailserver


Evolution (and formerly mutt) is configured to do submission through the
sendmail binary - or do you use SMTP?

> The only other form of address rewriting I use is /etc/aliases.db to
> redirect incoming mail as appropriate, e.g. system mail to root is
> redirected to my usual mailbox. Here's my setup:
>
> # postconf -n
> alias_database = hash:/etc/aliases
> alias_maps = hash:/etc/aliases
> always_bcc = ma
> command_directory = /usr/sbin
> config_directory = /etc/postfix
> daemon_directory = /usr/libexec/postfix debug_peer_level = 2
> delay_warning_time = 4h
> html_directory = no
> inet_interfaces = all
> local_recipient_maps = proxy:unix:passwd.byname $alias_maps mail_owner =
> postfix
> mailq_path = /usr/bin/mailq.postfix
> manpage_directory = /usr/share/man
> mydestination = $myhostname, localhost.$mydomain, localhost, $mydomain,
> account.isp.org
> mynetworks = 192.168.7.0/24, 127.0.0.0/8 myorigin = $mydomain
> newaliases_path = /usr/bin/newaliases.postfix queue_directory =
> /var/spool/postfix
> readme_directory = /usr/share/doc/postfix-2.2.8/README_FILES
> relay_domains = $mydomain


Why is you destination domain set as relay_domain? Does your Postfix act
as a gateway? Why then you miss $relay_recipient_maps?

> relayhost = smtp.isp.org
> sample_directory = /usr/share/doc/postfix-2.2.8/samples sendmail_path =
> /usr/sbin/sendmail.postfix setgid_group = postdrop
> unknown_local_recipient_reject_code = 550


Seeing a debug mail log where the sender address rewriting happens could
be useful.

Alexander
Reply With Quote
  #9 (permalink)  
Old 07-18-2007
Martin Gregorie
 
Posts: n/a
Default Re: postfix+domains

Alexander Dalloz wrote:
> Evolution (and formerly mutt) is configured to do submission through the
> sendmail binary - or do you use SMTP?
>

Mutt does whatever it does out of the box, so anything I send with it
sends goes via the local copy of Postfix, which has a minimal
configuration that forwards everything via SMTP to my central Postfix
server: that's the one I ran postconf on. Local mail comes back across
the LAN to Evolution. This used POP3 to talk to a Dovecot server.

Evolution is explicitly configured to use SMTP to send mail directly to
the central Postfix instance. This is the usual link, but it has another
(normally inactive) account using SMTP and POP3 to talk directly to my ISP.

>
> Why is you destination domain set as relay_domain? Does your Postfix act
> as a gateway?
>

All mail with a destination outside my domain is send (via relay_host)
to my ISP's mail server. I set relay_domain that way as (probably
needless) security so even firewall leaks can't cause unwanted relaying.

> Why then you miss $relay_recipient_maps?
>

As all mail distribution on the LAN is via POP3 I don't need it. The
'slave' copies of Postfix are also one-way servers: all they do it to
feed mail to the central server. In practice this is entirely system
generated reports from logwatch and cron.

The only missing brick is the way I get mail: I don't want any holes in
my firewall so I use fetchmail to collect incoming mail using POP3. It's
then piped through spamc to sendmail for delivery to the central Postfix
server. I put Spamassassin in the input stream because I use always_bcc
to feed a copy of all incoming and outgoing mail to a mail archive: when
I initially used the more normal setup all mail was duplicated in the
archive.

always_bcc seems to make a copy of everything coming in through the SMTP
queue, so mail got BCCed twice: Once when mail arriving from fetchmail
or Evolution was put in the SMTP queue and a second time when the
standard Spamassassin loop reinjects it into the SMTP queue after
scanning it.

Moving Spamassassin into the fetchmail input stream stopped the duplication.

A true Postfix guru might tidy up this setup a bit but I'm happy with
it. I understand how it works and it reliably does exactly what I want.


--
martin@ | Martin Gregorie
gregorie. | Essex, UK
org |
Reply With Quote
  #10 (permalink)  
Old 07-18-2007
sg_pl
 
Posts: n/a
Default Re: postfix+domains


Użytkownik "Alexander Dalloz" <adalloz@arcor.de> napisał w wiadomości
news:pan.2007.07.17.11.43.15@arcor.de...
> Am Tue, 17 Jul 2007 08:02:57 +0200 schrieb sg_pl:
>
>> Hi
>>
>> Im sending mail from mail client (Outlook Express), yes the false mail
>> adress is in mail header. Below the configuration and log. The mail
>> adreess should be testing@otherdomain.com but there is
>> testing@domain.com - why?

>
> Hm, you are still not precise whether it is the envelope sender address
> you are speaking about or the From: address. From pasted log snipplet I
> conclude it is the envelope sender information.
>
> Both information should be set by the MUA (mail client, OE in your case).
> Have you ensured that the client setup has all the required information
> set properly?
>


Hi,

all settings in OE are properly (username: testing, mail address:
testing@otherdomain.com, incoming server: otherdomain.com, outgoing server:
otherdomain.com). Why the emails sending from test@xxx.domain.com have
properly from address? Only account testing.. Have bad sender address. What
is wrong?


Sebastian


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

vB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT +1. The time now is 11:16 PM.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0