One of these *mc files cures my bounce problem. The one with the Masquerading stuff in it.
From another thread I've learned that masquerading doesn't work as I
thought it did but for years now I've been masquerading what ever machines I have at home as `newsguy.com'. I thought I'd learned a way of using the `genericstable' to do something similar and not need to masquerade.
My assumption was that the `Smart_host' at the other end of my sendmails outgoing activity required a resolvable host as source IP to avoid bouncing. I thought by setting some genericstable vars I could make it appear to be a resolvable host name.
It is not an internet FQDN, just my own made up domain for my local lan. Therefore will never be resovable by dns lookups.
My attempt at using generics tables consisted of adding: (see sendmail2.mc below for the full settings)
FEATURE(`genericstable')dnl FEATURE(`generics_entire_domain')dnl
And to /etc/mail/genericstable: reader reader@newsguy.com
Building the hash and restarting sendmail.
With that in place I get these kind of errors: (wrapped for mail). They happen too quickly to be coming from the smart_host so its my sendmail process rejecting it.
From /var/log/messages
Aug 14 19:31:34 reader sendmail[12324]: i7F0VTsA012322: to=reader@jtan.com, ctladdr=reader@reader.local.net0 (500/500), delay=00:00:04, xdelay=00:00:04, mailer=relay, pri=120355, relay=smtp.newsguy.com. [129.250.170.69], dsn=5.6.0, stat=Data format error
Aug 14 19:33:05 reader sendmail[12353]: i7F0X40h012351: to=hpreader@sbcglobal.net, ctladdr=reader@reader.local.net0 (500/500), delay=00:00:01, xdelay=00:00:01, mailer=relay, pri=120369, relay=smtp.newsguy.com. [129.250.170.69], dsn=5.6.0, stat=Data format error
=== /etc/hosts
# Do not remove the following line, or various programs # that require network functionality will fail. 127.0.0.1 localhost.localdomain localhost # =========================================================== 192.168.0.4 reader.local.net0 reader # fedcore3 t1 [...] stripped list of non-pertinent HOSTs
192.168.0.4 is the machine in question
===== sendmail1.mc
divert(-1)dnl include(`/usr/share/sendmail-cf/m4/cf.m4')dnl VERSIONID(`setup for Red Hat Linux')dnl OSTYPE(`linux')dnl define(`SMART_HOST',`smtp.newsguy.com') define(`confDEF_USER_ID',``8:12'')dnl define(`confTO_CONNECT', `1m')dnl define(`confTRY_NULL_MX_LIST',true)dnl define(`confDONT_PROBE_INTERFACES',true)dnl define(`PROCMAIL_MAILER_PATH',`/usr/bin/procmail')dnl define(`ALIAS_FILE', `/etc/aliases')dnl define(`STATUS_FILE', `/var/log/mail/statistics')dnl define(`UUCP_MAILER_MAX', `2000000')dnl define(`confUSERDB_SPEC', `/etc/mail/userdb.db')dnl define(`confPRIVACY_FLAGS', `authwarnings,novrfy,noexpn,restrictqrun')dnl define(`confAUTH_OPTIONS', `A')dnl define(`CERT_DIR',`/etc/mail/certs') define(`confCACERT_PATH',`CERT_DIR') define(`confCACERT',`CERT_DIR/cacert.pem') define(`confSERVER_CERT',`CERT_DIR/cert.pem') define(`confSERVER_KEY',`CERT_DIR/key.pem') define(`confCLIENT_CERT',`CERT_DIR/cert.pem') define(`confCLIENT_KEY',`CERT_DIR/key.pem') define(`confTO_IDENT', `0')dnl FEATURE(`no_default_msa',`dnl')dnl FEATURE(`smrsh',`/usr/sbin/smrsh')dnl FEATURE(`mailertable')dnl FEATURE(`virtusertable')dnl FEATURE(`genericstable')dnl FEATURE(`generics_entire_domain')dnl GENERICS_DOMAIN(`local.net0')dnl FEATURE(redirect)dnl FEATURE(always_add_domain)dnl FEATURE(use_cw_file)dnl FEATURE(use_ct_file)dnl FEATURE(local_procmail,`',`procmail -t -Y -a $h -d $u')dnl FEATURE(`access_db',`hash -T<TMPF> -o /etc/mail/access.db')dnl FEATURE(`blacklist_recipients')dnl FEATURE(`accept_unresolvable_domains')dnl LOCAL_DOMAIN(`localhost.localdomain')dnl MAILER(smtp)dnl MAILER(procmail)dnl
=== sendmail2.mc
divert(-1)dnl include(`/usr/share/sendmail-cf/m4/cf.m4')dnl VERSIONID(`setup for Red Hat Linux')dnl OSTYPE(`linux')dnl define(`SMART_HOST',`smtp.newsguy.com') define(`confDEF_USER_ID',``8:12'')dnl define(`confTO_CONNECT', `1m')dnl define(`confTRY_NULL_MX_LIST',true)dnl define(`confDONT_PROBE_INTERFACES',true)dnl define(`PROCMAIL_MAILER_PATH',`/usr/bin/procmail')dnl define(`ALIAS_FILE', `/etc/aliases')dnl define(`STATUS_FILE', `/var/log/mail/statistics')dnl define(`UUCP_MAILER_MAX', `2000000')dnl define(`confUSERDB_SPEC', `/etc/mail/userdb.db')dnl define(`confPRIVACY_FLAGS', `authwarnings,novrfy,noexpn,restrictqrun')dnl define(`confAUTH_OPTIONS', `A')dnl define(`CERT_DIR',`/etc/mail/certs') define(`confCACERT_PATH',`CERT_DIR') define(`confCACERT',`CERT_DIR/cacert.pem') define(`confSERVER_CERT',`CERT_DIR/cert.pem') define(`confSERVER_KEY',`CERT_DIR/key.pem') define(`confCLIENT_CERT',`CERT_DIR/cert.pem') define(`confCLIENT_KEY',`CERT_DIR/key.pem') define(`confTO_IDENT', `0')dnl FEATURE(`no_default_msa',`dnl')dnl FEATURE(`smrsh',`/usr/sbin/smrsh')dnl FEATURE(`mailertable')dnl FEATURE(`virtusertable')dnl FEATURE(`genericstable')dnl GENERICS_DOMAIN(`local.net0')dnl FEATURE(redirect)dnl FEATURE(always_add_domain)dnl FEATURE(use_cw_file)dnl FEATURE(use_ct_file)dnl FEATURE(local_procmail,`',`procmail -t -Y -a $h -d $u')dnl FEATURE(`access_db',`hash -T<TMPF> -o /etc/mail/access.db')dnl FEATURE(`blacklist_recipients')dnl FEATURE(`accept_unresolvable_domains')dnl LOCAL_DOMAIN(`localhost.localdomain')dnl MASQUERADE_AS(`newsguy.com')dnl FEATURE(masquerade_envelope)dnl MAILER(smtp)dnl MAILER(procmail)dnl
Am So, den 15.08.2004 schrieb Harry Putnam um 2:59:
One of these *mc files cures my bounce problem. The one with the Masquerading stuff in it.
sendmail2.mc
From another thread I've learned that masquerading doesn't work as I
thought it did but for years now I've been masquerading what ever machines I have at home as `newsguy.com'. I thought I'd learned a way of using the `genericstable' to do something similar and not need to masquerade.
Is newsguy.com your domain? I ask because of the central and important comment on masquerading from the cf/README:
"The masquerade name is not normally canonified, so it is important that it be your One True Name, that is, fully qualified and not a CNAME. However, if you use a CNAME, the receiving side may canonify it for you, so don't think you can cheat CNAME mapping this way." (http://www.sendmail.org/m4/masquerading_relaying.html)
My assumption was that the `Smart_host' at the other end of my sendmails outgoing activity required a resolvable host as source IP to avoid bouncing. I thought by setting some genericstable vars I could make it appear to be a resolvable host name.
It makes not much sense to offer a smart host which requires a resolvable FQDN. How should people at home with DSL, modem or ISDN connection mail throught their ISP's smart host? It is the task of the ISP's smart host to jump into this gap and offer such linked users the ability to use their own MTA without the risk that many if not most of the recipient MTAs reject mail coming from them, just because they have no resolvable FQDN.
Whether the contacting host announces himself with a resolvable FQDN at HELO/EHLO depends from settings of the real hostname, the domain name (if set in sendmail.mc) and from masquerading settings (if are defined). Genericstable does only rewrite the sender envelope address.
It is not an internet FQDN, just my own made up domain for my local lan. Therefore will never be resovable by dns lookups.
Important is that your bogus (internal) FQDN is internally resolvable. Using a
My attempt at using generics tables consisted of adding: (see sendmail2.mc below for the full settings)
FEATURE(`genericstable')dnl FEATURE(`generics_entire_domain')dnl
And to /etc/mail/genericstable: reader reader@newsguy.com
--> GENERICS_DOMAIN(`local.net0')dnl
belongs to the set, else the genericstable feature would not know for which domains to look for rewriting.
Building the hash and restarting sendmail.
Maybe my misunderstanding at this point and just to clear out: if you only change map files (the text files from which hashes/.db files are generated) you do not need to restart Sendmail. That is one sense of using these hash files. A Sendmail daemon restart is only necessary if you change the central configuration files ending with .cf (sendmail.cf and submit.cf) and after changes on pure text files like local-host-names, generics-domains or trusted-users.
With that in place I get these kind of errors: (wrapped for mail). They happen too quickly to be coming from the smart_host so its my sendmail process rejecting it.
From /var/log/messages
Aug 14 19:31:34 reader sendmail[12324]: i7F0VTsA012322: to=reader@jtan.com, ctladdr=reader@reader.local.net0 (500/500), delay=00:00:04, xdelay=00:00:04, mailer=relay, pri=120355, relay=smtp.newsguy.com. [129.250.170.69], dsn=5.6.0, stat=Data format error
Aug 14 19:33:05 reader sendmail[12353]: i7F0X40h012351: to=hpreader@sbcglobal.net, ctladdr=reader@reader.local.net0 (500/500), delay=00:00:01, xdelay=00:00:01, mailer=relay, pri=120369, relay=smtp.newsguy.com. [129.250.170.69], dsn=5.6.0, stat=Data format error
Please check what following prints out:
echo "$=M" | /usr/lib/sendmail -bt -d0
echo "$=G" | /usr/lib/sendmail -bt
=== /etc/hosts
# Do not remove the following line, or various programs # that require network functionality will fail. 127.0.0.1 localhost.localdomain localhost # =========================================================== 192.168.0.4 reader.local.net0 reader # fedcore3 t1 [...] stripped list of non-pertinent HOSTs
192.168.0.4 is the machine in question
The hosts file looks perfect.
===== sendmail1.mc
[ ... ]
FEATURE(`genericstable')dnl FEATURE(`generics_entire_domain')dnl GENERICS_DOMAIN(`local.net0')dnl
[ ... ]
=== sendmail2.mc
[ ... ]
FEATURE(`genericstable')dnl GENERICS_DOMAIN(`local.net0')dnl
[ ... ]
LOCAL_DOMAIN(`localhost.localdomain')dnl MASQUERADE_AS(`newsguy.com')dnl FEATURE(masquerade_envelope)dnl
[ ... ]
There is missing:
MASQUERADE_DOMAIN(`localhost')dnl MASQUERADE_DOMAIN(`localhost.localdomain')dnl MASQUERADE_DOMAIN(`reader.local.net0')dnl
Both commands from above for class{M} and class{G} have to show proper settings.
Alexander
On Sun, 2004-08-15 at 08:59, Harry Putnam wrote:
One of these *mc files cures my bounce problem. The one with the Masquerading stuff in it.
From another thread I've learned that masquerading doesn't work as I
thought it did but for years now I've been masquerading what ever machines I have at home as `newsguy.com'. I thought I'd learned a way of using the `genericstable' to do something similar and not need to masquerade.
What exactly does genericstable do? (Sorry, writing this mail off-line)
My assumption was that the `Smart_host' at the other end of my sendmails outgoing activity required a resolvable host as source IP to avoid bouncing. I thought by setting some genericstable vars I could make it appear to be a resolvable host name.
But it isn't right? newsguy.com isn't a valid Domain Name is it?? I'm not sure if your solution is a viable solution to my problem.
My Problem.
@work = mails must be sent out using the corp exhange server (smart host feature _must_ be implemented via sendmail.mc)
@home = mails are sent out w/o using smart host. Meaning, I have to actively re-compile sendmail.mc each time between office and home to send out emails. Cause @home, mails gets relayed directly to the receipient's MX.
It is not an internet FQDN, just my own made up domain for my local lan. Therefore will never be resovable by dns lookups.
Just as I thought. And what/how does this affect mail sending?
My attempt at using generics tables consisted of adding: (see sendmail2.mc below for the full settings)
FEATURE(`genericstable')dnl FEATURE(`generics_entire_domain')dnl
And to /etc/mail/genericstable: reader reader@newsguy.com
What does this achieve? I don't see a genericstable in my /etc/mail/ directory
Building the hash and restarting sendmail.
With that in place I get these kind of errors: (wrapped for mail). They happen too quickly to be coming from the smart_host so its my sendmail process rejecting it.
From /var/log/messages
Aug 14 19:31:34 reader sendmail[12324]: i7F0VTsA012322: to=reader@jtan.com, ctladdr=reader@reader.local.net0 (500/500), delay=00:00:04, xdelay=00:00:04, mailer=relay, pri=120355, relay=smtp.newsguy.com. [129.250.170.69], dsn=5.6.0, stat=Data format error
What's data format error? And I see that your relay is = smtp.newsguy.com, which resolves to your Inet Public IP.
For my case, it gets relayed to the localhost (127.0.0.1)'s smtp. which then hands it over to sendmail to contact the MX.
What I want to know is, is there a way to say that I want mails to be sent out 1st using the Direct approach, if it fails then fall back to the smart host.
Something like /etc/host.conf
user$ cat host.conf order hosts,bind
pseudo code : if [check if it's a local address ]; then pass to local sendmail elif [check if we can send direct to MX ] pass to sendmail for direct MX else # when all else fails pass to smart host for relay
Alexander Dalloz alexander.dalloz@uni-bielefeld.de writes:
[...]
Is newsguy.com your domain? I ask because of the central and important comment on masquerading from the cf/README:
No, as is explained further along, my `domain' is a home made one: local.net0
"The masquerade name is not normally canonified, so it is important that it be your One True Name, that is, fully qualified and not a CNAME. However, if you use a CNAME, the receiving side may canonify it for you, so don't think you can cheat CNAME mapping this way." (http://www.sendmail.org/m4/masquerading_relaying.html)
This confuses me to no end: First the README shows: `MASQUERADE_AS(`host.domain')' (It shows `host' where first part of domain name should be). As I understand it the naming convention is: host.domain.designator = reader.local.net0 Using my FQDN that would be `reader.net0' rather than `reader.local.com' So I've assumed it really wants `network.domain'.
If one uses ones `One True Name', in this case `1ocal.net0' (I guess it means the last part of my fqdn?) then it is not masquerading as something else. But the paragraph just proceeding the one you quoted says in part:
You can have your host masquerade as another using
MASQUERADE_AS(`host.domain')
This causes mail being sent to be labeled as coming from the indicated host.domain, rather than $j.
But `$j' is my fqdn (reader.local.net0). Clearly the intent is to parade as something you are not. So inserting `local.net0' there would not accomplish that goal it seems.
My assumption was that the `Smart_host' at the other end of my sendmails outgoing activity required a resolvable host as source IP to avoid bouncing. I thought by setting some genericstable vars I could make it appear to be a resolvable host name.
It makes not much sense to offer a smart host which requires a resolvable FQDN. How should people at home with DSL, modem or ISDN connection mail throught their ISP's smart host? It is the task of the ISP's smart host to jump into this gap and offer such linked users the ability to use their own MTA without the risk that many if not most of the recipient MTAs reject mail coming from them, just because they have no resolvable FQDN.
What you say does make sense, and shows a major flaw in my picture of what is happening and how it all works.
Whether the contacting host announces himself with a resolvable FQDN at HELO/EHLO depends from settings of the real hostname, the domain name (if set in sendmail.mc) and from masquerading settings (if are defined). Genericstable does only rewrite the sender envelope address.
Ok, that is more I didn't understand (about genericstable).
It is not an internet FQDN, just my own made up domain for my local lan. Therefore will never be resovable by dns lookups.
Important is that your bogus (internal) FQDN is internally resolvable. Using a
My attempt at using generics tables consisted of adding: (see sendmail2.mc below for the full settings)
FEATURE(`genericstable')dnl FEATURE(`generics_entire_domain')dnl
And to /etc/mail/genericstable: reader reader@newsguy.com
--> GENERICS_DOMAIN(`local.net0')dnl
belongs to the set, else the genericstable feature would not know for which domains to look for rewriting.
OK, I can see how that might help and have even tried it as I recall. You may notice it appears in the posted sendmail1.mc. IE the one that causes bounces.
Building the hash and restarting sendmail.
Maybe my misunderstanding at this point and just to clear out: if you only change map files (the text files from which hashes/.db files are generated) you do not need to restart Sendmail. That is one sense of using these hash files.
If you reread that you'll see I'm describing a chain of events: 1) edit *.mc and generate sendmail.cf 2) build genericstable 3) restart sendmail
It was point 1 that required the restart.
[...]
From /var/log/messages
[...]
Please check what following prints out:
echo "$=M" | /usr/lib/sendmail -bt -d0
Version 8.13.1 Compiled with: DNSMAP HESIOD HES_GETMAILHOST LDAPMAP LOG MAP_REGEX MATCHGECOS MILTER MIME7TO8 MIME8TO7 NAMED_BIND NETINET NETINET6 NETUNIX NEWDB NIS PIPELINING SASLv2 SCANF STARTTLS TCPWRAPPERS USERDB USE_LDAP_INIT
============ SYSTEM IDENTITY (after readcf) ============ (short domain name) $w = reader (canonical domain name) $j = reader.local.net0 (subdomain name) $m = local.net0 (node name) $k = reader.local.net0 ======================================================== ADDRESS TEST MODE (ruleset 3 NOT automatically invoked) Enter <ruleset> <address>
echo "$=G" | /usr/lib/sendmail -bt
# echo "$=G" | /usr/lib/sendmail -bt ADDRESS TEST MODE (ruleset 3 NOT automatically invoked) Enter <ruleset> <address>
local.net0
The hosts file looks perfect.
OK, I got something right...
===== sendmail1.mc
[ ... ]
FEATURE(`genericstable')dnl FEATURE(`generics_entire_domain')dnl GENERICS_DOMAIN(`local.net0')dnl
[ ... ]
=== sendmail2.mc
[ ... ]
FEATURE(`genericstable')dnl GENERICS_DOMAIN(`local.net0')dnl
[ ... ]
LOCAL_DOMAIN(`localhost.localdomain')dnl MASQUERADE_AS(`newsguy.com')dnl FEATURE(masquerade_envelope)dnl
[ ... ]
There is missing:
MASQUERADE_DOMAIN(`localhost')dnl MASQUERADE_DOMAIN(`localhost.localdomain')dnl MASQUERADE_DOMAIN(`reader.local.net0')dnl
Both commands from above for class{M} and class{G} have to show proper settings.
Maybe, but sendmail2.mc which contains only MASQUERADE_AS(`newsguy.com')dnl FEATURE(masquerade_envelope)dnl (concerning masquerading)
Is the one that works. The other (sendmail1.mc) does not.
So that leaves some questions. But first let me input some further information.
I've now noticed that I can put just about anything in that field MASQUERADE_AS(`whizbang.net')dnl is currently in sendmail.cf and it works ok. I'll send this message that way and there will be no bounce.
So I'm re-evaluating what that actually does. Its not doing what I thought at all but is still doing something. So removing all generics language I'll run a test with the following *.mc. Note it contains two masquerade entries: MASQUERADE_AS(`whizbang.net')# [HP 08/12/04 13:38 Not used since]dnl FEATURE(masquerade_envelope)# [HP 08/12/04 13:38 Not used since]dnl If I remove either one of them my mail bounces immediately.
Sorry to include another full *.mc but it seems the only way to avoid any misunderstanding or confusion about what is or is not present in it. So with all generics stuff removed with this *mc in place my mail goes thru, can you tell me what the masquerade stuff is doing that allows my mail to go thru, as you see it is set to `whizbang.net':
divert(-1)dnl include(`/usr/share/sendmail-cf/m4/cf.m4')dnl VERSIONID(`setup for Red Hat Linux')dnl OSTYPE(`linux')dnl define(`SMART_HOST',`smtp.newsguy.com') define(`confDEF_USER_ID',``8:12'')dnl define(`confTO_CONNECT', `1m')dnl define(`confTRY_NULL_MX_LIST',true)dnl define(`confDONT_PROBE_INTERFACES',true)dnl define(`PROCMAIL_MAILER_PATH',`/usr/bin/procmail')dnl define(`ALIAS_FILE', `/etc/aliases')dnl define(`STATUS_FILE', `/var/log/mail/statistics')dnl define(`confUSERDB_SPEC', `/etc/mail/userdb.db')dnl define(`confPRIVACY_FLAGS', `authwarnings,novrfy,noexpn,restrictqrun')dnl define(`confAUTH_OPTIONS', `A')dnl define(`confTO_IDENT', `0')dnl FEATURE(`no_default_msa',`dnl')dnl FEATURE(`smrsh',`/usr/sbin/smrsh')dnl FEATURE(`virtusertable')dnl FEATURE(redirect)dnl FEATURE(always_add_domain)dnl FEATURE(use_cw_file)dnl FEATURE(use_ct_file)dnl FEATURE(local_procmail,`',`procmail -t -Y -a $h -d $u')dnl FEATURE(`access_db',`hash -T<TMPF> -o /etc/mail/access.db')dnl FEATURE(`blacklist_recipients')dnl FEATURE(`accept_unresolvable_domains')dnl LOCAL_DOMAIN(`localhost.localdomain')dnl MASQUERADE_AS(`whizbang.net')# [HP 08/12/04 13:38 Not used since]dnl FEATURE(masquerade_envelope)# [HP 08/12/04 13:38 Not used since]dnl MAILER(smtp)dnl MAILER(procmail)dnl
Ow Mun Heng Ow.Mun.Heng@wdc.com writes:
[...]
From another thread I've learned that masquerading doesn't work as I
thought it did but for years now I've been masquerading what ever machines I have at home as `newsguy.com'. I thought I'd learned a way of using the `genericstable' to do something similar and not need to masquerade.
What exactly does genericstable do? (Sorry, writing this mail off-line)
Sorry Mun, I'm finding out I don't know either. I believe my usage is supposed to rewrite my outgoing mail From so that the real name of my host (reader.local.net0 as in reader@reader.local.net) is rewritten to be reader@newsguy.com and in fact it does do that. Further along you ask what the contents of my genericstable is supposed to do. ... well it is supposed to do what I lay out above and it does. The problem is I don't really understand what effect that has on how my mail is received on the internet.
sendmails outgoing activity required a resolvable host as source IP to avoid bouncing. I thought by setting some genericstable vars I could make it appear to be a resolvable host name.
But it isn't right? newsguy.com isn't a valid Domain Name is it??
Yes, its just not my domain name.
I'm not sure if your solution is a viable solution to my problem.
My Problem.
@work = mails must be sent out using the corp exhange server (smart host feature _must_ be implemented via sendmail.mc)
@home = mails are sent out w/o using smart host. Meaning, I have to actively re-compile sendmail.mc each time between office and home to send out emails. Cause @home, mails gets relayed directly to the receipient's MX.
I'm not sure either.. sorry. But I can think of a partial solution. There is really no need to actually recompile sendmail.cf each time. It would suffice to just hand edit the Smart_host entry (in /etc/sendmail.cf not sendmail.mc), and restart sendmail daemon.
This could be fairly easy to script and automate, but is really a poor solution in that it doesn't answer the underlaying problem.
It is not an internet FQDN, just my own made up domain for my local lan. Therefore will never be resovable by dns lookups.
Just as I thought. And what/how does this affect mail sending?
I thought I new but am finding out my assumptions were incorrect. I can only say for sure that by including two masquerading type entries in sendmail.mc my mail works. Otherwise it does not.
MASQUERADE_AS(`whizbang.net')dnl FEATURE(masquerade_envelope)dnl The idea that it needed to be set to `newsguy.com' I have found to be completely mistaken. It seems it can be set to anything. Even fantastic like above. But somehow this makes it work.
[...]
And to /etc/mail/genericstable: reader reader@newsguy.com
What does this achieve? I don't see a genericstable in my /etc/mail/ directory
It's supposed to achieve what I laid out earlier. genericstable isn't there by default it is user created.
What's data format error? And I see that your relay is = smtp.newsguy.com, which resolves to your Inet Public IP.
For my case, it gets relayed to the localhost (127.0.0.1)'s smtp. which then hands it over to sendmail to contact the MX.
The error I posted is from my local smtp process not newsguy. It just tells us that my relay is smtp.newsguy.com. That error can mean many things I think. I don't know what it means in this case. I've always thought it meant that newsguys smtp machine didn't like my From or sender address.
I suspect your problem could be solved with genericstable but I don't know how to do it ...sorry.
You'd probably do better by posting a description of your problem on comp.mail.sendmail newsgroup There are good answers there sometimes.
Ok Henry, let me start a new path through all the confusion (I think I did some mis-expressing meanwhile in both threads about this topic).
Both, masquerade and genericstable, have the same purpose: to rewrite the sender envelope mail address. Whether masquerading is preferable or genericstable depends on the specific situation. It is possible to mix both, from my own testing I see that a genericstable rewriting overrides masquerade settings.
1) masquerading You define the @FQDN rewrite address with MASQUERADE_AS(`FQDN') which will rewrite the mail from the host itself and all in class {M} to have a header address coming from there. To make sure the envelope address is properly set too, there is the FEATURE(masquerade_envelope) instruction. To not only masquerade the single mail host itself but all hosts inside the net, you can use FEATURE(masquerade_entire_domain). MASQUERADE_DOMAIN(foo) fill the class{M}. The masquerading (mail header and envelope) sender address rewriting takes place as long the sender address (@domain-part) previous to rewriting is something inside the class {M}. If the sender chooses an address in his mail client which is different from anything in class {M} no rewriting is done by masquerading. On the other hand, mail sending using mail or sendmail (without parameter -f) from the masq host itself or any masqueraded other will lead to address rewriting.
2) genericstable The FEATURE(genericstable) is a (hashed) map file with on the LHS (left hand side) has the user or address which shall be rewritten and on the RHS (right hand side) the address to which the LHS shall be converted. class {G} is empty by default and is filled by entries placed into the plain test file generics-domains. FEATURE(generics_entire_domain) is the parallel to FEATURE(masquerade_entire_domain). How it works: if mail is processed and the FEATURE(genericstable) is active, then the @domain-part is looked up in class {G} whether it is to be rewritten. If the @domain-part is part of class {G} then the genericstable map file is taken and searched for a matching LHS part. If none found nothing happens, if an entry found the address is rewritten with the content of the RHS.
3) When address rewriting is needed When you run your own Sendmail and you have no public resolvable FQDN for that mail host, assigned the FQDN to your IP address using an DNS record, you need address rewriting for those cases where the origin mail address will be the private, non resolvable domain address. Examples for this are notification mails sent out by cronjobs or "hand made" mail using the "mail" command. Mail clients setting the envelope sender address correctly, you do not need masquerading or genericstable rewriting. Using the smart host of your ISP or from any other service does not heal this situation. Though it is recommended to use such a smart host from dial-in homed connections because otherwise your Sendmail (fits for other MTAs as well) will directly deliver to the recipient's MTA, and meanwhile many of those do not accept incoming connections by dial-up IPs (because of need for anti SPAM fighting). The smart host does not rewrite the sender address, but it should reject attempts to relay, when he (the smart host) acknowledges a public non-existent domain part in the sender's mail address.
4) example setup Given your Sendmail host name is satyr.local.net0 and you send mail through it, either locally or from a host in the same private net (IP, name does not need to be the same) using your Sendmail for sending, and you do not use a mail client which sets a proper (proper because public existing and deliverable) mail address, then you need address rewriting either with masquerading or genericstable. Let us take the masquerading setup.
MASQUERADE_AS(`newsguy.com')dnl FEATURE(masquerade_envelope)dnl
This is what you did use. If newsguy.com is your controlled domain, it is not big problem, because you can create valid email addresses for that domain for each sender you use through your Sendmail. It is then a problem, if you for example have only 1 email address like hputnam@newsguy.com but no other. Why? Well, imagine the case mail is sent out by a root's cronjob. You know how it is rewritten? Yes, to root@newsguy.com. Where does a reply could go? Right, not to the sender. Same is valid for all other cases where the mail is not initiated by your local user with name hputnam.
In your last mail you wrote you used (at least tested with)
MASQUERADE_AS(`whizbang.net')
address rewriting and that it succeeded when sending through your ISP's smart host. It of course worked, rather than sending with an address of @satyr.local.net0, because whizbang.net is a public resolvable thus valid domain name (does not matter whether a mail server runs for it). So the smart host verifies it is existing and accepts it for relaying. Of course your mail sent out has now the sender address hputnam@whizbang.net what you hardly want. If you would use for the MASQUERADE_AS name `whozbang.net' your ISP's smart host would reject the relay attempt.
Address rewriting using genericstable would work similar in your case, you only have to respect the differences. Especially the differences may lead to the decision to give genericstable the preference over masquerading, because when using masquerading you won't get an error when sending with a non existing email address while rewriting to `newsguy.com' (not your domain as you said before) for example. With genericstable you have to define positive cases, where a rewriting has to take place. And in each case not rewrite target is found you or a script sending out with a non rewritten mail address will cause an error immediately.
I really hope my explanations do not cause a lot more confusion and questions :) But feel free to ask.
Alexander
Am So, den 15.08.2004 schrieb Ow Mun Heng um 12:19:
What exactly does genericstable do? (Sorry, writing this mail off-line)
Please read my explanations in the posting I just wrote for Harry.
My Problem.
@work = mails must be sent out using the corp exhange server (smart host feature _must_ be implemented via sendmail.mc)
@home = mails are sent out w/o using smart host. Meaning, I have to actively re-compile sendmail.mc each time between office and home to send out emails. Cause @home, mails gets relayed directly to the receipient's MX.
You use the same email address @wdc.com from work too at home? Can you use the business mail server as smart host as well from at home (SMTP AUTH)?
It is not an internet FQDN, just my own made up domain for my local lan. Therefore will never be resovable by dns lookups.
Just as I thought. And what/how does this affect mail sending?
It will lead to rejects by foreign MTAs. For SPAM fighting most MTAs meanwhile don't accept mail with 'faked' sender addresses.
My attempt at using generics tables consisted of adding: (see sendmail2.mc below for the full settings)
FEATURE(`genericstable')dnl FEATURE(`generics_entire_domain')dnl
And to /etc/mail/genericstable: reader reader@newsguy.com
What does this achieve? I don't see a genericstable in my /etc/mail/ directory
You have to create a genericstable your own, if you like to use that one. For each domain in class {G} - the generics-domains listing is missing here - the sender address on the left side in the genericstable map file is rewritten to what is to be found on the right hand side.
Aug 14 19:31:34 reader sendmail[12324]: i7F0VTsA012322: to=reader@jtan.com, ctladdr=reader@reader.local.net0 (500/500), delay=00:00:04, xdelay=00:00:04, mailer=relay, pri=120355, relay=smtp.newsguy.com. [129.250.170.69], dsn=5.6.0, stat=Data format error
What's data format error? And I see that your relay is = smtp.newsguy.com, which resolves to your Inet Public IP.
smtp.newsguy.com is Harry's ISP's smart host MTA.
For my case, it gets relayed to the localhost (127.0.0.1)'s smtp. which then hands it over to sendmail to contact the MX.
Yes, this is part of communication between Harry's Sendmail and the smart host.
What I want to know is, is there a way to say that I want mails to be sent out 1st using the Direct approach, if it fails then fall back to the smart host.
Something like /etc/host.conf
user$ cat host.conf order hosts,bind
pseudo code : if [check if it's a local address ]; then pass to local sendmail elif [check if we can send direct to MX ] pass to sendmail for direct MX else # when all else fails pass to smart host for relay
If I remember correctly there is no such fallback order. Do you use different mail addresses at work and at home? Then you could use smarttable. Else I would suggest not using the smart_host definition in the sendmail.mc file, but to use the mailertable instead. That makes switching a bit easier: you don't need to restart the Sendmail daemon because you don't change the sendmail.mc/.cf file but the mailtertable hashed map file: edit the mailertable file and run "make -C /etc/mail" and your change takes place immediately. See
http://www.sendmail.org/m4/mailertables.html
on how to set the entry for your smart host. To deactivate simply put a # in front of it to directly speak to the recipient MTAs.
Ow Mun Heng
Alexander
On Tue, 2004-08-17 at 03:03, Alexander Dalloz wrote:
Am So, den 15.08.2004 schrieb Ow Mun Heng um 12:19: My Problem.
@work = mails must be sent out using the corp exhange server (smart host feature _must_ be implemented via sendmail.mc)
@home = mails are sent out w/o using smart host. Meaning, I have to actively re-compile sendmail.mc each time between office and home to send out emails. Cause @home, mails gets relayed directly to the receipient's MX. What I want to know is, is there a way to say that I want mails to be sent out 1st using the Direct approach, if it fails then fall back to the smart host.
pseudo code : if [check if it's a local address ]; then pass to local sendmail elif [check if we can send direct to MX ] pass to sendmail for direct MX else # when all else fails pass to smart host for relay
If I remember correctly there is no such fallback order.
Actually I found out there IS!
Do you use different mail addresses at work and at home? Then you could use smarttable. Else I would suggest not using the smart_host definition in the sendmail.mc file, but to use the mailertable instead. That makes switching a bit easier: you don't need to restart the Sendmail daemon because you don't change the sendmail.mc/.cf file but the mailtertable hashed map file: edit the mailertable file and run "make -C /etc/mail" and your change takes place immediately. See
2 Months after going the manual method of doing the above pseudo code (implemented as per code below), which works by the way, just a bit manual. I found out that the pseudo code which I wanted actually exists. It's actually marked as /usr/share/sendmail-cf/README
confFALLBACK_MX FallbackMXhost [undefined] Fallback MX host.
Note the !!undefined!! Finally today, I came to know how it's used. As the name states, it's a Fallback mechanism in case things don't work out with the send direct to MX approach.
It Works. Doing an ethereal trace, I noted that it first tried to lookup the MX of the domain which mail is to be sent to, and then it tries to send it via that path, since mail can't go that path, due to errors, it will re-try, this time with the fallback MX Host. Mail then gets through.
==========MY Original Script - REdundant Now=============
#!/bin/sh # # This is to automatically change from using MX and to using # SMART HOST # # Sept 24 2004 # 4pm
#if [ id != 0 ]; then # echo "Got Root?" # exit 1 #fi
case "$1" in MX) echo "Altering Sendmail Config to use MX" mv /etc/mail/sendmail.mc /etc/mail/sendmail.mc.office mv /etc/mail/sendmail.mc.MX /etc/mail/sendmail.mc touch /etc/mail/sendmail.mc sleep 1 m4 /etc/mail/sendmail.mc > /etc/mail/sendmail.cf /etc/init.d/sendmail restart ;; office) echo "Altering Sendmail Config to use Smart Host" mv /etc/mail/sendmail.mc /etc/mail/sendmail.mc.MX mv /etc/mail/sendmail.mc.office /etc/mail/sendmail.mc touch /etc/mail/sendmail.mc sleep 1 m4 /etc/mail/sendmail.mc > /etc/mail/sendmail.cf /etc/init.d/sendmail restart ;; status) if [ "`cat /etc/mail/sendmail.cf | grep wdc | cut -d( -f1`" == "DSsmart-host.entry.com" ] ; then echo "Sendmail currently configured with SMART_HOST" else echo "Sendmail currently configured to use MX" fi ;; *) echo "Usage: $0 {MX | office | status}" ;; esac
exit 0