9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
* [9fans] A question on remotemail
@ 2008-07-08 15:00 Christian Kellermann
  2008-07-08 15:25 ` erik quanstrom
  2008-07-08 16:52 ` Russ Cox
  0 siblings, 2 replies; 9+ messages in thread
From: Christian Kellermann @ 2008-07-08 15:00 UTC (permalink / raw)
  To: Fans of the OS Plan 9 from Bell Labs

[-- Attachment #1: Type: text/plain, Size: 1070 bytes --]

Dear List,

I have been fiddling with the mail setup on my CPU server.

This machine has to deliver all mail to my ISPs smtp so I set the
rewrite script to rewrite.gateway. The ISPs smtp rejected my mail
though because it expected a From: line different to my $user@$site
or the default $fd set in remotemail. I added a 

'From: "ckeen" <Christian.Kellermann@nefkom.net>' 

line to /mail/box/ckeen/headers but this does not seem to have any
effect. I thus added a names.remote file with

'ckeen Christian.Kellermann@nefkom.net' 

and changed remotemail with this diff:

14c15,19
< exec /bin/upas/smtp -h $fd $addr $sender $*
---
> 
> remotename=`{/bin/upas/aliasmail $sender}
> if ( test -n $remotename ) { sender = $remotename }
> 
> exec /bin/upas/smtp -a  -h $fd $addr $sender $*

This does the work for me.

Questions:

- shouldn't the headers file work too?
- how is this done right?

Thanks for your opinions,

Christian

-- 
You may use my gpg key for replies:
pub  1024D/47F79788 2005/02/02 Christian Kellermann (C-Keen)

[-- Attachment #2: Type: application/pgp-signature, Size: 202 bytes --]

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [9fans] A question on remotemail
  2008-07-08 15:00 [9fans] A question on remotemail Christian Kellermann
@ 2008-07-08 15:25 ` erik quanstrom
  2008-07-08 15:56   ` Christian Kellermann
  2008-07-08 16:52 ` Russ Cox
  1 sibling, 1 reply; 9+ messages in thread
From: erik quanstrom @ 2008-07-08 15:25 UTC (permalink / raw)
  To: 9fans

> This machine has to deliver all mail to my ISPs smtp so I set the
> rewrite script to rewrite.gateway. The ISPs smtp rejected my mail
> though because it expected a From: line different to my $user@$site
> or the default $fd set in remotemail. I added a

is the problem that you require that the smtp helo domain be different
from the envelope sender (the $address in the smtp "mail from
$address" line?) is this why you can't set $fd to something that won't
be rejected and still have your From: lines properly rewritten?

> 'From: "ckeen" <Christian.Kellermann@nefkom.net>'
>
> line to /mail/box/ckeen/headers but this does not seem to have any
> effect. I thus added a names.remote file with
>
> 'ckeen Christian.Kellermann@nefkom.net'

according to the man page, the standard place for this information
would be a file listed in /mail/lib/fromfiles, and alias mail should
be given the -f switch.  (maybe there's a difference for gatways that
i'm missing?)

> - shouldn't the headers file work too?

the envelope sender isn't the same as the rfc822 sender so
no, i don't think that should work.

> - how is this done right?

- erik




^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [9fans] A question on remotemail
  2008-07-08 15:25 ` erik quanstrom
@ 2008-07-08 15:56   ` Christian Kellermann
  2008-07-08 16:05     ` erik quanstrom
  0 siblings, 1 reply; 9+ messages in thread
From: Christian Kellermann @ 2008-07-08 15:56 UTC (permalink / raw)
  To: Fans of the OS Plan 9 from Bell Labs

[-- Attachment #1: Type: text/plain, Size: 1614 bytes --]

* erik quanstrom <quanstro@quanstro.net> [080708 17:40]:
> > This machine has to deliver all mail to my ISPs smtp so I set the
> > rewrite script to rewrite.gateway. The ISPs smtp rejected my mail
> > though because it expected a From: line different to my $user@$site
> > or the default $fd set in remotemail. I added a 
> 
> is the problem that you require that the smtp helo domain be different
> from the envelope sender (the $address in the smtp "mail from
> $address" line?) is this why you can't set $fd to something that won't
> be rejected and still have your From: lines properly rewritten?
> 

As far as I understood $fd just sets the domain, I need the user
and the domain name to be different from my local settings though.


> > 'From: "ckeen" <Christian.Kellermann@nefkom.net>' 
> > 
> > line to /mail/box/ckeen/headers but this does not seem to have any
> > effect. I thus added a names.remote file with
> > 
> > 'ckeen Christian.Kellermann@nefkom.net'
> 
> according to the man page, the standard place for this information
> would be a file listed in /mail/lib/fromfiles, and alias mail should
> be given the -f switch.  (maybe there's a difference for gatways that
> i'm missing?)

I read the page as if the -f switch is for domain names only. Am I
wrong?

> 
> > - shouldn't the headers file work too?
> 
> the envelope sender isn't the same as the rfc822 sender so
> no, i don't think that should work.

right, thanks.

Kind regards,

Christian

-- 
You may use my gpg key for replies:
pub  1024D/47F79788 2005/02/02 Christian Kellermann (C-Keen)

[-- Attachment #2: Type: application/pgp-signature, Size: 202 bytes --]

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [9fans] A question on remotemail
  2008-07-08 15:56   ` Christian Kellermann
@ 2008-07-08 16:05     ` erik quanstrom
  2008-07-08 16:21       ` Christian Kellermann
  0 siblings, 1 reply; 9+ messages in thread
From: erik quanstrom @ 2008-07-08 16:05 UTC (permalink / raw)
  To: 9fans

> * erik quanstrom <quanstro@quanstro.net> [080708 17:40]:
>> > This machine has to deliver all mail to my ISPs smtp so I set the
>> > rewrite script to rewrite.gateway. The ISPs smtp rejected my mail
>> > though because it expected a From: line different to my $user@$site
>> > or the default $fd set in remotemail. I added a
>>
>> is the problem that you require that the smtp helo domain be different
>> from the envelope sender (the $address in the smtp "mail from
>> $address" line?) is this why you can't set $fd to something that won't
>> be rejected and still have your From: lines properly rewritten?
>>
>
> As far as I understood $fd just sets the domain, I need the user
> and the domain name to be different from my local settings though.

smtp goes to the trouble of transforming lines like

	From: erik quanstrom <quanstro>

to
	From: erik quanstrom <quanstro@example.com>

provided fd=example.com

- erik




^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [9fans] A question on remotemail
  2008-07-08 16:05     ` erik quanstrom
@ 2008-07-08 16:21       ` Christian Kellermann
  2008-07-08 16:32         ` Christian Kellermann
  0 siblings, 1 reply; 9+ messages in thread
From: Christian Kellermann @ 2008-07-08 16:21 UTC (permalink / raw)
  To: Fans of the OS Plan 9 from Bell Labs

[-- Attachment #1: Type: text/plain, Size: 702 bytes --]

* erik quanstrom <quanstro@quanstro.net> [080708 18:10]:
> > * erik quanstrom <quanstro@quanstro.net> [080708 17:40]:
> smtp goes to the trouble of transforming lines like
> 
> 	From: erik quanstrom <quanstro>
> 
> to
> 	From: erik quanstrom <quanstro@example.com>
> 
> provided fd=example.com

This is indeed nice.

I am not sure if it can applied to my case though:

Instead of having From: ckeen@bob.my.domain
I now get: ckeen@nefkom.net

Which is *almost* right... since upas/aliasmail -f rips off everything
but the domain.  Is there another way?

Thanks,

Christian

-- 
You may use my gpg key for replies:
pub  1024D/47F79788 2005/02/02 Christian Kellermann (C-Keen)

[-- Attachment #2: Type: application/pgp-signature, Size: 202 bytes --]

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [9fans] A question on remotemail
  2008-07-08 16:21       ` Christian Kellermann
@ 2008-07-08 16:32         ` Christian Kellermann
  2008-07-08 16:45           ` erik quanstrom
  0 siblings, 1 reply; 9+ messages in thread
From: Christian Kellermann @ 2008-07-08 16:32 UTC (permalink / raw)
  To: Fans of the OS Plan 9 from Bell Labs

[-- Attachment #1: Type: text/plain, Size: 452 bytes --]

* Christian Kellermann <Christian.Kellermann@nefkom.net> [080708 18:23]:
> * erik quanstrom <quanstro@quanstro.net> [080708 18:10]:
> > > * erik quanstrom <quanstro@quanstro.net> [080708 17:40]:
> 
> Instead of having From: ckeen@bob.my.domain
> I now get: ckeen@nefkom.net
> 

And I would need From: Christian.Kellermann@nefkom.net



-- 
You may use my gpg key for replies:
pub  1024D/47F79788 2005/02/02 Christian Kellermann (C-Keen)

[-- Attachment #2: Type: application/pgp-signature, Size: 202 bytes --]

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [9fans] A question on remotemail
  2008-07-08 16:32         ` Christian Kellermann
@ 2008-07-08 16:45           ` erik quanstrom
  0 siblings, 0 replies; 9+ messages in thread
From: erik quanstrom @ 2008-07-08 16:45 UTC (permalink / raw)
  To: 9fans

> * Christian Kellermann <Christian.Kellermann@nefkom.net> [080708 18:23]:
>> * erik quanstrom <quanstro@quanstro.net> [080708 18:10]:
>> > > * erik quanstrom <quanstro@quanstro.net> [080708 17:40]:
>>
>> Instead of having From: ckeen@bob.my.domain
>> I now get: ckeen@nefkom.net
>>
>
> And I would need From: Christian.Kellermann@nefkom.net

i think now your headers file will fix that problem.

but i'm getting a bit confused about your setup. ;-)

- erik




^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [9fans] A question on remotemail
  2008-07-08 15:00 [9fans] A question on remotemail Christian Kellermann
  2008-07-08 15:25 ` erik quanstrom
@ 2008-07-08 16:52 ` Russ Cox
  2008-07-08 18:28   ` Christian Kellermann
  1 sibling, 1 reply; 9+ messages in thread
From: Russ Cox @ 2008-07-08 16:52 UTC (permalink / raw)
  To: 9fans

There are two different "From" addresses associated
with a particular mail message.  There is the RFC822
"From:" line and then there is the "MAIL FROM" return
address that is sent as part of the SMTP conversation.
(This is the address recorded in the "From " line at the
top of the Plan 9 mbox-format messages.  See thread
last month.)

The two are not always the same.  For example, this message
says it is From: <rsc@swtch.com>, but the SMTP return
address is something like 9fans+bounces+23450qc@9fans.net,
so that if a bounce comes back, it goes to the mailing list
software, which uses the last bit to determine which address
on the list is bouncing.

I would be a little surprised if your ISP is rejecting
based on the From: line rather than the SMTP return address,
but maybe spammers have driven them to that.
The /mail/box/$user/headers file sets RFC822 headers,
including the From: header.  The upas/smtp arguments set
the SMTP return address.

As for how to do it "right", editing remotemail sounds fine.
The nice thing about upas is you can understand the shell
scripts and edit them, instead of having to shoehorn
everything into some preordained config file.

Russ



^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [9fans] A question on remotemail
  2008-07-08 16:52 ` Russ Cox
@ 2008-07-08 18:28   ` Christian Kellermann
  0 siblings, 0 replies; 9+ messages in thread
From: Christian Kellermann @ 2008-07-08 18:28 UTC (permalink / raw)
  To: Fans of the OS Plan 9 from Bell Labs

[-- Attachment #1: Type: text/plain, Size: 605 bytes --]

* Russ Cox <rsc@swtch.com> [080708 18:56]:
> 
> As for how to do it "right", editing remotemail sounds fine.
> The nice thing about upas is you can understand the shell
> scripts and edit them, instead of having to shoehorn
> everything into some preordained config file.

Thanks for clarifying that Russ. It all makes sense to me now. I
will leave my remotemail script as it is and be happy :)

Thanks to erik for making me rething the behaviour of the scripts.

Regards,

Christian

-- 
You may use my gpg key for replies:
pub  1024D/47F79788 2005/02/02 Christian Kellermann (C-Keen)

[-- Attachment #2: Type: application/pgp-signature, Size: 202 bytes --]

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2008-07-08 18:28 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-07-08 15:00 [9fans] A question on remotemail Christian Kellermann
2008-07-08 15:25 ` erik quanstrom
2008-07-08 15:56   ` Christian Kellermann
2008-07-08 16:05     ` erik quanstrom
2008-07-08 16:21       ` Christian Kellermann
2008-07-08 16:32         ` Christian Kellermann
2008-07-08 16:45           ` erik quanstrom
2008-07-08 16:52 ` Russ Cox
2008-07-08 18:28   ` Christian Kellermann

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).