# mail sent but not received.

## zgredek

What the possible reasons of mail not beeing delivered are? i can send emails from my server to another but it doesn't work the other way round.

I'm using postfix and squirrellmail.thx for help

----------

## RayDude

 *zgredek wrote:*   

> What the possible reasons of mail not beeing delivered are? i can send emails from my server to another but it doesn't work the other way round.
> 
> I'm using postfix and squirrellmail.thx for help

 

There are an infinite number of possible reasons why you can't send email... It'd be silly to try and list them. If I were psychic, I'd peer into your computer's configuration files and tell you what's wrong, but seeing as how my third eye isn't that developed, how about posting them?

*evil grin*

Start with /etc/postfix/main.cf, and we'll go from there. I have this working on my domain, I can't claim to understand it all though, its very complicated. I'll do my best to help.

Raydude

----------

## zgredek

Ups!configs...here you are:

```
readme_directory = /usr/share/doc/postfix-2.1.5/README_FILES

sample_directory = /usr/share/doc/postfix-2.1.5/samples

html_directory = /usr/share/doc/postfix-2.1.5/html

sendmail_path = /usr/sbin/sendmail.postfix

setgid_group = postdrop

command_directory = /usr/sbin

manpage_directory = /usr/share/man

daemon_directory = /usr/lib/postfix

newaliases_path = /usr/bin/newaliases.postfix

mailq_path = /usr/bin/mailq.postfix

queue_directory = /var/spool/postfix

mail_owner = postfix

# User configurable parameters

inet_interfaces = all

#inet_interfaces = localhost

mynetworks_style = host

delay_warning_time = 4h

smtpd_banner = $myhostname ESMTP $mail_name ($mail_version) (Mandrakelinux) #ups again;p i just wanted it to start with...

unknown_local_recipient_reject_code = 450

smtp-filter_destination_concurrency_limit = 2

lmtp-filter_destination_concurrency_limit = 2

smtpd_sasl_path = /etc/postfix/sasl:/usr/lib/sasl2

recipient_delimiter = +

owner_request_special = no

alias_maps = hash:/etc/postfix/aliases, hash:/var/lib/mailman/data/aliases

alowanonymouslogin = no

allowplaintext = yes

sasl_mech_list = PLAIN

sasl_pwcheck_method = saslauthd

#Sorry, but don't want everybody to know the adress...

myhosname = $VALID_HOSTNAME

mydestination = $myhostname

mailbox_transport = courier
```

sasl? Not using it i think.it was supposed to be a plain webmail configuration.

thx for your wish to help!

----------

## RayDude

 *zgredek wrote:*   

> Ups!configs...here you are:
> 
> ```
> readme_directory = /usr/share/doc/postfix-2.1.5/README_FILES
> 
> ...

 

I suspect if I were really a guru I'd see a problem with your main.cf file. But I don't see a problem, so lets debug this...

```
rm /var/log/messages

touch /var/log/messages

reboot
```

After the system reboots, try to send an email with squirrelmail. You probably don't need to remove the log, I just find it easier when there aren't a bunch of boots in it. You could just do the following:

```
tail -n 40 /var/log/messages
```

You should see messages from postfix about what its doing and what problems its facing.

If they don't clue you in on whats wrong and googling the messages yields no fixes, then post the errors here and maybe me or someone else will have ideas.

Raydude

----------

## zgredek

```
Jun 17 12:22:05 poczta postfix/local[12371]: fatal: connect #11 to subsystem private/courier: No such file or directory
```

That's part of foo/mail/errors file.

And /var/log/messages:

```
Jun 17 12:15:51 poczta postfix:  succeeded

Jun 17 12:15:51 poczta postfix:  succeeded

Jun 17 12:20:01 poczta CROND[12365]: (mail) CMD (/usr/bin/python -S /usr/lib/mailman/cron/gate_news)
```

Succeesed? Strange...

 *Quote:*   

> After the system reboots, try to send an email with squirrelmail.

 

Maybe you misunderstood me. Sending mail works fine - i just cannot receive mail from an outside server. 

I noticed that once I succeeded in sending a mail from root@localhost to $username@localhost, the message is in: /var/spool/mail/$username.

will search this: connect #11 to subsystem private/courier: but if someone knows what to do with it please help.

----------

## RayDude

 *zgredek wrote:*   

> 
> 
> ```
> Jun 17 12:22:05 poczta postfix/local[12371]: fatal: connect #11 to subsystem private/courier: No such file or directory
> ```
> ...

 

Have you installed Courier?

```
 emerge search courier-imap

