Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Smart Host according to `From:' line

118 views
Skip to first unread message

Harry Putnam

unread,
Jan 2, 2012, 7:56:08 AM1/2/12
to
Setup: Single user linux machine running sendmail-8.14.4

Summary:

Using a Smart Host with SMTP authentication, I find that any mail I
send out, regardless of who it is from will have the From line
rewritten by the host set as smart host in sendmail.mc with:

define(`SMART_HOST',`smtp.example.com')dnl

And with something like this in /etc/mail/authinfo

Authinfo:smtp.example.com "U:root" "I:ha...@example.com" "P:??XX??" "M: LOGIN PLAIN"

------- --------- ---=--- --------- --------

Details:

Like many folks, I have more than 1 email address and from more than 1
domain. So I might send a message with the from line:

From: ha...@example.com

or

From: ha...@NOTexample.com

But regardless of which I use, the smart host, and I guess not
surprisingly, will rewrite that from line using the username in the
authinfo credentials and its own domain.

I'd like to make sendmail pick the smart host to send mail to, by
examining the `From: ' line in outgoing mail.

Googling around I found something written by A. Filip in 1999, but not
the original message. Apparently that original message is no longer
available. However the main points were reposted by A Filip in this
thread:

http://groups.google.com/group/comp.os.linux.setup/browse_thread/thread/6dd01d889fccfd50/31fb588a9c55fc4d%2331fb588a9c55fc4d

I wondered if that technique is still valid in recent versions of
sendmail but also, that technique talks about using the `envelope
sender' address to determine `Smart Host' which might not be the same
as the `From: ' line.

I wondered if anyone can give me a URL or some coaching toward making
sendmail use specific Smart Host according to domain used in the
outgoing `From: ' line

Joe Zeff

unread,
Jan 2, 2012, 7:30:01 PM1/2/12
to
On Mon, 02 Jan 2012 07:56:08 -0500, Harry Putnam wrote:

> Authinfo:smtp.example.com "U:root" "I:ha...@example.com" "P:??XX??" "M:
> LOGIN PLAIN"

I use the smtp server at my hosting company as a smarthost, even for
email addresses at domains they don't host. The equivalent line in my
authinfo looks like this:

AuthInfo:smtp.example.com "U:m...@example.com" "I:m...@example.com"
"P:PASSWORD" "M:PLAIN"

Note the differences. In my case, the email goes out with whatever
address I want in the From line. I don't know if this is what's causing
it or if it's something at your hosting company, and thus out of your
direct control. Try changing your authinfo to match mine and see if it
helps; if not, talk to the tech support at whatever company runs your
smarthost.

--
Joe Zeff -- The Guy With The Sideburns:
http://www.zeff.us http://www.lasfs.info
Think of it as evolution in action.

Harry Putnam

unread,
Jan 3, 2012, 1:26:00 PM1/3/12
to
Joe Zeff <the.guy.with....@lasfs.info> writes:

> On Mon, 02 Jan 2012 07:56:08 -0500, Harry Putnam wrote:
>
>> Authinfo:smtp.example.com "U:root" "I:ha...@example.com" "P:??XX??" "M:
>> LOGIN PLAIN"
>
> I use the smtp server at my hosting company as a smarthost, even for
> email addresses at domains they don't host. The equivalent line in my
> authinfo looks like this:
>
> AuthInfo:smtp.example.com "U:m...@example.com" "I:m...@example.com"
> "P:PASSWORD" "M:PLAIN"
>
> Note the differences. In my case, the email goes out with whatever
> address I want in the From line. I don't know if this is what's causing
> it or if it's something at your hosting company, and thus out of your
> direct control. Try changing your authinfo to match mine and see if it
> helps; if not, talk to the tech support at whatever company runs your
> smarthost.

I'm not sure what has changed... nothing that I have done, but today
it just works... in the same way you describe. My authinfo still
looks just like you quoted it at the top.

