can't masquerade messages sent with mail command

This is a discussion on can't masquerade messages sent with mail command within the SendMail forums in Other Technologies category; I can't get any messages I send from command line using mail command to get sent out as anything other than local network domain name, which of course is nonsense to anyone else. Regular sending works fine through email programs. Have this problem as root or other user. Have tried masquerade and limited masquerade unsuccessfully...

Go Back   Application Development Forum > Other Technologies > SendMail

Object Mix

Register FAQ Calendar Search Today's Posts Mark Forums Read
  #1  
Old 08-20-2008, 11:58 AM
chris@bennettconstruction.biz
Guest
 
Default can't masquerade messages sent with mail command

I can't get any messages I send from command line using mail command
to get sent out as anything other than local network domain name,
which of course is nonsense to anyone else.
Regular sending works fine through email programs.

Have this problem as root or other user.
Have tried masquerade and limited masquerade unsuccessfully
Reply With Quote
  #2  
Old 08-21-2008, 12:04 AM
ynotssor
Guest
 
Default Re: can't masquerade messages sent with mail command

In news:a42fa7e5-9dc3-47ee-b2e7-e08cb1e4cca1@p25g2000hsf.googlegroups.com,
chris@bennettconstruction.biz <chris@bennettconstruction.biz> typed:

> I can't get any messages I send from command line using mail command
> to get sent out as anything other than local network domain name,
> which of course is nonsense to anyone else.
> Regular sending works fine through email programs.


"mail command" is an email program.

> Have this problem as root or other user.
> Have tried masquerade and limited masquerade unsuccessfully


You'll find help by posting the results of:

grep -v "^dnl" sendmail.mc

Masquerading errors are the result of a misconfiguration.


Reply With Quote
  #3  
Old 08-21-2008, 07:21 AM
chris@bennettconstruction.biz
Guest
 
Default Re: can't masquerade messages sent with mail command

I tried this to get perhaps better results. virtual domains are not
masqueraded, as I want.
But I get all messages sent from mail on command line sent as
user@b03s15le.corenetworks.net
All other email programs, including perl scripts and thunderbird work
fine.
I will also check mail in verbose mode to see what I get with that.

divert(-1)
#
# Default OpenBSD sendmail configuration for systems accepting mail
# from the internet.
#
# Note that lines beginning with "dnl" below are comments.

