Re: On mail principles

2006-06-09 Thread Giorgos Keramidas
On 2006-06-08 23:15, Andrey Slusar [EMAIL PROTECTED] wrote:
Thu, 8 Jun 2006 02:08:53 +0300, Giorgos Keramidas wrote:
[...]
 I use mutt, which has an option to set the envelope-from address:

 set envelope_from=yes# set the envelope-from address from From:

 For the rest of the programs, like mail(1), my Sendmail setup sets
 envelope-from to one of my valid outside-world addresses.  This is
 accomplished with the following in my `sendmail.mc' file:

 You need write the howto sendmail for newbies :)

Thanks.  I keep saying to myself that we need task-based guides in our
Handbook, separated by user-type (i.e. Sendmail for FreeBSD Users,
Sendmail for FreeBSD Administrators, etc.)

Right now, I don't have the time to do something like this, but summer
and vacations is a good period for a bit of this sort of work :)


___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: On mail principles

2006-06-09 Thread Andrey Slusar
Thu, 8 Jun 2006 02:08:53 +0300, Giorgos Keramidas wrote:

 For the rest of the programs, like mail(1), my Sendmail setup sets
 envelope-from to one of my valid outside-world addresses.  This is
 accomplished with the following in my `sendmail.mc' file:

 dnl Trusted users, who are allowed to change their envelope-from address
 dnl without generating a warning in the message header, are listed, one 
 per
 dnl line, in `sendmail.ct'.
 define(`confCT_FILE', `-o /etc/mail/sendmail.ct')
 FEATURE(`use_cw_file')dnl
   ^^^
  Small mistake - FEATURE(`use_ct_file')dnl.

-- 
Regards,
Andrey.
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: On mail principles

2006-06-09 Thread Giorgos Keramidas
On 2006-06-09 16:37, Andrey Slusar [EMAIL PROTECTED] wrote:
 Thu, 8 Jun 2006 02:08:53 +0300, Giorgos Keramidas wrote:
 
  For the rest of the programs, like mail(1), my Sendmail setup sets
  envelope-from to one of my valid outside-world addresses.  This is
  accomplished with the following in my `sendmail.mc' file:
 
  dnl Trusted users, who are allowed to change their envelope-from address
  dnl without generating a warning in the message header, are listed, one 
  per
  dnl line, in `sendmail.ct'.
  define(`confCT_FILE', `-o /etc/mail/sendmail.ct')
  FEATURE(`use_cw_file')dnl
^^^
 Small mistake - FEATURE(`use_ct_file')dnl.

Ah, thanks!  I knew I would do something stupid by copy-pasting only
the relevant bits from my real *.mc file :)

___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: On mail principles

2006-06-08 Thread a
On Thu, Jun 08, 2006 at 02:08:53AM +0300, Giorgos Keramidas wrote:
 On 2006-06-07 20:20, [EMAIL PROTECTED] wrote:
  A brief:
 
  How to use envelope from provided that I have a mailbox on ISP.
 
  A full explanation:
 
  My computer has no static IP-address, nor DNS-name in Internet.
  Internally, it has static name localhost and static IP-address 127.0.0.1.
 
  So, I have a mail address [EMAIL PROTECTED].
  But I cannot send a mail to the world using this address in envelope from
  because of
  1) Internet MTAs cancel mail whith such an address in envelope from;
  2) such an address is useless to recipient.
 
  My address in the world is [EMAIL PROTECTED].  So, I make my MUA to send a
  letter using a command setting envelope from to [EMAIL PROTECTED].  
  (like
  sendmail -f [EMAIL PROTECTED] for sendmail, see X-Authentication-Warning 
  in
  the header of this mail) But this way is bad for local purposes: my
  MTA's diagnostic messages are sent trough internet or lost at all,
  e. g. when my ADSL is in down.  (Moreover, my letters sent to other
  local users have non-local envelope from address. Then local mail
  begin to go through external MTA.)
 
  What to do in such a situation?
 
 I use mutt, which has an option to set the envelope-from address:
 
 set envelope_from=yes# set the envelope-from address from From:
 
 For the rest of the programs, like mail(1), my Sendmail setup sets
 envelope-from to one of my valid outside-world addresses.  This is
 accomplished with the following in my `sendmail.mc' file:
 
 dnl Trusted users, who are allowed to change their envelope-from address
 dnl without generating a warning in the message header, are listed, one 
 per
 dnl line, in `sendmail.ct'.
 define(`confCT_FILE', `-o /etc/mail/sendmail.ct')
 FEATURE(`use_cw_file')dnl
 
 dnl Allow mail routing exceptions through a mailer table.
 FEATURE(`mailertable', `hash /etc/mail/mailertable')
 
 dnl Address masquerading.
 dnl
 dnl Making sure that all email that passes through my desktop's Sendmail
 dnl installation is masqueraded as coming from `gothmog.pc', even if its 
 original
 dnl address is something slightly different (i.e. `ftp.pc' or `mail.pc'), 
 is
 dnl ok here.  It ensures that address rewriting and translation through
 dnl `genericstable' will also work for all `*.pc' host names.
 dnl
 dnl To make sure that remote hosts don't get a MAIL FROM address from a
 dnl hostname that doesn't resolve, envelope addresses are masqueraded 
 too, and
 dnl then get rewritten by `genericstable' to real-world addresses,
 dnl i.e. [EMAIL PROTECTED]'.
 MASQUERADE_AS(`gothmog.pc')
 FEATURE(`masquerade_entire_domain')
 FEATURE(`masquerade_envelope')
 
 dnl Rewriting the envelope-from address of all outgoing messages through a
 dnl `genericstable' lookup, ensures that envelope-from addresses seen by 
 relay
 dnl hosts are real, i.e. [EMAIL PROTECTED]' instead of the default
 dnl envelope-from of [EMAIL PROTECTED]' that Sendmail would use.  This is
 dnl required some times, to avoid getting bounces for messages from ISP 
 mail
 dnl relays that are misconfigured or are too strict about what can appear 
 in a
 dnl MAIL FROM command.
 FEATURE(`genericstable', `hash -o /etc/mail/genericstable')
 GENERICS_DOMAIN(`gothmog.pc')
 FEATURE(`generics_entire_domain')
 
 This looks like quite a mouthful of options, but it's not really that
 difficult to read.  It's only big because of all the comments.
 
 The file `/etc/mail/sendmail.ct' contains my username, because I trust
 myself to use valid envelope-from addresses.  This turns off the
 X-Authentication-Warning header which is so annoying for you too.
 
 Then, in `/etc/mail/mailertable' I have an exception for my internal,
 work-related email, and send it directly to the company's mail gateway:
 
 # Custom mail routing rules.  This is currently useful only
 # for routing work-related email through the VPN connection
 # to my company's mail relay.
 #
 foo.com   smtp:mailgate.foo.com
 .foo.com  smtp:mailgate.foo.com
 
 Finally, in my `/etc/mail/genericstable' map, I rewrite the
 envelope-from of all the rest of email messages, like this:
 
 # Outgoing email address rewriting.
 [EMAIL PROTECTED] [EMAIL PROTECTED]
 [EMAIL PROTECTED] [EMAIL PROTECTED]
 [EMAIL PROTECTED] [EMAIL PROTECTED]
 
 These options are, of course, just a suggestion.  You don't *HAVE* to
 use a setup similar to mine.
 
 - Giorgos
 
This is exactly what I want.
Thank you.

Elisej Babenko
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: On mail principles

2006-06-08 Thread a
On Wed, Jun 07, 2006 at 05:43:23PM -0400, Charles Swiger wrote:
 On Jun 7, 2006, at 1:20 PM, [EMAIL PROTECTED] wrote:
 But this way is bad for local purposes: my MTA's diagnostic messages are sent
 trough internet or lost at all, e. g. when my ADSL is in down.
 (Moreover, my letters sent to other local users have non-local envelope 
 from
 address. Then local mail begin to go through external MTA.)
 
 What to do in such a situation?
 
 See the sendmail documentation [1] on MASQUERADE_AS().
 
 --
 -Chuck
 
 [1]: /usr/share/sendmail/cf/README, or check the FAQ from www.sendmail.org...

That is not a proper feature because of different local users can use world 
mail addresses with different hostnames. But masquerading is good only for 
one domain.
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: On mail principles

2006-06-08 Thread Giorgos Keramidas
On 2006-06-08 08:05, [EMAIL PROTECTED] wrote:
On Thu, Jun 08, 2006 at 02:08:53AM +0300, Giorgos Keramidas wrote:
 On 2006-06-07 20:20, [EMAIL PROTECTED] wrote:
  A brief:
  How to use envelope from provided that I have a mailbox on ISP.
  [...]

 [description of a masquerading+genericstable Sendmail setup]

 This is exactly what I want.
 Thank you.

Cool!  If you need more help setting things up, let us know :)

___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: On mail principles

2006-06-08 Thread Alex Zbyslaw

[EMAIL PROTECTED] wrote:


On Wed, Jun 07, 2006 at 05:43:23PM -0400, Charles Swiger wrote:
 


On Jun 7, 2006, at 1:20 PM, [EMAIL PROTECTED] wrote:
   


But this way is bad for local purposes: my MTA's diagnostic messages are sent
trough internet or lost at all, e. g. when my ADSL is in down.
(Moreover, my letters sent to other local users have non-local envelope from
address. Then local mail begin to go through external MTA.)

What to do in such a situation?
 


See the sendmail documentation [1] on MASQUERADE_AS().

--
-Chuck

[1]: /usr/share/sendmail/cf/README, or check the FAQ from www.sendmail.org...
   



That is not a proper feature because of different local users can use world 
mail addresses with different hostnames. But masquerading is good only for 
one domain.
 

I believe newer postfixes have support for masquerading different 
local users with different external addresses when sending mail 
externally.  Haven't tried it: just noted the feature in some email 
somewhere for future evaluation, so take with the usual pinch of salt.


--Alex


___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: On mail principles

2006-06-08 Thread Andrey Slusar
Thu, 8 Jun 2006 02:08:53 +0300, Giorgos Keramidas wrote:
[...]
 I use mutt, which has an option to set the envelope-from address:

 set envelope_from=yes# set the envelope-from address from From:

 For the rest of the programs, like mail(1), my Sendmail setup sets
 envelope-from to one of my valid outside-world addresses.  This is
 accomplished with the following in my `sendmail.mc' file:

 You need write the howto sendmail for newbies :)

