On Tue, 13 Nov 2007 03:25:22 +0100, Gilles Ganault wrote:
> Hello
>
> I'm running Ubuntu 7.04 Server to which I need to add e-mail
> capability. I installed Postfix through "apt-get install postfix",
> edited /etc/postfix/main.cf.
Can we assume you have this line in main.cf
masquerade_exceptions = root
That will help keeping root's mail on your LAN

instead of escaping onto the Internet.
Can we also assume you modified aliases's file about/around the 11'th
line from the bottom, to a user fred, done a
postalias aliases
postfix stop
cp /dev/null mail logs (errors, warnings, info) in /var/log/mail/ (guessing)
postfix start
and cat those same files to check for errors.
Then logged in to the fred user account, set up thunderbird or some email
client in/out server to be the Fully Qualified Domain Name (FQDN) of your
node, and sent/received message from fred.
If all the above worked, I would assume fred could click up a terminal and
doing a
mail -s "Subject text here" $USER < /etc/profile
would cause fred to have /etc/profile in his mail client's mail inbox.
If so, check your aliases change by doing a
mail -s "Subject text here" root < /etc/profile
and see if fred gets a repeat email except it will be from root.
Now you know your MTA (postfix) is working on the LAN.
> ubuntu postfix/smtp[10213]: D24476343E1: to=<(E-Mail Removed)>,
> relay=smtp.isp.tld [some_ip_here]:25, delay=0.37,
> delays=0.08/0.04/0.22/0.03, dsn=5.0.0, dUmMy=bounced (host
> smtp.isp.tld[some_ip_here] said: 504 <root@acme>: Sender address
> rejected: need fully-qualified address (in reply to MAIL FROM
> command))
>
> Is it possible to specify the FROM and TO fields from the command
> line, and if yes, how?
Yes but you have no reason to be dinking with those lines unless you
are a spammer.

Or your isp requires your email header to be from it's domain when
connecting to it's smtp server.
Usual problem is you have not given your node a FQDN.
If node name is darkstar.acme then there is the bad domain name for
the node darkstar.
Let's assume your ip address is 82.237.75.54 for your node. And you
tacked on .com to careate a FQDN so node name is now darkstar.acme.com
That is bad because
$ host acme.com
shows
acme.com has address 216.27.178.28
acme.com mail is handled by 10 smtp-b.acme.com.
acme.com mail is handled by 10 smtp-c.acme.com.
and acme.com sys admin or
(E-Mail Removed) will not be happy with getting
fred email.
I recommend use someting like darkstar.acme.invalid so you have a
FQDN for your node darkstar, and mail can route around on your LAN for the
acme.invalid domain.
..invalid is a fine suffix for an unregistered/madeup domain name.
The next part of your mail problem is you do someting like
mail -s "Thanks Bit"
(E-Mail Removed) < /dev/null
Assuming you have set relayhost = smtp.proxad.net or some such value.,
I would receive A
Subject: Thanks Bit
From: Fred Ganault
and if I replied to it, my MTA would try to send it to
(E-Mail Removed)lid
Several solutions.
1 You create a fred account at proxad.net
You use /etc/postfix/generic to change
acme.invalid to proxad.net
did a
postfix generic
added smtp_generic_maps = hash:/etc/postfix/generic to main.cf
postfix stop
cp /dev/null mail logs (errors, warnings, info) in /var/log/mail/ (guessing)
postfix start
and check those same files for errors.
the next
mail -s "Thanks Bit"
(E-Mail Removed) < /dev/null
from fred's terminal
would give the same message except the mail header from: would contain
(E-Mail Removed)
Downside there,
Fred has to log into proxad.net to get see the mail.

all mail leaving darkstar has a return address of
(E-Mail Removed)
2 Use canonical_sender,virtual (my solution)
cp canonical canonical_sender
to munge the from header into a hotmail acount
There you can set
(E-Mail Removed)lid
(E-Mail Removed)
postmap canonical canonical_sender
You setup virtual for LAN users
(E-Mail Removed)lid fred
postmap virtual
postfix stop/start
Now bittwister's reply would goto
(E-Mail Removed)
and fred could have a cron job using
getlive to pull the hotmail.com email down into freds inbox.
If you cannot get getlive with apt-get, code can be found
http://sourceforge.net
When all else fails, there is
http://www.postfix.org