FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Debian > Debian User

 
 
LinkBack Thread Tools
 
Old 01-18-2010, 02:01 PM
Adam Hardy
 
Default question about sending mail and postfix

-----Original Message-----
From: Adam Hardy [mailto:adam.ant@cyberspaceroad.com]
Sent: January 18, 2010 8:32 AM

To: debian-user
Subject: question about sending mail and postfix

This is possibly an exceptionally easy question to answer because I feel
like all the documentation I've read about sending mail and postfix
starts at step 2, and step 1 is just common knowledge that I somehow
failed to pick up.

I have a new server online with lenny that I want to configure to send
all its mail for root to my email address, and that's all. I don't want
it to receive any email or relay or anything else.

I set this up a few years back with postfix and now trying to recreate
this setup, I am running into the problem that the mail command isn't
installed. It obviously doesn't come with postfix and there appears to
be a huge choice of packages that I could choose from in the debian
repositories, but isn't there a default? My guess is that my hosting
service installed such a stripped-down version of lenny that I didn't
get it.


James Wu on 18/01/10 14:50, wrote:
> Assuming you can install new packages, the mail command comes in the
> package bsd-mailx. Otherwise, you can try using the Postfix sendmail
> command. You'll probably have to read the man page as the flags are
> different from mail.

Hi James
thanks. Isn't bsd-mailx just a random choice from all of those listed when I
search the repositories?



Adam


--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
 
Old 01-18-2010, 02:34 PM
"James Wu"
 
Default question about sending mail and postfix

There are probably multiple "mail" commands that are with different
packages. The one I mentioned, bsd-mailx, seems to be the standard one
that I've come across. It might be the "default" in some setups although
I'm not sure about that.

James

-----Original Message-----
From: Adam Hardy [mailto:adam.ant@cyberspaceroad.com]
Sent: January 18, 2010 10:01 AM
To: debian-user@lists.debian.org
Cc: debian-user
Subject: Re: question about sending mail and postfix

> -----Original Message-----
> From: Adam Hardy [mailto:adam.ant@cyberspaceroad.com]
> Sent: January 18, 2010 8:32 AM
> To: debian-user
> Subject: question about sending mail and postfix
>
> This is possibly an exceptionally easy question to answer because I
> feel like all the documentation I've read about sending mail and
> postfix starts at step 2, and step 1 is just common knowledge that I
> somehow failed to pick up.
>
> I have a new server online with lenny that I want to configure to send

> all its mail for root to my email address, and that's all. I don't
> want it to receive any email or relay or anything else.
>
> I set this up a few years back with postfix and now trying to recreate

> this setup, I am running into the problem that the mail command isn't
> installed. It obviously doesn't come with postfix and there appears to

> be a huge choice of packages that I could choose from in the debian
> repositories, but isn't there a default? My guess is that my hosting
> service installed such a stripped-down version of lenny that I didn't
> get it.

James Wu on 18/01/10 14:50, wrote:
> Assuming you can install new packages, the mail command comes in the
> package bsd-mailx. Otherwise, you can try using the Postfix sendmail
> command. You'll probably have to read the man page as the flags are >
different from mail.

Hi James
thanks. Isn't bsd-mailx just a random choice from all of those listed
when I search the repositories?


Adam


--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact
listmaster@lists.debian.org


--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
 
Old 01-18-2010, 02:37 PM
Adam Hardy
 
Default question about sending mail and postfix

Andrei Popescu on 18/01/10 13:40, wrote:

On Mon,18.Jan.10, 13:32:20, Adam Hardy wrote:


I have a new server online with lenny that I want to configure to
send all its mail for root to my email address, and that's all. I
don't want it to receive any email or relay or anything else.


'man aliases' and don't forget to run newaliases after you changed
/etc/aliases.


I need a database ...hmmm I can see this job morphing into something a lot
bigger than I had imagined.


Is there no easier package to use for this than postfix with a database?



--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
 
Old 01-18-2010, 03:24 PM
"James Wu"
 
Default question about sending mail and postfix

I apologize, I just double checked and I think the "mailutils" package
is the more common one. You shouldn't need a database for it. However,
I'd check to make sure you don't already have it the mail command in
your system.