For two days leading up to that post, it worked the way I described.
Apparently something changed at the server I guess. Anyway... now it
works.

Do you know what the `U' and `I' really stand for? The actual names
of those fields?

Andrzej Adam Filip

unread,
Jan 11, 2012, 8:21:29 AM1/11/12
to
On 01/02/2012 01:56 PM, Harry Putnam wrote:
> [...]
> Googling around I found something written by A. Filip in 1999, but not
> the original message. Apparently that original message is no longer
> available. However the main points were reposted by A Filip in this
> thread:
>
> http://groups.google.com/group/comp.os.linux.setup/browse_thread/thread/6dd01d889fccfd50/31fb588a9c55fc4d%2331fb588a9c55fc4d
>
> I wondered if that technique is still valid in recent versions of
> sendmail but also, that technique talks about using the `envelope
> sender' address to determine `Smart Host' which might not be the same
> as the `From: ' line.
>[...]

The most current version of envelope sender based routing:
http://anfi.homeunix.org/sendmail/smarttab.html

AFAIR it worked with the latest sendmail in Debian-testing (Wheezy) in
December 2011 - I used it on my personal comp for routing my personal
messages.

P.S.
Could you be more specific about WHY do you need it?
e.g. IMHO Routing based on SMTP AUTH presented to local mail server may
be an option in many cases.

Harry Putnam

unread,
Jan 14, 2012, 2:00:27 PM1/14/12
to
Andrzej Adam Filip <an...@onet.eu> writes:

> The most current version of envelope sender based routing:
> http://anfi.homeunix.org/sendmail/smarttab.html
>
> AFAIR it worked with the latest sendmail in Debian-testing (Wheezy) in
> December 2011 - I used it on my personal comp for routing my personal
> messages.
>
> P.S.
> Could you be more specific about WHY do you need it?
> e.g. IMHO Routing based on SMTP AUTH presented to local mail server
> may be an option in many cases.

Thanks a lot for the URL...

The problem I was having seemed to have cured itself when the next day
with no changes in sendmail.mc, it all started working without any
problems.

What led me to delve into it was that a new smtp server seemed to
accept mail from me if the from line matched the outgoing smtp server
but rejected if that were not the case.

Mail I send has various from lines depending on which persona or Hat
I'm wearing.

The addresses in question were all ones I have at various domains so I
thought I'd try matching the server I was sending them to, to the
address in the From line, which would be a specific persona.

The next day the whole problem disappeared, and no matter what
persona, the mail just got sent.. (as it should).

Andrzej Adam Filip

unread,
Jan 15, 2012, 4:51:00 AM1/15/12
to
Joe Zeff <the.guy.with....@lasfs.info> wrote:
> On Mon, 02 Jan 2012 07:56:08 -0500, Harry Putnam wrote:
>
>> Authinfo:smtp.example.com "U:root" "I:ha...@example.com" "P:??XX??" "M:
>> LOGIN PLAIN"
>
> I use the smtp server at my hosting company as a smarthost, even for
> email addresses at domains they don't host. [...]

IMHO Such configuration by hosting company is a Bad Idea (TM)
in most cases [ allowing exceptions for some sender domains after
request may be an exception].

Andrzej Adam Filip

unread,
Jan 15, 2012, 4:55:31 AM1/15/12
to
IMHO Most likely you were affected by (initial?) tests of new
configuration of the smart host.

If you talk about "single user" computer then (IMHO) you should consider
sending via "per account smart host" anyway. You may treat it as low
priority configuration upgrade.

Harry Putnam

unread,
Jan 16, 2012, 8:07:50 PM1/16/12
to
It is a single user setup.

I'm a bit dense and did not really understand your comment. Are you
saying I should use a different `smart host' depending on which domain I
have in the from line?

If that is right, how might I do that, and why is it a good thing to do?

Andrzej Adam Filip