-- 
Regards,
Andrey.
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: On mail principles

2006-06-07 Thread Charles Swiger

On Jun 7, 2006, at 1:20 PM, [EMAIL PROTECTED] wrote:
But this way is bad for local purposes: my MTA's diagnostic  
messages are sent

trough internet or lost at all, e. g. when my ADSL is in down.
(Moreover, my letters sent to other local users have non-local  
envelope from

address. Then local mail begin to go through external MTA.)

What to do in such a situation?


See the sendmail documentation [1] on MASQUERADE_AS().

--
-Chuck

[1]: /usr/share/sendmail/cf/README, or check the FAQ from  
www.sendmail.org...


___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: On mail principles

2006-06-07 Thread Giorgos Keramidas
On 2006-06-07 20:20, [EMAIL PROTECTED] wrote:
 A brief:

 How to use envelope from provided that I have a mailbox on ISP.

 A full explanation:

 My computer has no static IP-address, nor DNS-name in Internet.
 Internally, it has static name localhost and static IP-address 127.0.0.1.

 So, I have a mail address [EMAIL PROTECTED].
 But I cannot send a mail to the world using this address in envelope from
 because of
 1) Internet MTAs cancel mail whith such an address in envelope from;
 2) such an address is useless to recipient.

 My address in the world is [EMAIL PROTECTED].  So, I make my MUA to send a
 letter using a command setting envelope from to [EMAIL PROTECTED].  (like
 sendmail -f [EMAIL PROTECTED] for sendmail, see X-Authentication-Warning in
 the header of this mail) But this way is bad for local purposes: my
 MTA's diagnostic messages are sent trough internet or lost at all,
 e. g. when my ADSL is in down.  (Moreover, my letters sent to other
 local users have non-local envelope from address. Then local mail
 begin to go through external MTA.)

 What to do in such a situation?

