# mail relay issue, bad recipient address syntax



## tynelson (Dec 12, 2009)

Hey smarties!

I have Freebsd 7.2 and am using postfix with mailman to manage a mailing list.

My mailman interface runs perfectly.  I can subscribe, remove, etc all from either the command line or the web interface...
the problem, is I have no way of reaching mailman via e-mail.

I reply to the addresses that should work, and they get sent back with an error saying.  

```
testlist@deds1124.i2bnetworks.com
Technical details of permanent failure: 
Google tried to deliver your message, but it was rejected by the recipient domain. We recommend contacting the other email provider for 
further information about the cause of this error. The error that the other server returned was: 501 501 5.1.3 Bad recipient address syntax 
(state 14).
```

If I try switching the domain and host, e.g.
testlist@66.181.24.10 just for giggles...
I get:

```
Technical details of permanent failure: 
DNS Error: Domain name not found
```

anyways, I know that's useless info.

So... I'm enclosing some relevent files, as well as my postconf -n output in hopes that someone might see something that is obvious and jumps out at them.

Aragon, if you read this, don't laugh too hard at me.
lol-I'm honestly running out of ideas.  

Thanks guys!!

`postconf -n`

```
alias_maps = hash:/etc/postfix/aliases,            hash:/usr/local/mailman/data/aliases
command_directory = /usr/local/sbin
config_directory = /usr/local/etc/postfix
daemon_directory = /usr/local/libexec/postfix
data_directory = /var/db/postfix
debug_peer_level = 2
html_directory = no
inet_interfaces = all
mail_owner = postfix
mailq_path = /usr/local/bin/mailq
manpage_directory = /usr/local/man
mydestination = $myhostname, localhost.$mydomain, localhost
mydomain = local.domain
myhostname = host.local.domain
mynetworks_style = host
myorigin = $myhostname
newaliases_path = /usr/local/bin/newaliases
owner_request_special = no
queue_directory = /var/spool/postfix
readme_directory = no
recipient_delimiter = +
relay_domains = $mydestination
relay_recipient_maps = hash:/usr/local/etc/postfix/relay_recipients
sample_directory = /usr/local/etc/postfix
sendmail_path = /usr/local/sbin/sendmail
setgid_group = maildrop
transport_maps = hash:/usr/local/etc/postfix/transport
unknown_local_recipient_reject_code = 550
```


----------



## tynelson (Dec 13, 2009)

*my own mail log*


```
Dec 13 07:22:14 deds1124 postfix/qmgr[22967]: 3886539F16: from=<plenty-bounces@deds1124.i2bnetworks.com>, size=2035, nrcpt=1 (queue active)
Dec 13 07:22:15 deds1124 postfix/smtp[23005]: 3886539F16: to=<tygrrrnelson@gmail.com>, relay=gmail-smtp-in.l.google.com[209.85.216.49]:25, 
delay=0.83, delays=0/0/0.54/0.28, dsn=2.0.0, status=sent (250 2.0.0 OK 1260659765 10si4125153pxi.7)
Dec 13 07:22:15 deds1124 postfix/qmgr[22967]: 3886539F16: removed
Dec 13 07:37:27 deds1124 postfix/qmgr[22967]: 7679639E70: from=<root@host.local.domain>, size=336, nrcpt=1 (queue active)
Dec 13 07:37:27 deds1124 postfix/qmgr[22967]: 38FAC39EA9: from=<root@host.local.domain>, size=478, nrcpt=1 (queue active)
Dec 13 07:37:29 deds1124 postfix/smtp[23064]: 38FAC39EA9: host mx00.1and1.com[74.208.5.3] said: 421 invalid sender domain 'host.local.domain' 
(misconfigured dns?) (in reply to RCPT TO command)
Dec 13 07:37:29 deds1124 postfix/smtp[23063]: 7679639E70: host mx01.1and1.com[74.208.5.4] said: 421 invalid sender domain 'host.local.domain' 
(misconfigured dns?) (in reply to RCPT TO command)
```


----------



## dennylin93 (Dec 13, 2009)

Your domain seems to be invalid. What is the output of `$ hostname`?


----------



## tynelson (Dec 13, 2009)

*hostname output*

deds1124.i2bnetworks.com


----------



## DutchDaemon (Dec 13, 2009)

Then why do you have this in your Postfix config?


```
mydomain = local.domain
myhostname = host.local.domain
```


----------



## tynelson (Dec 13, 2009)

*uh oh*

Crap.  They should both say deds1124.i2bnetwork.com...


----------



## DutchDaemon (Dec 13, 2009)

tynelson said:
			
		

> testlist@66.181.24.10



Not sure if Postfix works the same as Sendmail in this respect, but when sending mail to an IP address one has to avoid an MX lookup by using testlist@[66.181.24.10].


----------



## dennylin93 (Dec 13, 2009)

Postfix automatically detects mydomain, myhostname, and myorigin. Comment them out and do `# postfix reload`.

If it still doesn't work, try specifying them by hand. This is what I have:

```
myhostname = mail.hs.ntnu.edu.tw
mydomain = hs.ntnu.edu.tw
myorigin = $mydomain
```


----------



## tynelson (Dec 13, 2009)

*Thanks guys*

Here is my postconf - n out put


```
alias_maps = hash:/etc/postfix/aliases,            hash:/usr/local/mailman/data/aliases
command_directory = /usr/local/sbin
config_directory = /usr/local/etc/postfix
daemon_directory = /usr/local/libexec/postfix
data_directory = /var/db/postfix
debug_peer_level = 2
html_directory = no
inet_interfaces = all
mail_owner = postfix
mailq_path = /usr/local/bin/mailq
manpage_directory = /usr/local/man
mydestination = $myhostname, localhost.$mydomain, localhost
mynetworks_style = host
newaliases_path = /usr/local/bin/newaliases
owner_request_special = no
queue_directory = /var/spool/postfix
readme_directory = no
recipient_delimiter = +
relay_domains = $mydestination
relay_recipient_maps = hash:/usr/local/etc/postfix/relay_recipients
sample_directory = /usr/local/etc/postfix
sendmail_path = /usr/local/sbin/sendmail
setgid_group = maildrop
transport_maps = hash:/usr/local/etc/postfix/transport
unknown_local_recipient_reject_code = 550
```


