Forward Local Mail

This is a discussion on Forward Local Mail within the alt.comp.mail.postfix forums, part of the Mail Servers and Related category; I have machines behind a company firewall that won't allow postfix/sendmail. I've already setup a postfix mail ...


Go Back   Usenet Forums > Mail Servers and Related > alt.comp.mail.postfix

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 11-30-2006
Doug Summers
 
Posts: n/a
Default Forward Local Mail

I have machines behind a company firewall that won't allow
postfix/sendmail. I've already setup a postfix mail server that relays
all mail. What I want to be able to do is take the sendmail/postfix
/var/spool/mail files, copy them to the relay server, then send the mail
out. Is this possible?
Reply With Quote
  #2 (permalink)  
Old 12-01-2006
Greg Hackney
 
Posts: n/a
Default Re: Forward Local Mail

Doug Summers wrote:
> I have machines behind a company firewall that won't allow
> postfix/sendmail. I've already setup a postfix mail server that relays
> all mail. What I want to be able to do is take the sendmail/postfix
> /var/spool/mail files, copy them to the relay server, then send the mail
> out. Is this possible?


When you say that the "company firewall won't allow postfix/sendmail",
do you mean that's it's company policy that you can't do this, or just
that SMTP port 25 can't be used ?

How are you going to copy the files over, manually on some media, or
over the network? If over the network, then that means there is some
port open in the firewall (which could also be used for email).