*  net-mail/courier-imap

      Latest version available: 4.0.1

      Latest version installed: 4.0.1

      Size of downloaded files: 2,961 kB

      Homepage:    http://www.courier-mta.org/

      Description: An IMAP daemon designed specifically for maildirs

      License:     GPL-2
```

You may want to check out these threads for help with setting up postfix, courier, etc.

HowTO: Postfix - MailScanner - DBMail - SASL - TLS

Email System For The Home Network - Version 2.1

The second post mentions use flags, they are pretty important. For security, SSL is highly reccommended.

Please feel free to ask more questions.

Raydude

----------

## zgredek

Courier IMAP is installed. Going to read those threads - already skimmed the second..

SSL is temporary left disabled - want to solve this issue first...

----------

## RayDude

I looked in my /etc/postfix/main.cf and I don't specify 'mailbox_transport'

You may want to add this, I found it in my main.cf:

```
smtpd_recipient_restrictions = permit_sasl_authenticated, permit_mynetworks, reject_unauth_destination
```

Without a restriction line -- I'm not sure what the default is -- it may be to reject all mail.

You'd have to get sasl running of course for this to work, here's a bigger snippet of my main.cf:

```
smtpd_sasl_auth_enable = yes

smtpd_sasl_security_options = noanonymous

smtpd_sasl_local_domain = $myhostname

broken_sasl_auth_clients = yes

smtpd_recipient_restrictions = permit_sasl_authenticated, permit_mynetworks, reject_unauth_destination

smtp_sasl_password_maps = hash:/etc/postfix/saslpass

smtpd_use_tls=yes

smtpd_tls_auth_only = yes

smtpd_tls_key_file = /etc/ssl/certs/newreq.pem

smtpd_tls_cert_file = /etc/ssl/certs/newcert.pem

smtpd_tls_CAfile = /etc/ssl/certs/cacert.pem

smtpd_tls_loglevel = 3

smtpd_tls_received_header = yes

smtpd_tls_session_cache_timeout = 3600s

tls_random_source = dev:/dev/urandom
```

And you have to generate certificates for ssl which is described in one of the links I gave you.

Raydude

----------

## zgredek

 *RayDude wrote:*   

> I looked in my /etc/postfix/main.cf and I don't specify 'mailbox_transport'
> 
> You may want to add this, I found it in my main.cf:
> 
> ```
> ...

 

ok-thanx. but what if i dont want ssl yet?

----------

## DaveArb

 *zgredek wrote:*   

> Ups!configs...here you are:
> 
> ```
> ...
> 
> ...

 

I don't speak Postfix, but is the item quoted above misspelled in your config file also? I would guess that it is supposed to have a "t" in it, myhostname.

Pardon me for starting at the basics, but have you confirmed your machine is even reachable on port 25 from the outside? Telnetting toward your box's IP on the SMTP port might tell you something. I like confirming this basic connectivity before assuming an MTA config is incorrect.

Dave

----------

## RayDude

 *zgredek wrote:*   

>  *RayDude wrote:*   I looked in my /etc/postfix/main.cf and I don't specify 'mailbox_transport'
> 
> You may want to add this, I found it in my main.cf:
> 
> ```
> ...

 

Check the spelling of myhostname as indicated by DaveArb, then add the one line suggested at the top of my post to enable you to receive email.

Then as DaveArb suggests, determine if your port 25 is open on your firewall to make sure email can come in...

Maybe you should post your topography. How are all these machines connected together? How are they connected to the internet?

Raydude

----------

## zgredek

 *DaveArb wrote:*   

>  *zgredek wrote:*   Ups!configs...here you are:
> 
> ```
> ...
> 
> ...

 

agrrrrrr!!!!!!!  :Embarassed: 

hate typos!  :Twisted Evil:   am not yet able to check if everything is working now but will do so and tell you.

thx a lot!

postfix shouldve some syntax checking to avoid such mistakes what do you think?

----------

## zgredek

when i telnet to localhost through port 25 i get:

```
ehlo localhost

[...]

250-PIPELINING

250-SIZE 10240000

250-VRFY

250-ETRN

250-AUTH GSSAPI PLAIN

250-AUTH=GSSAPI PLAIN

250 8BITMIME

```

is that ok?

All te guides say i need more in the last lines;

```
250-PIPELINING

250-SIZE 10240000

250-ETRN

250-AUTH PLAIN LOGIN 

250-AUTH=PLAIN LOGIN

250-XVERP

250 8BITMIME
```

or:

```
250 - AUTH LOGIN PLAIN DIGEST-MD5 CRAM-MD5

250 - AUTH LOGIN PLAIN DIGEST-MD5 CRAM-MD5
```

but i cant get md5 to work. IS that ok or not?

thx for help!

----------