I tried setting it to what Dutch said and that didn't work.

I commented out the myhostname mydomain and my origin, as reflected in the output...  I'm not sure what is going on here  

I don't know if its any significane...but when I mail to testlist@deds1124.i2bnetworks.com it gives me a DNS error..

```
Technical details of permanent failure:
DNS Error: Domain name not found
```

but when I mail to testlist@66.181.24.10   it gives me a rejection error

```
Technical details of permanent failure:
Google tried to deliver your message, but it was rejected by the recipient domain. We recommend contacting the other email provider for 
further information about the cause of this error. The error that the other server returned was: 501 501 5.1.3 Bad recipient address syntax 
(state 14).
```


This leads me to believe that it should really never mail to @deds1124.i2bnetworks.com and the problem is that it is not setup right to receive the @66.181.24.10

Does that make sense?

I can't believe this is being so difficult-I followed all the installation pre-and post that came with these programs..

*pulling hair out*
b ut i truly do thank you guys for taking the time to look at these..  honestly.

Thank you!  

What should I try next?


----------



## J65nko (Dec 13, 2009)

First thing a mailserver will do is the check whether there is an MX record
	
	



```
$ dig -t mx deds1124.i2bnetworks.com.

; <<>> DiG 9.3.4 <<>> -t mx deds1124.i2bnetworks.com.
;; global options:  printcmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NXDOMAIN, id: 46432
;; flags: qr aa rd ra; QUERY: 1, ANSWER: 0, AUTHORITY: 0, ADDITIONAL: 0

;; QUESTION SECTION:
;deds1124.i2bnetworks.com.      IN      MX

;; Query time: 1 msec
;; SERVER: 192.168.222.10#53(192.168.222.10)
;; WHEN: Sun Dec 13 22:36:54 2009
;; MSG SIZE  rcvd: 42
```
In this case there isn't one. So it has to fall back on the A record (IP address) of eds1124.i2bnetworks.com.
	
	



```
dig deds1124.i2bnetworks.com

; <<>> DiG 9.3.4 <<>> deds1124.i2bnetworks.com
;; global options:  printcmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NXDOMAIN, id: 24296
;; flags: qr aa rd ra; QUERY: 1, ANSWER: 0, AUTHORITY: 0, ADDITIONAL: 0

;; QUESTION SECTION:
;deds1124.i2bnetworks.com.      IN      A

;; Query time: 206 msec
;; SERVER: 192.168.222.10#53(192.168.222.10)
;; WHEN: Sun Dec 13 22:24:48 2009
;; MSG SIZE  rcvd: 42
```
Sadly this also fails.Requirement for working mail: working DNS


----------



## J65nko (Dec 13, 2009)

From my side, sending a mail with *echo test | mail -s 'test' testlist@[66.181.24.10]* also fails.

```
From MAILER-DAEMON Sun Dec 13 23:09:18 2009
Received: from localhost (localhost)
        by hercules.utp.xnet (8.14.1/8.14.1) id nBDM9IRM024436;
        Sun, 13 Dec 2009 23:09:18 +0100 (CET)
Date: Sun, 13 Dec 2009 23:09:18 +0100 (CET)
From: Mail Delivery Subsystem <MAILER-DAEMON>
Message-Id: <200912132209.nBDM9IRM024436@hercules.utp.xnet>
To: <j65nko@hercules.utp.xnet>
MIME-Version: 1.0
Content-Type: multipart/report; report-type=delivery-status;
        boundary="nBDM9IRM024436.1260742158/hercules.utp.xnet"
Subject: Returned mail: see transcript for details
Auto-Submitted: auto-generated (failure)

This is a MIME-encapsulated message

--nBDM9IRM024436.1260742158/hercules.utp.xnet

The original message was received at Sun, 13 Dec 2009 23:09:16 +0100 (CET)
from localhost.utp.xnet [127.0.0.1]

   ----- The following addresses had permanent fatal errors -----
[color=blue]<testlist@[66.181.24.10]>
    (reason: 550 5.1.1 <testlist@[66.181.24.10]>: Recipient address rejected: User unknown in local recipient table)

   ----- Transcript of session follows -----
... while talking to [66.181.24.10]:
>>> DATA
<<< 550 5.1.1 <testlist@[66.181.24.10]>: Recipient address rejected: User unknown in local recipient table
550 5.1.1 <testlist@[66.181.24.10]>... User unknown
<<< 554 5.5.1 Error: no valid recipients[/color]

--nBDM9IRM024436.1260742158/hercules.utp.xnet
Content-Type: message/delivery-status

Reporting-MTA: dns; hercules.utp.xnet
Received-From-MTA: DNS; localhost.utp.xnet
Arrival-Date: Sun, 13 Dec 2009 23:09:16 +0100 (CET)

Final-Recipient: RFC822; testlist@[66.181.24.10]
Action: failed
Status: 5.1.1
Remote-MTA: DNS; [66.181.24.10]
Diagnostic-Code: SMTP; 550 5.1.1 <testlist@[66.181.24.10]>: Recipient address rejected: User unknown in local recipient table
Last-Attempt-Date: Sun, 13 Dec 2009 23:09:18 +0100 (CET)

--nBDM9IRM024436.1260742158/hercules.utp.xnet
Content-Type: message/rfc822

Return-Path: <j65nko@hercules.utp.xnet>
Received: from hercules.utp.xnet (localhost.utp.xnet [127.0.0.1])
        by hercules.utp.xnet (8.14.1/8.14.1) with ESMTP id nBDM9GRM021556
        for <testlist@[66.181.24.10]>; Sun, 13 Dec 2009 23:09:16 +0100 (CET)
Received: (from j65nko@localhost)
        by hercules.utp.xnet (8.14.1/8.14.1/Submit) id nBDM9GCO026097
        for testlist@[66.181.24.10]; Sun, 13 Dec 2009 23:09:16 +0100 (CET)
Date: Sun, 13 Dec 2009 23:09:16 +0100 (CET)
From: j65nko@hercules.utp.xnet
Message-Id: <200912132209.nBDM9GCO026097@hercules.utp.xnet>
To: testlist@[66.181.24.10]
Subject: test

test

--nBDM9IRM024436.1260742158/hercules.utp.xnet--
```
So there is no user or virtual user 'testlist' on 66.181.24.10.