divert(0)dnl
VERSIONID(`@(#)openbsd-proto.mc $Revision: 1.11 $')dnl
OSTYPE(openbsd)dnl
define(`confPRIVACY_FLAGS',
`authwarnings,needmailhelo,noexpn,novrfy,nobodyret urn')dnl
define(`confCW_FILE', `-o MAIL_SETTINGS_DIR`'local-host-names')dnl
define(`confCT_FILE', `-o MAIL_SETTINGS_DIR`'trusted-users')dnl
FEATURE(nouucp, `reject')dnl
FEATURE(`access_db', `hash -o -T<TMPF> /etc/mail/access')dnl
FEATURE(`blacklist_recipients')dnl
FEATURE(`use_cw_file')dnl
FEATURE(`mailertable', `hash -o /etc/mail/mailertable')dnl
FEATURE(`use_ct_file')dnl
FEATURE(`virtusertable', `hash -o /etc/mail/virtusertable')dnl
FEATURE(genericstable, `hash -o /etc/mail/genericstable')dnl
FEATURE(always_add_domain)dnl
FEATURE(redirect)dnl
FEATURE(`no_default_msa')dnl
DAEMON_OPTIONS(`Family=inet, Address=0.0.0.0, Name=MTA')dnl
DAEMON_OPTIONS(`Family=inet6, Address=::, Name=MTA6, M=O')dnl
DAEMON_OPTIONS(`Family=inet, Address=0.0.0.0, Port=587, Name=MSA,
M=E')dnl
DAEMON_OPTIONS(`Family=inet6, Address=::, Port=587, Name=MSA6, M=O,
M=E')dnl
CLIENT_OPTIONS(`Family=inet, Address=0.0.0.0')dnl
CLIENT_OPTIONS(`Family=inet6, Address=::')dnl
define(`confBIND_OPTS', `WorkAroundBrokenAAAA')dnl
define(`CERT_DIR', `MAIL_SETTINGS_DIR`'certs')dnl
define(`confCACERT_PATH', `CERT_DIR')dnl
define(`confCACERT', `CERT_DIR/mycert.pem')dnl
define(`confSERVER_CERT', `CERT_DIR/mycert.pem')dnl
define(`confSERVER_KEY', `CERT_DIR/mykey.pem')dnl
define(`confCLIENT_CERT', `CERT_DIR/mycert.pem')dnl
define(`confCLIENT_KEY', `CERT_DIR/mykey.pem')dnl
MASQUERADE_AS(`bennettconstruction.us')dnl
MASQUERADE_DOMAIN(b03s15le.corenetworks.net bennettconstruction.us)
MASQUERADE_EXCEPTION(`bennettconstruction.us')dnl
MASQUERADE_EXCEPTION(`visionsbykarl.com')dnl
MASQUERADE_EXCEPTION(`ledgersmb.info')dnl
MASQUERADE_EXCEPTION(`edbennett.us')dnl
MASQUERADE_EXCEPTION(`san-isidro-farm.com')dnl
MASQUERADE_EXCEPTION(`bennettconstruction.biz')dnl
FEATURE(limited_masquerade)dnl
MAILER(local)dnl
MAILER(smtp)dnl
LOCAL_RULESETS
HMessage-Id: $>CheckMessageId

SCheckMessageId
R< $+ @ $+ > $@ OK
R$* $#error $: 553 Header Error

Previously I used this, but it masqueraded the virtual domains that I
didn't want masqueraded.
Didn't fix the problem using mail from command line, either

divert(-1)
#
# Default OpenBSD sendmail configuration for systems accepting mail
# from the internet.
#
# Note that lines beginning with "dnl" below are comments.

divert(0)dnl
VERSIONID(`@(#)openbsd-proto.mc $Revision: 1.11 $')dnl
OSTYPE(openbsd)dnl
define(`confPRIVACY_FLAGS',
`authwarnings,needmailhelo,noexpn,novrfy,nobodyret urn')dnl
define(`confCW_FILE', `-o MAIL_SETTINGS_DIR`'local-host-names')dnl
define(`confCT_FILE', `-o MAIL_SETTINGS_DIR`'trusted-users')dnl
FEATURE(nouucp, `reject')dnl
FEATURE(`access_db', `hash -o -T<TMPF> /etc/mail/access')dnl
FEATURE(`blacklist_recipients')dnl
FEATURE(`use_cw_file')dnl
FEATURE(`mailertable', `hash -o /etc/mail/mailertable')dnl
FEATURE(`use_ct_file')dnl
FEATURE(`virtusertable', `hash -o /etc/mail/virtusertable')dnl
FEATURE(genericstable, `hash -o /etc/mail/genericstable')dnl
FEATURE(always_add_domain)dnl
FEATURE(redirect)dnl
FEATURE(`no_default_msa')dnl
DAEMON_OPTIONS(`Family=inet, Address=0.0.0.0, Name=MTA')dnl
DAEMON_OPTIONS(`Family=inet6, Address=::, Name=MTA6, M=O')dnl
DAEMON_OPTIONS(`Family=inet, Address=0.0.0.0, Port=587, Name=MSA,
M=E')dnl
DAEMON_OPTIONS(`Family=inet6, Address=::, Port=587, Name=MSA6, M=O,
M=E')dnl
CLIENT_OPTIONS(`Family=inet, Address=0.0.0.0')dnl
CLIENT_OPTIONS(`Family=inet6, Address=::')dnl
define(`confBIND_OPTS', `WorkAroundBrokenAAAA')dnl
define(`CERT_DIR', `MAIL_SETTINGS_DIR`'certs')dnl
define(`confCACERT_PATH', `CERT_DIR')dnl
define(`confCACERT', `CERT_DIR/mycert.pem')dnl
define(`confSERVER_CERT', `CERT_DIR/mycert.pem')dnl
define(`confSERVER_KEY', `CERT_DIR/mykey.pem')dnl
define(`confCLIENT_CERT', `CERT_DIR/mycert.pem')dnl
define(`confCLIENT_KEY', `CERT_DIR/mykey.pem')dnl
MASQUERADE_AS(`bennettconstruction.us')dnl
MASQUERADE_DOMAIN(b03s15le.corenetworks.net bennettconstruction.us)
FEATURE(masquerade_entire_domain)dnl
MAILER(local)dnl
MAILER(smtp)dnl
LOCAL_RULESETS
HMessage-Id: $>CheckMessageId

SCheckMessageId
R< $+ @ $+ > $@ OK
R$* $#error $: 553 Header Error



ynotssor wrote:
> In news:a42fa7e5-9dc3-47ee-b2e7-e08cb1e4cca1@p25g2000hsf.googlegroups.com,
> chris@bennettconstruction.biz <chris@bennettconstruction.biz> typed:
>
> > I can't get any messages I send from command line using mail command
> > to get sent out as anything other than local network domain name,
> > which of course is nonsense to anyone else.
> > Regular sending works fine through email programs.

>
> "mail command" is an email program.
>
> > Have this problem as root or other user.
> > Have tried masquerade and limited masquerade unsuccessfully

>
> You'll find help by posting the results of:
>
> grep -v "^dnl" sendmail.mc
>
> Masquerading errors are the result of a misconfiguration.

Reply With Quote
  #4  
Old 08-21-2008, 07:28 AM
chris@bennettconstruction.biz
Guest
 
Default Re: can't masquerade messages sent with mail command

I got the following with mail -v:

# mail -vvv -s "goo" webmaster@bennettconstruction.us
afafas
..
EOT
webmaster@bennettconstruction.us... Connecting to [127.0.0.1] via
relay...
220 b03ls15le.corenetworks.net ESMTP Sendmail 8.14.1/8.14.1; Thu, 21
Aug 2008 06:22:29 -0500 (CDT)
>>> EHLO b03ls15le.corenetworks.net

250-b03ls15le.corenetworks.net Hello
IDENT:smmsp@localhost.corenetworks.net [127.0.0.1], pleased to meet
you
250-ENHANCEDSTATUSCODES
250-PIPELINING
250-8BITMIME
250-SIZE
250-DSN
250-ETRN
250-STARTTLS
250-DELIVERBY
250 HELP
>>> STARTTLS

220 2.0.0 Ready to start TLS
>>> EHLO b03ls15le.corenetworks.net

250-b03ls15le.corenetworks.net Hello
IDENT:smmsp@localhost.corenetworks.net [127.0.0.1], pleased to meet
you
250-ENHANCEDSTATUSCODES
250-PIPELINING
250-8BITMIME
250-SIZE
250-DSN
250-ETRN
250-DELIVERBY
250 HELP
>>> MAIL From:<root@b03ls15le.corenetworks.net> SIZE=58

250 2.1.0 <root@b03ls15le.corenetworks.net>... Sender ok
>>> RCPT To:<webmaster@bennettconstruction.us>
>>> DATA

250 2.1.5 <webmaster@bennettconstruction.us>... Recipient ok
354 Enter mail, end with "." on a line by itself
>>> .

250 2.0.0 m7LBMTWm025351 Message accepted for delivery
webmaster@bennettconstruction.us... Sent (m7LBMTWm025351 Message
accepted for delivery)
Closing connection to [127.0.0.1]
>>> QUIT

221 2.0.0 b03ls15le.corenetworks.net closing connection

Could I be trying to fix the wrong thing?
This shows MAIL From:<root@b03ls15le.corenetworks.net>,
which is possibly the real problem, since sendmail correctly
duplicates the from header in other cases.


ynotssor wrote:
> In news:a42fa7e5-9dc3-47ee-b2e7-e08cb1e4cca1@p25g2000hsf.googlegroups.com,
> chris@bennettconstruction.biz <chris@bennettconstruction.biz> typed:
>
> > I can't get any messages I send from command line using mail command
> > to get sent out as anything other than local network domain name,
> > which of course is nonsense to anyone else.
> > Regular sending works fine through email programs.

>
> "mail command" is an email program.
>
> > Have this problem as root or other user.
> > Have tried masquerade and limited masquerade unsuccessfully

>
> You'll find help by posting the results of:
>
> grep -v "^dnl" sendmail.mc
>
> Masquerading errors are the result of a misconfiguration.

Reply With Quote
  #5  
Old 08-21-2008, 08:29 AM
Ingo Freund
Guest
 
Default Re: can't masquerade messages sent with mail command

On 21.08.2008 13:28, chris@bennettconstruction.biz wrote (please find the answer below the original text):
> I got the following with mail -v:
>
> # mail -vvv -s "goo" webmaster@bennettconstruction.us
> afafas
> .
> EOT


try "mail -r <from_address>"

as already statet: "mail" is a client!

-Ingo.
Reply With Quote
  #6  
Old 08-23-2008, 06:34 AM
Per Hedeland
Guest
 
Default Re: can't masquerade messages sent with mail command

In article
<0d31a24f-2f33-4698-9bb3-56292fb87152@a70g2000hsh.googlegroups.com>
chris@bennettconstruction.biz writes:
>
>Could I be trying to fix the wrong thing?


Hard do say, since you haven't told us what is wrong in more specific
terms than "mail goes out as...".

>This shows MAIL From:<root@b03ls15le.corenetworks.net>,
>which is possibly the real problem, since sendmail correctly
>duplicates the from header in other cases.


That is the envelope sender address. If you want it masqueraded (it's
pretty "standard" if you masquerade at all), you need

FEATURE(`masquerade_envelope')

This will do nothing for the *header* sender address (what you see in
the From: *header* of the received message) though - that is the one
thing that is always masqueraded if masquerading is working at all.

--Per Hedeland
per@hedeland.org
Reply With Quote
  #7  
Old 08-24-2008, 10:14 AM
chris@bennettconstruction.biz
Guest
 
Default Re: can't masquerade messages sent with mail command

OpenBSD's version of mail doesn't offer any way of sending a From:
Header.

I did get an answer from another source that solves my problem.

Just to use sendmail directly and add a From: header myself.
This seems to work just fine for my limited needs to send mail from
command line.

I host 7 domains and their mail on this server.
Masquerade_entire_domain didn't work right for me
and limited masquerade (as above) seems to work fine but gives wrong
From: Header with Mail command.

Should I look into using masquerade envelope to solve this or would
that just cause problems like Masquerade_entire_domain did?

Per Hedeland wrote:
> In article
> <0d31a24f-2f33-4698-9bb3-56292fb87152@a70g2000hsh.googlegroups.com>
> chris@bennettconstruction.biz writes:
> >
> >Could I be trying to fix the wrong thing?

>
> Hard do say, since you haven't told us what is wrong in more specific
> terms than "mail goes out as...".
>
> >This shows MAIL From:<root@b03ls15le.corenetworks.net>,
> >which is possibly the real problem, since sendmail correctly
> >duplicates the from header in other cases.

>
> That is the envelope sender address. If you want it masqueraded (it's
> pretty "standard" if you masquerade at all), you need
>
> FEATURE(`masquerade_envelope')
>
> This will do nothing for the *header* sender address (what you see in
> the From: *header* of the received message) though - that is the one
> thing that is always masqueraded if masquerading is working at all.
>
> --Per Hedeland
> per@hedeland.org

Reply With Quote
  #8  
Old 08-26-2008, 04:45 PM
Per Hedeland
Guest
 
Default Re: can't masquerade messages sent with mail command

In article
<5a242bf5-f2f4-4f75-8be5-01e5b86c8ae8@d45g2000hsc.googlegroups.com>
chris@bennettconstruction.biz writes:
>
>I host 7 domains and their mail on this server.
>Masquerade_entire_domain didn't work right for me
>and limited masquerade (as above) seems to work fine but gives wrong
>From: Header with Mail command.


If the From: header isn't masqueraded, you haven't got masquerading
working at all. I didn't see any obvious reason for this in the .mc you
posted, and looking closer at the SMTP session transcript, I see that it
was only between the MSP and the MTA (at 127.0.0.1) - masquerading (if
any) is done by the MTA, so it wouldn't have been visible there anyway.

If you don't disallow VERB (e.g. via `goaway' in confPRIVACY_FLAGS), a
test like the one you did will also show the SMTP session between the
MTA and the remote server.

>Should I look into using masquerade envelope to solve this or would
>that just cause problems like Masquerade_entire_domain did?


Neither - masquerade_envelope does what I said it does, masquerades the
envelope sender in addition to the header sender. If you aren't getting
masquerading for the header sender, masquerade_envelope will not make a
difference.

--Per Hedeland
per@hedeland.org
Reply With Quote
Reply


Thread Tools
Display Modes


All times are GMT -5. The time now is 08:34 PM.


Powered by vBulletin® Version 3.7.2
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.2.0
vB Ad Management by =RedTyger=

In an effort to better serve ads to our visitors, cookies are used on objectmix.com. For more information, check out our Privacy Policy.