Check your PATH by typing "env | grep PATH" in the command line and
check that /usr/bin is listed. As well, type "ls /usr/bin | grep mail"
and check if you see a mail command. You don't really need postfix for
this anyways, exim which comes on lenny by default is enough for such a
simple task.

James

-----Original Message-----
From: Adam Hardy [mailto:adam.ant@cyberspaceroad.com]
Sent: January 18, 2010 10:37 AM
To: debian-user@lists.debian.org
Cc: debian-user@lists.debian.org
Subject: Re: question about sending mail and postfix

Andrei Popescu on 18/01/10 13:40, wrote:
> On Mon,18.Jan.10, 13:32:20, Adam Hardy wrote:
>
>> I have a new server online with lenny that I want to configure to
>> send all its mail for root to my email address, and that's all. I
>> don't want it to receive any email or relay or anything else.
>
> 'man aliases' and don't forget to run newaliases after you changed
> /etc/aliases.

I need a database ...hmmm I can see this job morphing into something a
lot bigger than I had imagined.

Is there no easier package to use for this than postfix with a database?



--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact
listmaster@lists.debian.org


--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
 
Old 01-18-2010, 04:14 PM
Adam Hardy
 
Default question about sending mail and postfix

James Wu on 18/01/10 16:24, wrote:

I apologize, I just double checked and I think the "mailutils" package
is the more common one. You shouldn't need a database for it. However,
I'd check to make sure you don't already have it the mail command in
your system.

Check your PATH by typing "env | grep PATH" in the command line and
check that /usr/bin is listed. As well, type "ls /usr/bin | grep mail"
and check if you see a mail command. You don't really need postfix for
this anyways, exim which comes on lenny by default is enough for such a
simple task.


No problem.

I don't have mail, definitely, but I am currently testing with sendmail,
although postfix has only given me sendmail in /usr/sbin so I have to sudo to
use it.


mailutils looks like the business. And postfix is not happy about me trying to
configure it to send emails to alias addresses. I might have to check out exim
if you say it can do that too.


Thanks
Adam


--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
 
Old 01-18-2010, 04:29 PM
Camaleón
 
Default question about sending mail and postfix

On Mon, 18 Jan 2010 15:37:12 +0000, Adam Hardy wrote:

> Andrei Popescu on 18/01/10 13:40, wrote:
>> On Mon,18.Jan.10, 13:32:20, Adam Hardy wrote:
>>
>>> I have a new server online with lenny that I want to configure to send
>>> all its mail for root to my email address, and that's all. I don't
>>> want it to receive any email or relay or anything else.
>>
>> 'man aliases' and don't forget to run newaliases after you changed
>> /etc/aliases.
>
> I need a database ...hmmm I can see this job morphing into something a
> lot bigger than I had imagined.
>
> Is there no easier package to use for this than postfix with a database?

You don't need a "database" (at least not SQL/LDAP one) at all :-?

/etc/aliases (is just a "table") is the standard (and easiest) way to
setting up local e-mail aliases in Postfix and many other MTAs.

"man etc-aliases" will give you the whole picture about how this file is
used.

If you need more sophisticated config (delivering to local or remote
recipients), virtual aliasing in Postfix is pretty useful and quite easy
to setup, depending on you current configuration :-)

Greetings,

--
Camaleón


--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
 
Old 01-18-2010, 04:49 PM
Adam Hardy
 
Default question about sending mail and postfix

Camaleón on 18/01/10 17:29, wrote:

On Mon, 18 Jan 2010 15:37:12 +0000, Adam Hardy wrote:

Andrei Popescu on 18/01/10 13:40, wrote:

On Mon,18.Jan.10, 13:32:20, Adam Hardy wrote:

I have a new server online with lenny that I want to configure to send
all its mail for root to my email address, and that's all. I don't


You don't need a "database" (at least not SQL/LDAP one) at all :-?

/etc/aliases (is just a "table") is the standard (and easiest) way to
setting up local e-mail aliases in Postfix and many other MTAs.

"man etc-aliases" will give you the whole picture about how this file is
used.


If you need more sophisticated config (delivering to local or remote
recipients), virtual aliasing in Postfix is pretty useful and quite easy
to setup, depending on you current configuration :-)