----------



## tynelson (Dec 13, 2009)

*Thanks J65!*

That's the problem!

I'm running Apache 22 on FreeBSD...
how should I go about fixing this?  I just want to ask first before I find documentation and try and do it myself-I have a tendency to screw things up.  :/


----------



## J65nko (Dec 13, 2009)

I have zero experience with Mailman but maybe http://www.list.org/docs.html 

And then http://web.irtnog.org/doc/how-to/freebsd-postfix-mailman

Two linux centered guides:
http://www.yolinux.com/TUTORIALS/LinuxTutorialMailman.html and http://freemars.org/howto/mailman.html


----------



## DutchDaemon (Dec 14, 2009)

As far as I remember, Mailman will print a very helpful message when creating a new list from the console, telling you exactly what to add to /etc/mail/aliases (which is where *all* Mailman list 'accounts' live).

It usually looks like this:


```
testlist:              "|/usr/local/mailman/mail/mailman post testlist"
testlist-admin:        "|/usr/local/mailman/mail/mailman admin testlist"
testlist-bounces:      "|/usr/local/mailman/mail/mailman bounces testlist"
testlist-confirm:      "|/usr/local/mailman/mail/mailman confirm testlist"
testlist-join:         "|/usr/local/mailman/mail/mailman join testlist"
testlist-leave:        "|/usr/local/mailman/mail/mailman leave testlist"
testlist-owner:        "|/usr/local/mailman/mail/mailman owner testlist"
testlist-request:      "|/usr/local/mailman/mail/mailman request testlist"
testlist-subscribe:    "|/usr/local/mailman/mail/mailman subscribe testlist"
testlist-unsubscribe:  "|/usr/local/mailman/mail/mailman unsubscribe testlist"
```


----------



## tynelson (Dec 14, 2009)

*crap*

I just can't figure this out...

I think I might just deinstall mailman, postfix,apache22 and start over and hope this time nothing it configured wrong...

GRRRRRR...

I'm so thankful for all the time and responses guys-I wish I could just pay someone to do this.
lol.
I know it would only take a couple hours for a whiz.


----------



## J65nko (Dec 14, 2009)

If postfix receives a mail for the 'testlist', it needs to deliver this mail. It only can deliver if it can find something called 'testlist' to deliver to. This could be:

A user 'testlist' with or without a '/home/testlist' directory but with a "/var/mail/testlist" mailbox.
A redirection or forwarding address
A program which accepts the mail on standard input for further processing.

If postfix receives an email, it has to decide to either accept or reject.
After the sender tells postfix who the recipient, the "TO:", is, postfix follows a certain procedure to find out if it knows the recipient.

Most mailers follow something like this:
Scan "/etc/passwd" file, if user is there, accept. If not scan "/etc/mail/aliases" and if recipient is listed there, accept the mail, else reject.​
From the *aliases* man page:
	
	



```
DESCRIPTION
       This file describes user ID aliases used by sendmail.  The file resides
       in /etc/mail and is formatted as a series of lines of the form

	      name: addr_1, addr_2, addr_3, . . .

       The name is the name to alias, and the addr_n are the aliases for  that
       name.  addr_n can be another alias, a local username, a local filename,
       a command, an include file, or an external address.

       Local Username
	      username

	      The username must be available via getpwnam(3).

       Local Filename
	      /path/name

	      Messages are appended to the file specified by the full pathname
	      (starting with a slash (/))

       Command
	      |command

	      A  command  starts  with a pipe symbol (|), it receives messages
	      via standard input.
```
So if your testlist is not listed here, the only thing postfix can do is to reject the mail.

The items posted by DutchDaemon like
	
	



```
testlist:              "|/usr/local/mailman/mail/mailman post testlist"
```
are using this "|command" format I quoted from the "aliases" man page.

Don't give up, you are nearly there, you only need to add some stuff to this /etc/mail/aliases file. Don't forget to run *newaliases* after editing this file:
From the same man page:
	
	



```
This  is  only  the  raw  data file; the actual aliasing information is
       placed into a binary format in the file [file]/etc/mail/aliases.db[/file] using  the
       program	[file]newaliases(1)[/file].	 A  [file]newaliases[/file] command should be executed each
       time the aliases file is changed for the change to take effect.
```


----------



## tynelson (Dec 15, 2009)

*thanks a bunch!*

My aliases all reflect the information that it should..  Funny how there's a bunch of different alias files.  I'm wondering if it's mapped right though.  Also, the "mydomain" part of thie postconf -d output just says i2bnetworks.com...
which is definitely not right.  I'm sure that is one of the problems.  So, these are the defaults settings..and editing main.cf doesn't change it.  Any suggestions?


And, again thanks for your help...I don't want to give up on this!


----------



## J65nko (Dec 15, 2009)

tynelson said:
			
		

> Also, the "mydomain" part of the postconf -d output just says i2bnetworks.com...
> which is definitely not right.  I'm sure that is one of the problems.


I just did a *echo test | mail -s 'test' testlist@[66.181.24.10]* and that fails with the same recipient unknown error. Another attempt *echo test from j65nko | mail -s 'help' testlist@deds1124.i2bnetworks.com.* fails because deds1124.i2bnetworks.com fails to resolve in DNS. A simple test from the command line confirms this:
	
	



```
$ host deds1124.i2bnetworks.com
Host deds1124.i2bnetworks.com not found: 3(NXDOMAIN)
```

So you first have to decide which on which box you want to host your mailing list: 66.181.24.10 or deds1124.i2bnetworks.com.