Postfix can listen on ports other than SMTP port 25 (assuming that this
is not violating company policy.

But otherwise, yes, you can copy spooled mail files from one Postfix
system to another, and get it to do the delivery.

--
Greg


Reply With Quote
  #3 (permalink)  
Old 12-01-2006
Doug Summers
 
Posts: n/a
Default Re: Forward Local Mail

Greg Hackney wrote:
> Doug Summers wrote:
>> I have machines behind a company firewall that won't allow
>> postfix/sendmail. I've already setup a postfix mail server that relays
>> all mail. What I want to be able to do is take the sendmail/postfix
>> /var/spool/mail files, copy them to the relay server, then send the
>> mail out. Is this possible?

>
> When you say that the "company firewall won't allow postfix/sendmail",
> do you mean that's it's company policy that you can't do this, or just
> that SMTP port 25 can't be used ?
>
> How are you going to copy the files over, manually on some media, or
> over the network? If over the network, then that means there is some
> port open in the firewall (which could also be used for email).
>
> Postfix can listen on ports other than SMTP port 25 (assuming that this
> is not violating company policy.
>
> But otherwise, yes, you can copy spooled mail files from one Postfix
> system to another, and get it to do the delivery.
>
> --
> Greg
>
>

I'm allowed to use ssh to initiate contact outside the firewall but not
the other way around. I was going to use rsync over ssh to get the mail
files. The question I have is which mail files to copy. I'm basically
only concerned with root mail.

Doug
Reply With Quote
  #4 (permalink)  
Old 12-02-2006
Greg Hackney
 
Posts: n/a
Default Re: Forward Local Mail

Doug Summers wrote:

> I'm allowed to use ssh to initiate contact outside the firewall but not
> the other way around. I was going to use rsync over ssh to get the mail
> files. The question I have is which mail files to copy. I'm basically
> only concerned with root mail.
> Doug



I suspect that what you are thinking of doing is going to be problematic.

If you just grab any file that's in /var/spool/postfix and ship it over,
you might inadvertantly get mail files destined for somewhere else
(unless you first examine the files with postcat or mailq or some method).


The only thing I can think of that might work fairly seamlessly using
standard software, is to use the UUCP package to queue the email destined
to the inside system, and then have the inside system pick it up from the
outside system via UUCICO, via the SSH port 22 hole in the firewall, or
some other open port. UUCP is normally port 540 I think (haven't had any
need to use it in about 20 years).

--
Greg

Reply With Quote
  #5 (permalink)  
Old 12-13-2006
Doug Summers
 
Posts: n/a
Default Re: Forward Local Mail

Greg Hackney wrote:
> Doug Summers wrote:
>
>> I'm allowed to use ssh to initiate contact outside the firewall but
>> not the other way around. I was going to use rsync over ssh to get the
>> mail files. The question I have is which mail files to copy. I'm
>> basically only concerned with root mail.
>> Doug

>
>
> I suspect that what you are thinking of doing is going to be problematic.
>
> If you just grab any file that's in /var/spool/postfix and ship it over,
> you might inadvertantly get mail files destined for somewhere else
> (unless you first examine the files with postcat or mailq or some method).
>
>
> The only thing I can think of that might work fairly seamlessly using
> standard software, is to use the UUCP package to queue the email destined
> to the inside system, and then have the inside system pick it up from the
> outside system via UUCICO, via the SSH port 22 hole in the firewall, or
> some other open port. UUCP is normally port 540 I think (haven't had any
> need to use it in about 20 years).
>
> --
> Greg
>

I got the process to work, copying over the files in
/var/spool/postfix/maildrop. The problem now is when these files are
processed (postfix flush) the sender looks like the machine doing the
sending not the original sender. This is not a huge issue but if fixable
it would be nice.
Reply With Quote
  #6 (permalink)  
Old 12-13-2006
Greg Hackney
 
Posts: n/a
Default Re: Forward Local Mail

Doug Summers wrote:

> I got the process to work, copying over the files in
> /var/spool/postfix/maildrop. The problem now is when these files are
> processed (postfix flush) the sender looks like the machine doing the
> sending not the original sender. This is not a huge issue but if fixable
> it would be nice.



Could you provide an example of the particular headers that you want
changed, showing what they look like now, and what you want them
to look like?

--
Greg
Reply With Quote
  #7 (permalink)  
Old 12-13-2006
Doug Summers
 
Posts: n/a
Default Re: Forward Local Mail

Greg Hackney wrote:
> Doug Summers wrote:
>
>> I got the process to work, copying over the files in
>> /var/spool/postfix/maildrop. The problem now is when these files are
>> processed (postfix flush) the sender looks like the machine doing the
>> sending not the original sender. This is not a huge issue but if
>> fixable it would be nice.

>
>
> Could you provide an example of the particular headers that you want
> changed, showing what they look like now, and what you want them
> to look like?
>
> --
> Greg

The way I've setup my machines that are allowed to send mail is to
forward everything to one system, then that system sends out the mail
through the company relayhost. A message from root@ucl-london will be
forwarded to ucl-obiwan. When I receive the message (root is aliased to
my account) the sender shows up as root@ucl-london, which is what I
want. Simply copying the mail files doesn't keep the sender info when
being sent.

Doug
Reply With Quote
  #8 (permalink)  
Old 12-13-2006
Greg Hackney
 
Posts: n/a
Default Re: Forward Local Mail

Doug Summers wrote:

> The way I've setup my machines that are allowed to send mail is to
> forward everything to one system, then that system sends out the mail
> through the company relayhost. A message from root@ucl-london will be
> forwarded to ucl-obiwan. When I receive the message (root is aliased to
> my account) the sender shows up as root@ucl-london, which is what I
> want. Simply copying the mail files doesn't keep the sender info when
> being sent.
>
> Doug


Understood. It sounds like the mail client that originates
the message is at fault by not using fully-qualified domain
names.

When Postfix processes a message that just says it from "root",
it will by default append it's own domain name to it.

Because you are moving these files to another system before they
are processed, the new system will add it's domain name.

I suspect the solution is to get the mail clients to use FQDNs,
or make the first receiving mailhost add them. Alsom it they are
being submitted via IMAP/POP3, perhaps that server software has
an option to append missing domain names.
--
Greg
Reply With Quote
  #9 (permalink)  
Old 12-14-2006
Doug Summers
 
Posts: n/a
Default Re: Forward Local Mail

Greg Hackney wrote:
> Doug Summers wrote:
>
>> The way I've setup my machines that are allowed to send mail is to
>> forward everything to one system, then that system sends out the mail
>> through the company relayhost. A message from root@ucl-london will be
>> forwarded to ucl-obiwan. When I receive the message (root is aliased
>> to my account) the sender shows up as root@ucl-london, which is what I
>> want. Simply copying the mail files doesn't keep the sender info when
>> being sent.
>>
>> Doug

>
> Understood. It sounds like the mail client that originates
> the message is at fault by not using fully-qualified domain
> names.
>
> When Postfix processes a message that just says it from "root",
> it will by default append it's own domain name to it.
>
> Because you are moving these files to another system before they
> are processed, the new system will add it's domain name.
>
> I suspect the solution is to get the mail clients to use FQDNs,
> or make the first receiving mailhost add them. Alsom it they are
> being submitted via IMAP/POP3, perhaps that server software has
> an option to append missing domain names.
> --
> Greg

Do you know when postfix appends the domain? I checked a machine today
by turning postfix off, sending mail, and checking the message. Instead
of root@ucl-london.xxx.xxx.xxx it was from root. I have these settings
on both the sender and relay hosts:

append_at_myorigin = yes
append_dot_mydomain = yes
Reply With Quote
  #10 (permalink)  
Old 12-14-2006
Greg Hackney
 
Posts: n/a
Default Re: Forward Local Mail

Doug Summers wrote:

> Do you know when postfix appends the domain?


It's done by trivial_rewrite (man 8 trivial-rewrite)

flow described in:
http://www.postfix.org/ADDRESS_REWRITING_README.html

Reply With Quote
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT +1. The time now is 06:40 PM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0