unread,
Jan 17, 2012, 4:48:17 AM1/17/12
to
I use a few (external) email accounts.
I have sent my messages with an...@example.net sender via smtp.example.net
and an...@example.org sender via smtp.example.org, both with SMTP AUTH.

IMHO such approach (usually) lowers a little risk of messages being
singled out by antispam filters.
Using email *clients* capable to handle it instead of tweaking sendmail
config is simpler anyway IMHO.

P.S. I ended personal use of such *sendmail* configuration in
December 2011 after "unscheduled migration".

Harry Putnam

unread,
Jan 18, 2012, 2:49:23 PM1/18/12
to
Andrzej Adam Filip <an...@onet.eu> writes:

> Harry Putnam <rea...@newsguy.com> wrote:
>> Andrzej Adam Filip <an...@onet.eu> writes:
>>
>>> If you talk about "single user" computer then (IMHO) you should consider
>>> sending via "per account smart host" anyway. You may treat it as low
>>> priority configuration upgrade.
>>
>> It is a single user setup.
>>
>> I'm a bit dense and did not really understand your comment. Are you
>> saying I should use a different `smart host' depending on which domain I
>> have in the from line?
>>
>> If that is right, how might I do that, and why is it a good thing to do?
>
> I use a few (external) email accounts.
> I have sent my messages with an...@example.net sender via smtp.example.net
> and an...@example.org sender via smtp.example.org, both with SMTP AUTH.
>
> IMHO such approach (usually) lowers a little risk of messages being
> singled out by antispam filters.
> Using email *clients* capable to handle it instead of tweaking sendmail
> config is simpler anyway IMHO.

Apparently I'm much denser than I realized...
Can you be specific here? Which `clients' are we talking about and
when you say `handle it', I wonder .. `handle' what?

My client is absolutely configurable. I use emacs/gnus that can be
made to do just about anything involving mail. I may not know how to
make it so, but someone will.

Are you talking about configuring more than one outgoing server? Then
using some kind of persona or identity trickery to send according to
the persona you currently use.. If so, can you be specific?

I don't mean exact addresses, but actual configuration details that
are required.

> P.S. I ended personal use of such *sendmail* configuration in
> December 2011 after "unscheduled migration".

This zipped right over my head as well, apparently you are using
some kind of coded words that I am supposed to know.. but I don't.

Andrzej Adam Filip

unread,
Jan 18, 2012, 3:44:19 PM1/18/12
to
> [...]

As I understand you can configure it in emacs/gnus:
http://www.emacswiki.org/emacs/CategoryGnus
http://www.emacswiki.org/emacs/MultipleSMTPAccounts
managing multiple SMTP accounts

P.S.
I had made gnus use "/usr/sbin/sendmail -c /home/anfi/.mail/sendmail.cf"
but *for me* configuring sendmail had been easier than configuring gnus :-)

I had also used dovecot IMAP with email held in ~/Maildir to be capable
to use a few different email clients (gnus, thunderbid(icedove),
evolution, kmail, ...). Email had been fetched by fetchmail and sorted
by dovecot's sieve script [gnus can play with sieve scripts],

Harry Putnam

unread,
Jan 29, 2012, 12:49:50 AM1/29/12
to
Andrzej Adam Filip <an...@onet.eu> writes:

>> Are you talking about configuring more than one outgoing server? Then
>> using some kind of persona or identity trickery to send according to
>> the persona you currently use.. If so, can you be specific?
>> [...]
>
> As I understand you can configure it in emacs/gnus:
> http://www.emacswiki.org/emacs/CategoryGnus
> http://www.emacswiki.org/emacs/MultipleSMTPAccounts
> managing multiple SMTP accounts

Thanks for the details and helpful tips.

> P.S.
> I had made gnus use "/usr/sbin/sendmail -c /home/anfi/.mail/sendmail.cf"
> but *for me* configuring sendmail had been easier than configuring gnus :-)

Hehe, yes there is that.
0 new messages