Prijedlozi #15643
Zatvorenpostfix sender based routing
100%
Opis
sender_relay, transport, relay_transport, relayhost
Izmjenjeno od Ernad Husremović prije više od 16 godina
- Naslov promijenjeno iz postfix esmtp u postfix sender based routing
- Status promijenjeno iz Novo u Dodijeljeno
Izmjenjeno od Ernad Husremović prije više od 16 godina
sender_relay¶
Hi I am using postfix 2.3.2, the sender_dependent_relayhost_maps works fine in main.cf , but when i use it in another smtpd configured in master.cf , it doesn't work. It seems that the sender_dependent_relayhost_maps option has been ignored, and the mail will not be relayed to the destination smtpd . Does anybody has any ideas? Thanks in advance, --Sheng.Zheng /etc/postfix/master.cf 127.0.0.1:10025 inet n - n - 30 smtpd -o myhostname=localsmtpd2-after-viruscheck -o cleanup_service_name=header_clear -o sender_dependent_relayhost_maps=hash:/etc/postfix/sender_relay -o content_filter= -o local_recipient_maps= -o relay_recipient_maps= -o mynetworks=127.0.0.0/8 -o mynetworks_style=host -o smtpd_restriction_classes= -o smtpd_client_restrictions= -o smtpd_helo_restrictions= -o smtpd_sender_restrictions= -o smtpd_recipient_restrictions=permit_mynetworks,reject -o receive_override_options=no_unknown_recipient_checks header_clear unix n - n - 0 cleanup -o header_checks=regexp:/etc/postfix/header_checks /etc/postfix/sender_relay: @domain-a.com smtpdhost1 @domain-b.com smtpdhost2
Izmjenjeno od Ernad Husremović prije više od 16 godina
Postfix 2.2 uses the generic(5) address mapping to replace local fantasy email addresses by valid Internet addresses. This mapping happens ONLY when mail leaves the machine; not when you send mail between users on the same machine.
The following example presents additional configuration. You need to combine this with basic configuration information as discussed the first half of this document.
1 /etc/postfix/main.cf: 2 smtp_generic_maps = hash:/etc/postfix/generic 3 4 /etc/postfix/generic: 5 his@localdomain.local hisaccount@hisisp.example 6 her@localdomain.local heraccount@herisp.example 7 @localdomain.local hisaccount+local@hisisp.example
ali to nam ne treba
Izmjenjeno od Ernad Husremović prije više od 16 godina
Supporting multiple ISP accounts in the Postfix SMTP client¶
Postfix version 2.3 supports multiple ISP accounts. This can be useful when one person uses the same machine for work and for personal use, or when people with different ISP accounts share the same Postfix server. To make this possible, Postfix 2.3 supports per-sender SASL passwords and per-sender relay hosts. In the example below, Postfix will search the SASL password file by sender before it searches that same file by destination. Likewise, Postfix will search the per-sender relayhost file, and use the default relayhost only as a final resort.
/etc/postfix/main.cf:
smtp_sender_dependent_authentication = yes sender_dependent_relayhost_maps = hash:/etc/postfix/sender_relay smtp_sasl_auth_enable = yes smtp_sasl_password_maps = hash:/etc/postfix/sasl_passwd relayhost = [mail.myisp.net] # Alternative form: # relayhost = [mail.myisp.net]:submission
/etc/postfix/sasl_passwd:
# Per-sender authentication; see also /etc/postfix/sender_relay. user1@example.com username2:password2 user2@example.net username2:password2 # Login information for the default relayhost. [mail.myisp.net] username:password [mail.myisp.net]:submission username:password
/etc/postfix/sender_relay:
# Per-sender provider; see also /etc/postfix/sasl_passwd. user1@example.com [mail.example.com]:submission user2@example.net [mail.example.net]Notes:
- If you are creative, then you can try to combine the two tables into one single MySQL database, and configure different Postfix queries to extract the appropriate information.
- Specify dbm instead of hash if your system uses dbm files instead of db files. To find out what lookup tables Postfix supports, use the command "postconf -m".
- Execute the command "postmap /etc/postfix/sasl_passwd" whenever you change the sasl_passwd table.
- Execute the command "postmap /etc/postfix/sender_relay" whenever you change the sender_relay table.
ovo nam treba !
Izmjenjeno od Ernad Husremović prije više od 16 godina
sender_dependent_relayhost_maps(default: empty)¶
A sender-dependent override for the global relayhost parameter setting. The tables are searched by the envelope sender address and @domain. A lookup result of DUNNO terminates the search without overriding the global relayhost parameter setting (Postfix 2.6 and later). This information is overruled with relay_transport, default_transport and with the transport(5) table.
For safety reasons, this feature does not allow $number substitutions in regular expression maps.
This feature is available in Postfix 2.3 and later.
Izmjenjeno od Ernad Husremović prije više od 16 godina
google apps + lokalni isp¶
ovo bi trebalo biti baš to što nam treba:
Using a combination of EveryDNS.net (http://www.everydns.net/) and Google Apps (http://www.google.com/a/), you can host a local website
on your home Linux box; yet, send and receive email for your registered domain at Google. Yes, recipients see mail coming from your
registered domain and not gmail. Although, you can can do this for just gmail - if you don't have a registered domain.
This is free, as in it doesn't cost anything.
EveryDNS:
This service provides dynamic DNS resolution. So if you're using Comcast or Verizon and your IP address changes, DNS record information
will get updated automatically by a Perl script running on your local Linux box. This service also allows you to point just the MX record to
Google. Yeah, it's also free.
Google Apps:
For up to 5G, per email account, per domain the service is free. So that's 100*5G=500G of storage that you can get for free at Google. You
can download email as soon as it arrives for unlimited email.
Advantages:
a. Can relay mail from your Linux box to Google with less chance of having to worry about a blocked IP address via Spamhaus and SORBS.
This could be an issue with email coming directly from your Comcast or Verizon address.
b. Leverage Gmail's spam filtering for incoming email.
c. IMAP and POP services
d. You can use your domain. You don't have to use gmail. See my example
with cwxstat.org using Postfix.
If you're using Postfix, you may want to reference the following link.
http://souptonuts.sourceforge.net/postfix_tutorial.html
Note - The link is a bit dated. Recent versions of Postfix don't require running a second instance of Postfix, for more than one email
account. Instead, you can make use of sender_dependent_relayhost_maps.
A quick configuration is shown below. The following was for the domain cwxstat.org. Note that individual passwords are needed in the
sasl_passwd file, so this can be a pain if you're doing it for a whole company. This was taking from a working configuration on
v0.mchirico.org
main.cf:
relayhost = [cwxstat.org] sender_dependent_relayhost_maps = hash:/etc/postfix/sender_relayhost
sasl_passwd:
mchirico@cwxstat.org mchirico@cwxstat.org:pASSword1 zchirico@cwxstat.org zchirico@cwxstat.org:passwor2 achirico@cwxstat.org achirico@cwxstat.org:pAsswwword3 lchirico@cwxstat.org lchirico@cwxstat.org:Klp3942mmmM root@cwxstat.org zchirico@cwxstat.org:bumppy93MMlm
transport:
cwxstat.org smtp:[cwxstat.org]
sender_relayhost:
#format: sender-address relayhost mchirico@cwxstat.org [cwxstat.org] zchirico@cwxstat.org [cwxstat.org] achirico@cwxstat.org [cwxstat.org] lchirico@cwxstat.org [cwxstat.org] root@cwxstat.org [cwxstat.org]
Note below, my Linux box is v0.mchirico.com, and I don't have a mchirico account on this box. But, I want all chirico email to be sent
as mchirico@cwxstat.org
generic:
chirico@v0.mchirico.com mchirico@cwxstat.org root@v0.mchirico.com root@cwxstat.org achirico@v0.mchirico.com achirico@cwxstat.org zchirico@v0.mchirico.com zchirico@cwxstat.org lchirico@v0.mchirico.com lchirico@cwxstat.org
The necessary setting for fetchmail can be found
at the following link:
http://souptonuts.sourceforge.net/postfix_tutorial.html
Hope this helps someone,
Mike Chirico
Izmjenjeno od Ernad Husremović prije više od 16 godina
relay_transport (default: relay)¶
The default mail delivery transport and next-hop destination for remote delivery to domains listed with $relay_domains. In order of decreasing precedence, the nexthop destination is taken from $relay_transport, $sender_dependent_relayhost_maps, $relayhost, or from the recipient domain. This information can be overruled with the transport(5) table.
Specify a string of the form transport:nexthop, where transport is the name of a mail delivery transport defined in master.cf. The :nexthop part is optional. For more details see the transport(5) manual page.
See also the relay domains address class in the ADDRESS_CLASS_README file.
This feature is available in Postfix 2.0 and later.
relayhost (default: empty)¶
The next-hop destination of non-local mail; overrides non-local domains in recipient addresses. This information is overruled with relay_transport, default_transport, sender_dependent_relayhost_maps and with the transport(5) table.
On an intranet, specify the organizational domain name. If your internal DNS uses no MX records, specify the name of the intranet gateway host instead.
In the case of SMTP, specify a domain name, hostname, hostname:port, [hostname]:port, [hostaddress] or [hostaddress]:port. The form [hostname] turns off MX lookups.
If you're connected via UUCP, see the UUCP_README file for useful information.
Examples:
relayhost = $mydomain
relayhost = [gateway.my.domain]
relayhost = uucphost
relayhost = [an.ip.add.ress]
Izmjenjeno od Ernad Husremović prije više od 16 godina
konfiguracija koja radi za sigma-com, bring.out.ba¶
napokon skontao
1. main.cf¶
relevantni dio configa je:
# gledaj sendera kod authentifikacije na vanjske servere smtp_sender_dependent_authentication = yes sender_dependent_relayhost_maps = hash:/etc/postfix/sender_relay # za domene koje mi handliramo (gdje smo mi kranja destinacija) # (pošta za sigma-com, vindija.ba) šalji na odgovarajući server unutar naše mreže transport_maps = hash:/etc/postfix/transport # ako nije određeno u sender_rely ili postfix_transport send to this stmp server relay_transport = smtp relayhost = [out.mail.bih.net.ba]
2. sender_relay¶
hernad@bring.out.ba smtp.gmail.com:587 ernad.husremovic@bring.out.ba smtp.gmail.com:587 hernad@openoffice.ba smtp.gmail.com:587 ernad.husremovic@openoffice.ba smtp.gmail.com:587 ... isto vako vsasa bjasko
3. sasl_passwd¶
sasl_passwd
# glavni relay - sve ide preko njega što nije openoffice.ba i bring.out.ba out.mail.bih.net.ba hsamrae:xxxxxxxxxxx #hernad b-out-ba hernad@bring.out.ba hernad@bring.out.ba:xxxxxxxxx ernad.husremovic@bring.out.ba hernad@bring.out.ba:xxxxxxxx #hernad ooo-ba hernad@openoffice.ba hernad@openoffice.ba:yyyyyyyyy ernad.husremovic@openoffice.ba hernad@openoffice.ba:yyyyyy
Izmjenjeno od Ernad Husremović prije više od 16 godina
- % završeno promijenjeno iz 0 u 100
Izmjenjeno od Ernad Husremović prije oko 16 godina
- Status promijenjeno iz Dodijeljeno u Zatvoreno