I figured that out actually but in the meantime I only managed to find another
issue. I wrote my own /etc/postfix/aliases file:


root: adam.hardy@cyberspaceroad.com

and momentarily it worked. I then added another user

adam: adam.hardy@cyberspaceroad.com

and it fell over again. I tried removing the /etc/postfix/aliases file and
putting the aliases in /etc/aliases and it still didn't work.


I get this, if it gives any clues to the problem:

Jan 18 17:35:11 ecocore postfix/smtp[22579]: 452652A8203:
to=<adam@adamsdomain.org>, relay=none, delay=462, delays=462/0.02/0.05/0,
dsn=4.4.1, status=deferred (connect to private.domain.org[1.1.1.1]:25:
Connection refused)


where 1.1.1.1 is the ip address of the server.


--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
 
Old 01-18-2010, 05:35 PM
Camaleón
 
Default question about sending mail and postfix

On Mon, 18 Jan 2010 17:49:23 +0000, Adam Hardy wrote:

> Camaleón on 18/01/10 17:29, wrote:

>> You don't need a "database" (at least not SQL/LDAP one) at all :-?
>>
>> /etc/aliases (is just a "table") is the standard (and easiest) way to
>> setting up local e-mail aliases in Postfix and many other MTAs.
>>
>> "man etc-aliases" will give you the whole picture about how this file
>> is used.
>>
>> If you need more sophisticated config (delivering to local or remote
>> recipients), virtual aliasing in Postfix is pretty useful and quite
>> easy to setup, depending on you current configuration :-)
>
> I figured that out actually but in the meantime I only managed to find
> another issue. I wrote my own /etc/postfix/aliases file:

Default "alias_maps" is set to lookup into "/etc/aliases" file, not "/etc/
postfix/aliases" but this can be verified with:

***
postconf -d | grep "alias_maps ="
***

That command will tell you where Postfix lookups for this table and that
is the file you'll have to "tweak".

> root: adam.hardy@cyberspaceroad.com

After making any change of the aliases file, you have to run "newaliases"
or "postalias /etc/aliases" (pointing to the right file path).

> and momentarily it worked. I then added another user
>
> adam: adam.hardy@cyberspaceroad.com
>
> and it fell over again. I tried removing the /etc/postfix/aliases file
> and putting the aliases in /etc/aliases and it still didn't work.

First, you have to find out the right location of that table.

> I get this, if it gives any clues to the problem:
>
> Jan 18 17:35:11 ecocore postfix/smtp[22579]: 452652A8203:
> to=<adam@adamsdomain.org>, relay=none, delay=462,
> delays=462/0.02/0.05/0, dsn=4.4.1, status=deferred (connect to
> private.domain.org[1.1.1.1]:25: Connection refused)
>
> where 1.1.1.1 is the ip address of the server.

Are there any content filters (i.e, amavisd-new, firewall rules or any
network traffic restrictions) that are preventing e-mails going out?

Can you normally send e-mails to remote sites or is your Postfix
configured to send only "locally"?

Greetings,

--
Camaleón


--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
 
Old 01-18-2010, 11:50 PM
Adam Hardy
 
Default question about sending mail and postfix

Camaleón on 18/01/10 18:35, wrote:
Are there any content filters (i.e, amavisd-new, firewall rules or any
network traffic restrictions) that are preventing e-mails going out?


Can you normally send e-mails to remote sites or is your Postfix
configured to send only "locally"?


OK, right, so I can see now that postfix is using /etc/aliases.

I put this line in there:

adam: adam.hardy@my-normal-email.com

and ran newaliases and saw that it recreated /etc/aliases.db.

Then I ran mail and sent user 'adam' an email, checked in the log and got this:

Jan 18 23:32:32 my-other-domain postfix/pickup[31591]: 11C082A8779: uid=1000
from=<adam>
Jan 18 23:32:32 my-other-domain postfix/cleanup[32630]: 11C082A8779:
message-id=<20100118233232.11C082A8779@my-other-domain.org>
Jan 18 23:32:32 my-other-domain postfix/qmgr[14877]: 11C082A8779:
from=<adam@my-other-domain.org>, size=345, nrcpt=1 (queue active)
Jan 18 23:32:32 my-other-domain postfix/smtp[32633]: connect to
my-other-domain.vs.athnic.net[11.22.33.44]:25: Connection refused
Jan 18 23:32:32 my-other-domain postfix/smtp[32633]: 11C082A8779:
to=<adam@my-other-domain.vs.athnic.net>, relay=none, delay=0.07,
delays=0.04/0.01/0.02/0, dsn=4.4.1, status=deferred (connect to
my-other-domain.vs.athnic.net[11.22.33.44]:25: Connection refused)

(END)

where vs.athnic.net is the sub-domain of the hosting service, and
my-other-domain is the new domain I'm setting up a webserver for.


So despite the postconf command saying that it's using /etc/aliases, it's not
actually picking up the different email address from there. Maybe it doesn't get
that far though - and it will change it after - except it gets 'connection
refused' so it stops.


The connection could feasibly be blocked by a firewall belonging to the hosting
service, but port 25 is standard for SMTP and they said the standard ones were free.


but why am i seeing postfix build a connection with itself? have I got something
wrong here in the network configuration?


Just for the record, here's my postfix main.cf:

mydomain = ecocore.org
myhostname = $mydomain
myorigin = $mydomain
mynetworks_style = host
append_dot_mydomain = no
local_recipient_maps =
inet_interfaces = loopback-only


--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
 
Old 01-19-2010, 06:47 AM
Camaleón
 
Default question about sending mail and postfix

On Tue, 19 Jan 2010 00:50:56 +0000, Adam Hardy wrote:

> Camaleón on 18/01/10 18:35, wrote:
>> Are there any content filters (i.e, amavisd-new, firewall rules or any
>> network traffic restrictions) that are preventing e-mails going out?
>>
>> Can you normally send e-mails to remote sites or is your Postfix
>> configured to send only "locally"?
>
> OK, right, so I can see now that postfix is using /etc/aliases.
>
> I put this line in there:
>
> adam: adam.hardy@my-normal-email.com
>
> and ran newaliases and saw that it recreated /etc/aliases.db.
>
> Then I ran mail and sent user 'adam' an email, checked in the log and
> got this:

(...)

> Jan 18
> 23:32:32 my-other-domain postfix/smtp[32633]: 11C082A8779:
> to=<adam@my-other-domain.vs.athnic.net>, relay=none, delay=0.07,
> delays=0.04/0.01/0.02/0, dsn=4.4.1, status=deferred (connect to
> my-other-domain.vs.athnic.net[11.22.33.44]:25: Connection refused) (END)
>
> where vs.athnic.net is the sub-domain of the hosting service, and
> my-other-domain is the new domain I'm setting up a webserver for.
>
> So despite the postconf command saying that it's using /etc/aliases,
> it's not actually picking up the different email address from there.
> Maybe it doesn't get that far though - and it will change it after -
> except it gets 'connection refused' so it stops.

Then you have now a problem with your Postfix setup, not "aliases" :-).

How is your Postfix global configuration done? Is it directly delivering
e-mails outside (Internet) or are you sending all the mail to your ISP
host? Is is a multi-domain setup (virtual domains)? What is Postfix's
next step, is attached to DSL line or any kind of gateway...?

Explain a bit so we can get the whole scenario about your Postfix setup.

> The connection could feasibly be blocked by a firewall belonging to the
> hosting service, but port 25 is standard for SMTP and they said the
> standard ones were free.
>
> but why am i seeing postfix build a connection with itself? have I got
> something wrong here in the network configuration?

Yes, so I think.

Not "wrong" but it seems your Postfix is not configured to properly send
out and handle virtual domains, maybe :-?

> Just for the record, here's my postfix main.cf:

(...)

> inet_interfaces = loopback-only

This can be the cause. You (or your provider) are forcing Postfix to
listen only in loopback interface (127.0.0.1) so you get a "connection
refused" error when tries to connect to [11.22.33.44] (also, the "square
brackets" means no name server resolution is done).

It seems your host is configured for local delivery only :-?

Greetings,

--
Camaleón


--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
 

Thread Tools




All times are GMT. The time now is 05:06 AM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright ©2007 - 2008, www.linux-archive.org