If you decide on "deds1124.i2bnetworks.com", you have to make sure that external hosts can find out the IP address of "deds1124"

A mailer only can send your list a mail message unless it can find out through DNS query which IP address matches "deds1124.i2bnetworks.com". Up to now that those attempts have been impossible.
I never will be able to call my uncle to wish him happy birthday, if I cannot find his phone number


----------



## tynelson (Dec 15, 2009)

*grin*
J65nko,
I've read hundreds of these posts overtime-and I think your quote makes the top of the list.

Did you come up with that yourself?  Love it!

p.s.  is it simple to tell me or can you point me in the direction on how to make sure external hosts can find out the ip address of deds1124?


----------



## tynelson (Dec 15, 2009)

also, I'm sure it doesn't make a difference, but testmail was just my example in here.  the address that I can receive mail from, but not send to is Sometime-request@deds1124.i2bnetworks.com

I can receive mail from Sometime-request@deds1124.i2bnetworks.com

but I get a DNS error (like you said), when I try and send to it.

The list name is sometime...


----------



## J65nko (Dec 15, 2009)

You have to tell the DNS administrator to add an entry for 'deds1124' in the  zone file of the nameserver for the i2bnetworks.com. This is the simplest way.

A more complicated way  would be to leave out the 'deds1124' and configure your list as [email='Sometime-request@i2bnetworks.com]'Sometime-request@i2bnetworks.com[/email]'. The mailserver receiving mail for your domain, then forwards the mail for the "Sometime" list to the 'deds1124" host.


----------



## DutchDaemon (Dec 15, 2009)

Try Sometime-request@ip-66-181-24-10.cust.i2bnetworks.com. At least *that* is an existing name.


----------



## tynelson (Dec 15, 2009)

lol, Dutch thank you!!!


----------



## tynelson (Dec 15, 2009)

*Hey Dutch*

Since that is an actual e-mail address...I'm assuming it was created by mailman successfully, but-my next question:

How should I go about getting that address to relay correctly back to mailman when sent from it?
ï¿½e


----------



## DutchDaemon (Dec 15, 2009)

Well, Mailman had not much to do with Sometime-request@ip-66-181-24-10.cust.i2bnetworks.com. 

The first part may have been created by Mailman (I'm assuming 'Sometime' is the listname, and '-request' the Mailman 'role'), the second part is simply the name your ISP has given to your IP address: it's its reverse DNS record. As such, mail to this address should actually make it to your server. 

Your server needs to know it needs to accept email sent to @ip-66-181-24-10.cust.i2bnetworks.com, or it will refuse that mail, probably with a 'relaying denied' error. 

The listname itself is, as shown in an earlier post, handled by putting the proper aliases, handed out by Mailman when the list was created, in /etc/mail/aliases. 

The second part is telling Postfix it needs to accept email sent to ip-66-181-24-10.cust.i2bnetworks.com at all. You'll have to figure that one out, because I don't use Postfix myself.

Getting a proper domain name in place is something you'll have to figure out later. First try to get this part working.


----------



## J65nko (Dec 16, 2009)

A simple way to test whether postfix consults your aliases file(s), add something like this to "/etc/mail/aliases"

```
forum:  xxx, yyy@gmail.com
```
Replace "xxx" with the user account you have on the box and change 'yyy' into the name of your gmail account.
After editing run *newaliases* to update the /etc/mail/aliases.db file.

Now from the command line do something like this:
	
	



```
$ echo A test message from xxx | mail -s 'Test' forum
```
Postfix should now mail to your user account "xxx" and to the "yyy@gmail.com" account. Check the mail logs and the "xxx" mailbox and the gmail account for arrival of this mail.

If you can get this to work then you will have completed another step in the right direction


----------



## tynelson (Dec 16, 2009)

Thanks J65 and also Dutch!

I received the email... so that means that my /etc/mail/aliases file is connected to postfix.

That is a real good thing...

Now why can't I seem to get the other aliases in their working.

funny thing is...
the user account i have on the box is root@host.local.domain

I'm thinking this is obviously the problem.

Before I got on another adventure of FreeBSD...any suggestions?

I'm loving you guys right now.

In a bro way


----------



## tynelson (Dec 16, 2009)

*scratch that*

The address on the userbox is
root@deds1124.i2bnetworks.com

I didn't mean to write root@host.local.domain

my bad.


----------



## J65nko (Dec 16, 2009)

Did you also get the mail in your gmail account?


----------



## tynelson (Dec 16, 2009)

*Yes, mail arrived in var/mail/root*

/var/mail/root  has the mail and so does my gmail-i believe that means it passed the test.  Are there any outputs or files I should post to help in anyway?


----------



## J65nko (Dec 16, 2009)

Yes, that means the data in /etc/mail/aliases.db has been consulted and subsequently used by postfix.

Could you post the the mailmain stuff from /etc/mail/aliases aliases?


----------



## tynelson (Dec 16, 2009)

*thanks man*


```
# This file is generated by Mailman, and is kept in sync with the
# binary hash file aliases.db.  YOU SHOULD NOT MANUALLY EDIT THIS FILE
# unless you know what you're doing, and can keep the two files properly
# in sync.  If you screw it up, you're on your own.

# The ultimate loop stopper address
mailman-loop: /usr/local/mailman/data/owner-bounces.mbox
forum:  [snip]
# STANZA START: sometime
# CREATED: Sun Dec 13 07:05:58 2009
sometime:             "|/usr/local/mailman/mail/mailman post sometime"
sometime-admin:       "|/usr/local/mailman/mail/mailman admin sometime"
sometime-bounces:     "|/usr/local/mailman/mail/mailman bounces sometime"
sometime-confirm:     "|/usr/local/mailman/mail/mailman confirm sometime"
sometime-join:        "|/usr/local/mailman/mail/mailman join sometime"
sometime-leave:       "|/usr/local/mailman/mail/mailman leave sometime"
sometime-owner:       "|/usr/local/mailman/mail/mailman owner sometime"
sometime-request:     "|/usr/local/mailman/mail/mailman request sometime"
sometime-subscribe:   "|/usr/local/mailman/mail/mailman subscribe sometime"
sometime-unsubscribe: "|/usr/local/mailman/mail/mailman unsubscribe sometime"
# STANZA END: sometime

# STANZA START: working
# CREATED: Sun Dec 13 07:05:59 2009
working:             "|/usr/local/mailman/mail/mailman post working"
working-admin:       "|/usr/local/mailman/mail/mailman admin working"
working-bounces:     "|/usr/local/mailman/mail/mailman bounces working"
working-confirm:     "|/usr/local/mailman/mail/mailman confirm working"
working-join:        "|/usr/local/mailman/mail/mailman join working"
working-leave:       "|/usr/local/mailman/mail/mailman leave working"
working-owner:       "|/usr/local/mailman/mail/mailman owner working"
working-request:     "|/usr/local/mailman/mail/mailman request working"
working-subscribe:   "|/usr/local/mailman/mail/mailman subscribe working"
working-unsubscribe: "|/usr/local/mailman/mail/mailman unsubscribe working"
# STANZA END: working

# STANZA START: plenty
# CREATED: Sun Dec 13 07:06:00 2009
plenty:             "|/usr/local/mailman/mail/mailman post plenty"
plenty-admin:       "|/usr/local/mailman/mail/mailman admin plenty"
plenty-bounces:     "|/usr/local/mailman/mail/mailman bounces plenty"
plenty-confirm:     "|/usr/local/mailman/mail/mailman confirm plenty"
plenty-join:        "|/usr/local/mailman/mail/mailman join plenty"
plenty-leave:       "|/usr/local/mailman/mail/mailman leave plenty"
plenty-owner:       "|/usr/local/mailman/mail/mailman owner plenty"
plenty-request:     "|/usr/local/mailman/mail/mailman request plenty"
plenty-subscribe:   "|/usr/local/mailman/mail/mailman subscribe plenty"
plenty-unsubscribe: "|/usr/local/mailman/mail/mailman unsubscribe plenty"
# STANZA END: plenty

# STANZA START: tgif
# CREATED: Sun Dec 13 07:06:01 2009
tgif:             "|/usr/local/mailman/mail/mailman post tgif"
tgif-admin:       "|/usr/local/mailman/mail/mailman admin tgif"
tgif-bounces:     "|/usr/local/mailman/mail/mailman bounces tgif"
tgif-confirm:     "|/usr/local/mailman/mail/mailman confirm tgif"
tgif-join:        "|/usr/local/mailman/mail/mailman join tgif"
tgif-leave:       "|/usr/local/mailman/mail/mailman leave tgif"
tgif-owner:       "|/usr/local/mailman/mail/mailman owner tgif"
tgif-request:     "|/usr/local/mailman/mail/mailman request tgif"
tgif-subscribe:   "|/usr/local/mailman/mail/mailman subscribe tgif"
tgif-unsubscribe: "|/usr/local/mailman/mail/mailman unsubscribe tgif"
# STANZA END: tgif

# STANZA START: testformail
# CREATED: Sun Dec 13 07:06:02 2009
testformail:             "|/usr/local/mailman/mail/mailman post testformail"
testformail-admin:       "|/usr/local/mailman/mail/mailman admin testformail"
testformail-bounces:     "|/usr/local/mailman/mail/mailman bounces testformail"
testformail-confirm:     "|/usr/local/mailman/mail/mailman confirm testformail"
testformail-join:        "|/usr/local/mailman/mail/mailman join testformail"
testformail-leave:       "|/usr/local/mailman/mail/mailman leave testformail"
testformail-owner:       "|/usr/local/mailman/mail/mailman owner testformail"
testformail-request:     "|/usr/local/mailman/mail/mailman request testformail"
testformail-subscribe:   "|/usr/local/mailman/mail/mailman subscribe testformail"
testformail-unsubscribe: "|/usr/local/mailman/mail/mailman unsubscribe testformail"
# STANZA END: testformail

# STANZA START: fritest
# CREATED: Sun Dec 13 07:06:03 2009
fritest:             "|/usr/local/mailman/mail/mailman post fritest"
fritest-admin:       "|/usr/local/mailman/mail/mailman admin fritest"
fritest-bounces:     "|/usr/local/mailman/mail/mailman bounces fritest"
fritest-confirm:     "|/usr/local/mailman/mail/mailman confirm fritest"
fritest-join:        "|/usr/local/mailman/mail/mailman join fritest"
fritest-leave:       "|/usr/local/mailman/mail/mailman leave fritest"
fritest-owner:       "|/usr/local/mailman/mail/mailman owner fritest"
fritest-request:     "|/usr/local/mailman/mail/mailman request fritest"
fritest-subscribe:   "|/usr/local/mailman/mail/mailman subscribe fritest"
fritest-unsubscribe: "|/usr/local/mailman/mail/mailman unsubscribe fritest"
# STANZA END: fritest

# STANZA START: 910test
# CREATED: Sun Dec 13 07:06:04 2009
910test:             "|/usr/local/mailman/mail/mailman post 910test"
910test-admin:       "|/usr/local/mailman/mail/mailman admin 910test"
910test-bounces:     "|/usr/local/mailman/mail/mailman bounces 910test"
910test-confirm:     "|/usr/local/mailman/mail/mailman confirm 910test"
910test-join:        "|/usr/local/mailman/mail/mailman join 910test"
910test-leave:       "|/usr/local/mailman/mail/mailman leave 910test"
910test-owner:       "|/usr/local/mailman/mail/mailman owner 910test"
910test-request:     "|/usr/local/mailman/mail/mailman request 910test"
910test-subscribe:   "|/usr/local/mailman/mail/mailman subscribe 910test"
910test-unsubscribe: "|/usr/local/mailman/mail/mailman unsubscribe 910test"
# STANZA END: 910test

# STANZA START: 914test
# CREATED: Sun Dec 13 07:06:06 2009
914test:             "|/usr/local/mailman/mail/mailman post 914test"
914test-admin:       "|/usr/local/mailman/mail/mailman admin 914test"
914test-bounces:     "|/usr/local/mailman/mail/mailman bounces 914test"
914test-confirm:     "|/usr/local/mailman/mail/mailman confirm 914test"
914test-join:        "|/usr/local/mailman/mail/mailman join 914test"
914test-leave:       "|/usr/local/mailman/mail/mailman leave 914test"
914test-owner:       "|/usr/local/mailman/mail/mailman owner 914test"
914test-request:     "|/usr/local/mailman/mail/mailman request 914test"
914test-subscribe:   "|/usr/local/mailman/mail/mailman subscribe 914test"
914test-unsubscribe: "|/usr/local/mailman/mail/mailman unsubscribe 914test"
# STANZA END: 914test

# STANZA START: 917test
# CREATED: Sun Dec 13 07:06:06 2009
917test:             "|/usr/local/mailman/mail/mailman post 917test"
917test-admin:       "|/usr/local/mailman/mail/mailman admin 917test"
917test-bounces:     "|/usr/local/mailman/mail/mailman bounces 917test"
917test-confirm:     "|/usr/local/mailman/mail/mailman confirm 917test"
917test-join:        "|/usr/local/mailman/mail/mailman join 917test"
917test-leave:       "|/usr/local/mailman/mail/mailman leave 917test"
917test-owner:       "|/usr/local/mailman/mail/mailman owner 917test"
917test-request:     "|/usr/local/mailman/mail/mailman request 917test"
917test-subscribe:   "|/usr/local/mailman/mail/mailman subscribe 917test"
917test-unsubscribe: "|/usr/local/mailman/mail/mailman unsubscribe 917test"
# STANZA END: 917test

# STANZA START: mailman
# CREATED: Sun Dec 13 07:06:08 2009
mailman:             "|/usr/local/mailman/mail/mailman post mailman"
mailman-admin:       "|/usr/local/mailman/mail/mailman admin mailman"
mailman-bounces:     "|/usr/local/mailman/mail/mailman bounces mailman"
mailman-confirm:     "|/usr/local/mailman/mail/mailman confirm mailman"
mailman-join:        "|/usr/local/mailman/mail/mailman join mailman"
mailman-leave:       "|/usr/local/mailman/mail/mailman leave mailman"
mailman-owner:       "|/usr/local/mailman/mail/mailman owner mailman"
mailman-request:     "|/usr/local/mailman/mail/mailman request mailman"
mailman-subscribe:   "|/usr/local/mailman/mail/mailman subscribe mailman"
mailman-unsubscribe: "|/usr/local/mailman/mail/mailman unsubscribe mailman"
# STANZA END: mailman
```


----------



## DutchDaemon (Dec 16, 2009)

Use 
	
	



```
tags, dude ...
```


----------



## tynelson (Dec 16, 2009)

*crap dutch*

my bad.

sorry bout that


----------



## J65nko (Dec 16, 2009)

Next step is check you can manually mail a message to the list, by using invoking mailman manually:


```
#!/bin/sh

#cat <<END | sed -e 's/hercules/zeus/'g

cat <<END [color=blue]| /usr/local/mailman/mail/mailman post sometime[/color]
Received: from hercules.utp.xnet (localhost.utp.xnet [127.0.0.1])
        by hercules.utp.xnet (8.14.1/8.14.1) with ESMTP id nBG28hg7028245
        for <forum@hercules.utp.xnet>; Wed, 16 Dec 2009 03:08:43 +0100 (CET)
Received: (from j65nko@localhost)
        by hercules.utp.xnet (8.14.1/8.14.1/Submit) id nBG28hro001272
        for forum; Wed, 16 Dec 2009 03:08:43 +0100 (CET)
Date: Wed, 16 Dec 2009 03:08:43 +0100 (CET)
From: j65nko@hercules.utp.xnet
Message-Id: <200912160208.nBG28hro001272@hercules.utp.xnet>
To: sometime 
Subject: Test

A test message posted to the mailman 'sometime' list
bla, bla

END
```
Download this file and execute it with *sh mailman-test.txt*

The 'cat' command will output everything in the file till the endmarker 'END' to standard output, then it will be piped, the '|' symbol, through the mailman invocation to post a message to the list. 
The "/usr/local/mailman/mail/mailman post" will receive this message on standard input and should process it.

This is equivalent to what postfix would do when it receives a message addressed to 'sometime@_yourhostname_'

After this check whether the message shows up in the 'sometime' mailing list archive.


----------



## tynelson (Dec 16, 2009)

*cat output*

This output surprised me!  It's an obvious problem.  I'm certain I set the group as mailman...and I never set any group as wheel.  You rock for helping me with this.  How should I go about tweaking the mail server...I'm assuming I'd just set it to mailman instead of to wheel.


```
deds1124# sh /usr/home/user1/ty/mailman-test.txt
Group mismatch error.  Mailman expected the mail
wrapper script to be executed as group "mailman", but
the system's mail server executed the mail script as
group "wheel".  Try tweaking the mail server to run the
script as group "mailman", or re-run configure, 
providing the command line option `--with-mail-gid=wheel'.
```


----------



## J65nko (Dec 16, 2009)

Does it help if you use
	
	



```
su mailman -c 'sh mailman-test.txt'
```
That way you will exeucte the script with the UID and hopefully the Group ID of mailman. See the 'su' man page.


----------



## tynelson (Dec 16, 2009)

This was the output of that

```
deds1124# su mailman -c 'sh /usr/home/user1/ty/mailman-test.txt
Unmatched '.
```


----------



## J65nko (Dec 16, 2009)

```
su mailman -c 'sh /usr/home/user1/ty/mailman-test.txt'
-----------------------------------------------------^
```
Your pasted command shows a missing single quote.

The '-c' option is for the shell and because the command passed consists of multiple words, the command needs a quote at the start and at the end 

BTW what are the permissions of the mailman binary in 'usr/local/mailman/mail/mailman' ?


----------



## J65nko (Dec 16, 2009)

Referring to http://www.postfix.org/DEBUG_README.html#trace_mail
What is the output of
	
	



```
# /usr/sbin/sendmail -bv sometime
```
?


----------



## tynelson (Dec 16, 2009)

*Here it is!  *


```
deds1124# su mailman -c 'sh /usr/home/user1/ty/mailman-test.txt'
This account is currently not available.


deds1124# /usr/sbin/sendmail -bv sometime
Mail Delivery Status Report will be mailed to <root>.
```


I hope this helps..

I owe you a drink or twenty for this!


----------



## DutchDaemon (Dec 16, 2009)

hth (setgid)


```
-rwxr-sr-x  1 root  mailman  15854 Nov 19 18:22 /usr/local/mailman/mail/mailman
```


----------



## tynelson (Dec 16, 2009)

*dutch*

I should put all of that in the command line?


----------



## J65nko (Dec 16, 2009)

tynelson said:
			
		

> ```
> deds1124# su mailman -c 'sh /usr/home/user1/ty/mailman-test.txt'
> This account is currently not available.
> ```


The mailman-test.txt script attempts to do a direct delivery to "| /usr/local/mailman/mail/mailman post sometime" and it seems to fail. Do you see anything about this in either the mailman or postfix logs.



> ```
> deds1124# /usr/sbin/sendmail -bv sometime
> Mail Delivery Status Report will be mailed to <root>.
> ```


Could you post this Mail Delivery Status Report?
See http://www.postfix.org/ADDRESS_REWRITING_README.html#debugging

Another request: What is the contents of /etc/mail/mailer.conf See mailer.conf(5).


----------



## J65nko (Dec 17, 2009)

tynelson said:
			
		

> I should put all of that in the command line?



He asks whether the owner and group of '/usr/local/mailman/mail/mailman' are 'root' and '*mailman*' like he posted.And not 'root' and '*wheel*' like the error message seems to indicate 

The following will tell you if there is a 'mailman' group, and which members it has:
	
	



```
# grep mailman /etc/group
```


----------



## tynelson (Dec 17, 2009)

*thanks again*

That's the mailer.conf info

```
#
# Execute the Postfix sendmail program, named /usr/local/sbin/sendmail
#
sendmail	/usr/local/sbin/sendmail
send-mail	/usr/local/sbin/sendmail
mailq	/usr/local/sbin/sendmail
newaliases	/usr/local/sbin/sendmail
```

The search for mailman user output was 

```
deds1124# grep mailman /etc/group
mailman:*:91:
```


----------



## J65nko (Dec 17, 2009)

The mailer.conf shows that Postfix has been installed.
Have you checked in "/var/mail/root" for the */usr/sbin/sendmail -bv sometime* message?

We still have to see the result of *ls -l /usr/local/mailman/mail/mailman*


----------



## tynelson (Dec 17, 2009)

*Here's the prize!*

This should be it 


```
From MAILER-DAEMON  Thu Dec 17 09:31:39 2009
Return-Path: <>
X-Original-To: root@deds1124.i2bnetworks.com
Delivered-To: root@deds1124.i2bnetworks.com
Received: by deds1124.i2bnetworks.com (Postfix)
	id 7784C39F1A; Thu, 17 Dec 2009 09:31:39 -0800 (PST)
Date: Thu, 17 Dec 2009 09:31:39 -0800 (PST)
From: MAILER-DAEMON@deds1124.i2bnetworks.com (Mail Delivery System)
Subject: Mail Delivery Status Report
To: root@deds1124.i2bnetworks.com
Auto-Submitted: auto-replied
MIME-Version: 1.0
Content-Type: multipart/report; report-type=delivery-status;
	boundary="7654839F12.1261071099/deds1124.i2bnetworks.com"
Message-Id: <20091217173139.7784C39F1A@deds1124.i2bnetworks.com>

This is a MIME-encapsulated message.

--7654839F12.1261071099/deds1124.i2bnetworks.com
Content-Description: Notification
Content-Type: text/plain; charset=us-ascii

This is the mail system at host deds1124.i2bnetworks.com.

Enclosed is the mail delivery report that you requested.

                   The mail system

<sometime@deds1124.i2bnetworks.com> (expanded from <sometime>): delivery via
    local: delivers to command: /usr/local/mailman/mail/mailman post sometime

--7654839F12.1261071099/deds1124.i2bnetworks.com
Content-Description: Delivery report
Content-Type: message/delivery-status

Reporting-MTA: dns; deds1124.i2bnetworks.com
X-Postfix-Queue-ID: 7654839F12
X-Postfix-Sender: rfc822; root@deds1124.i2bnetworks.com
Arrival-Date: Thu, 17 Dec 2009 09:31:39 -0800 (PST)

Final-Recipient: rfc822; sometime@deds1124.i2bnetworks.com
Original-Recipient: rfc822; sometime
Action: deliverable
Status: 2.0.0
Diagnostic-Code: X-Postfix; delivery via local: delivers to command:
    /usr/local/mailman/mail/mailman post sometime

--7654839F12.1261071099/deds1124.i2bnetworks.com
Content-Description: Message Headers
Content-Type: text/rfc822-headers

Received: by deds1124.i2bnetworks.com (Postfix, from userid 0)
	id 7654839F12; Thu, 17 Dec 2009 09:31:39 -0800 (PST)
From: root@deds1124.i2bnetworks.com
Subject: probe
To: sometime@deds1124.i2bnetworks.com
Message-Id: <20091217173139.7654839F12@deds1124.i2bnetworks.com>
Date: Thu, 17 Dec 2009 09:31:39 -0800 (PST)

--7654839F12.1261071099/deds1124.i2bnetworks.com--
```


----------



## J65nko (Dec 17, 2009)

In that message postfix confirms that when "sometime" is the recipient of mail, the mail will be delivered to that mailman command. So that looks good 



> We still have to see the result of *ls -l /usr/local/mailman/mail/mailman*


----------



## tynelson (Dec 17, 2009)

*great!*

So that means the error is when the mail actually gets to the sometime list?


----------



## J65nko (Dec 17, 2009)

Yes, that could be.

3rd request: Please post the output of 
	
	



```
ls -l /usr/local/mailman/mail/mailman
```

BTW A *echo Hello 'tynelson' from j65nko. Sending seems to work now | mail -s 'test' sometime@[66.181.24.10]* has been accepted by 66.181.24.10.

My maillog:
	
	



```
Dec 17 03:03:12 hercules sm-mta[27141]: nBH23AZe010242: to=<sometime@[66.181.24.10]>, ctladdr=<j65nko@her
cules.utp.xnet> (1000/1000), delay=00:00:02, xdelay=00:00:02, mailer=esmtp, pri=30397, relay=[66.181.24.1
0] [66.181.24.10], dsn=2.0.0, stat=Sent (Ok: queued as CA7D639875)
```


----------



## tynelson (Dec 17, 2009)

*Whoo-Hoo!*


```
deds1124# ls -l /usr/local/mailman/mail/mailman
-rwxr-sr-x  1 root  mailman  15775 Dec 16 04:40 /usr/local/mailman/mail/mailman
```


----------



## J65nko (Dec 17, 2009)

Can you find the mail I managed to send? See http://forums.freebsd.org/showpost.php?p=56303&postcount=51

I am trying to check the mailman docs at http://www.gnu.org/software/mailman/mailman-install/ but that site is very slow. 

I have to go to bed now, in about 8 hours I have to work. Believe it or not, I am a part-time mailman for TNT here in Holland


----------



## tynelson (Dec 17, 2009)

you rest well!  You've been god sent for me..I hope your work day goes GREAT and I'll get on that for ya.

Best,
-Ty


----------



## tynelson (Dec 17, 2009)

*it came*


```
Dec 17 10:09:20 deds1124 postfix/smtp[71223]: B343539F18: to=<j65nko@hercules.xxx>, 

relay=none, delay=0.01, delays=0/0/0.01/0, dsn=5.4.4, status=bounced (Host or domain name not found. Name 

service error for name=hercules.utp.xnet type=A: Host not found)
Dec 17 10:09:20 deds1124 postfix/qmgr[70721]: B343539F18: removed
Dec 17 10:12:40 deds1124 postfix/anvil[71209]: statistics: max connection rate 1/60s for (smtp:83.163.147.98) at Dec 17 10:06:22
Dec 17 10:12:40 deds1124 postfix/anvil[71209]: statistics: max connection count 1 for (smtp:83.163.147.98) at Dec 17 10:06:22
Dec 17 10:12:40 deds1124 postfix/anvil[71209]: statistics: max cache size 1 at Dec 17 10:06:22
Dec 17 10:22:03 deds1124 postfix/smtpd[71274]: connect from ey-out-2122.google.com[74.125.78.26]
Dec 17 10:22:03 deds1124 postfix/smtpd[71274]: NOQUEUE: reject: RCPT from ey-out-

2122.google.com[74.125.78.26]: 554 5.7.1 <sometime@ip-66-181-24-10.cust.i2bnetworks.com>: Relay access 

denied; from=<[U][B]j65nko@xxx[/B][/U]> to=<sometime@ip-66-181-24-10.cust.i2bnetworks.com> 

proto=ESMTP helo=<ey-out-2122.xxx>
Dec 17 10:22:03 deds1124 postfix/smtpd[71274]: disconnect from ey-out-2122.google.com[74.125.78.26]
Dec 17 10:25:24 deds1124 postfix/anvil[71276]: statistics: max connection rate 1/60s for (smtp:74.125.78.26) at Dec 17 10:22:03
Dec 17 10:25:24 deds1124 postfix/anvil[71276]: statistics: max connection count 1 for (smtp:74.125.78.26) at Dec 

17 10:22:03
Dec 17 10:25:24 deds1124 postfix/anvil[71276]: statistics: max cache size 1 at Dec 17 10:22:03
```


----------



## J65nko (Dec 18, 2009)

The first one is a mail I sent from my box "hercules.utp.xnet". This was an attempt to post something to the 'sometime' list 
I wonder why your postfix server or mailman wants to reach me on this local address which of course doesn't resolve on the public Internet.

The second mail in the log I sent by Gmail to your list. I got a bounce:





> Google tried to deliver your message, but it was rejected by the recipient domain. We recommend contacting the other email provider for further information about the cause of this error. The error that the other server returned was: 554 554 5.7.1 <sometime@ip-66-181-24-10.cust.i2bnetworks.com>: Relay access denied (state 14).


This has something to do with the configuration of the postfix server. 

Unfortunately my postfix skills are rusty. I remember I had it running on a FreeBSD 3.x firewall with an ISDN card. But afterwards I only played with qmail.

I tried to install FreeBSD 8.0 on another box in an effort to mimick your postfix/mailman setup. Sadly the P4 box refused to boot from the USB stick image. Will retry tomorrow from CD

In the mean time you could go through the mailman doc and the postfix docs and try to find out what is missing.

And please have the DNS administrator, you ?, add an A record in DNS for deds1124.
That would make things less complicated.


----------



## tynelson (Dec 18, 2009)

Alright man!  And thanks.  I hope your workday went well 

I'm gonna start digging!


----------



## tynelson (Dec 18, 2009)

*Side Note*

How should I go about setting the mail gid as "mailman" instead of "wheel" like it is now.  This is obviously a problem.  The wrapper isn't even being used right.

I know that the mailman id is 91, apache runs as group www...but mailman is set with a gid = "wheel"

I read the documents on reconfiguring but they don't seem to work as root commands.


----------



## J65nko (Dec 18, 2009)

You can change the group with the *chgrp(1)*command.


----------



## J65nko (Dec 25, 2009)

*A follow-up*

After I installed mailman on a spare 7.2 system by myself, it became clear that there is an error in the ports Makefile when postfix is chosen as MTA for mailman.

For the error description and a fix or a workaround see http://www.freebsd.org/cgi/query-pr.cgi?pr=142000

BTW The instructions for configuring mailman are not complete. Because it has been a rather frustating experience, I intend to post a simple guide how to do it properly.

If you cannot wait and need this urgently, you can ask here for guidance through the rough spots


----------