I use mutt, which has an option to set the envelope-from address:

set envelope_from=yes# set the envelope-from address from From:

For the rest of the programs, like mail(1), my Sendmail setup sets
envelope-from to one of my valid outside-world addresses.  This is
accomplished with the following in my `sendmail.mc' file:

dnl Trusted users, who are allowed to change their envelope-from address
dnl without generating a warning in the message header, are listed, one per
dnl line, in `sendmail.ct'.
define(`confCT_FILE', `-o /etc/mail/sendmail.ct')
FEATURE(`use_cw_file')dnl

dnl Allow mail routing exceptions through a mailer table.
FEATURE(`mailertable', `hash /etc/mail/mailertable')

dnl Address masquerading.
dnl
dnl Making sure that all email that passes through my desktop's Sendmail
dnl installation is masqueraded as coming from `gothmog.pc', even if its 
original
dnl address is something slightly different (i.e. `ftp.pc' or `mail.pc'), is
dnl ok here.  It ensures that address rewriting and translation through
dnl `genericstable' will also work for all `*.pc' host names.
dnl
dnl To make sure that remote hosts don't get a MAIL FROM address from a
dnl hostname that doesn't resolve, envelope addresses are masqueraded too, 
and
dnl then get rewritten by `genericstable' to real-world addresses,
dnl i.e. [EMAIL PROTECTED]'.
MASQUERADE_AS(`gothmog.pc')
FEATURE(`masquerade_entire_domain')
FEATURE(`masquerade_envelope')

dnl Rewriting the envelope-from address of all outgoing messages through a
dnl `genericstable' lookup, ensures that envelope-from addresses seen by 
relay
dnl hosts are real, i.e. [EMAIL PROTECTED]' instead of the default
dnl envelope-from of [EMAIL PROTECTED]' that Sendmail would use.  This is
dnl required some times, to avoid getting bounces for messages from ISP mail
dnl relays that are misconfigured or are too strict about what can appear 
in a
dnl MAIL FROM command.
FEATURE(`genericstable', `hash -o /etc/mail/genericstable')
GENERICS_DOMAIN(`gothmog.pc')
FEATURE(`generics_entire_domain')

This looks like quite a mouthful of options, but it's not really that
difficult to read.  It's only big because of all the comments.

The file `/etc/mail/sendmail.ct' contains my username, because I trust
myself to use valid envelope-from addresses.  This turns off the
X-Authentication-Warning header which is so annoying for you too.

Then, in `/etc/mail/mailertable' I have an exception for my internal,
work-related email, and send it directly to the company's mail gateway:

# Custom mail routing rules.  This is currently useful only
# for routing work-related email through the VPN connection
# to my company's mail relay.
#
foo.com smtp:mailgate.foo.com
.foo.comsmtp:mailgate.foo.com

Finally, in my `/etc/mail/genericstable' map, I rewrite the
envelope-from of all the rest of email messages, like this:

# Outgoing email address rewriting.
[EMAIL PROTECTED]   [EMAIL PROTECTED]
[EMAIL PROTECTED]   [EMAIL PROTECTED]
[EMAIL PROTECTED]   [EMAIL PROTECTED]

These options are, of course, just a suggestion.  You don't *HAVE* to
use a setup similar to mine.

- Giorgos

___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]