# Postfix help

## tmcca

I have no idea why it's not working, I have it working to get mail from local users but wont send email out.

so my mailserver is mail.domain.com and have it listening to port 2525

my main.cf have it like this

```

myhostname = mail.domain.com

mydomain = domain.com

myorigin = $mydomain

inet_interfaces = all

mydestination = $myhostname, localhost.$mydomain, localhost, $mydomain,  www.$mydomain, ftp.$mydomain, pbx.$mydomain 

```

So when I try to send an email with 

```
echo "Test mail from postfix" | mail -s "Test Postfix" myemail@aol.com
```

get a connection time out error.. what am I missing here?

----------

## Ant P.

SMTP uses port 25, not 2525.

----------

## tmcca

I know that but I think my ISP blocks port 25.

----------

## Ant P.

In that case you'll need to use SSL, which goes over a different port.

----------

## tmcca

I used traceroute command and this is what I got

```
traceroute -n -T -p 25 gmail-smtp-in.l.google.com

traceroute to gmail-smtp-in.l.google.com (172.217.197.27), 30 hops max, 60 byte packets

 1  192.168.1.1  0.421 ms  0.508 ms  1.806 ms

 2  * * *

 3  * * *

 4  * * *

 5  * * *

 6  * * *

 7  * * *

 8  * * *

 9  * * *

10  * * *

11  * * *

12  * * *

13  * * *

14  * * *

15  * * *

16  * * *

17  * * *

18  * * *

19  * * *

20  * * *

21  * * *

22  * * *

23  * * *

24  * * *

25  * * *

26  * * *

27  * * *

28  * * *

29  * * *

30  * * *

```

So I am being blocked?

----------

## tmcca

so when I changed the port to 2525

```
traceroute -n -T -p 2525 gmail-smtp-in.l.google.com

traceroute to gmail-smtp-in.l.google.com (173.194.207.27), 30 hops max, 60 byte packets

 1  192.168.1.1  0.360 ms  0.494 ms  0.633 ms

 2  * * *

 3  100.41.223.124  10.594 ms 100.41.223.122  8.373 ms  8.431 ms

 4  * * *

 5  140.222.234.65  7.585 ms 140.222.2.231  9.095 ms 140.222.233.33  8.422 ms

 6  209.85.149.32  10.552 ms  18.058 ms  20.077 ms

 7  * * *

 8  * * *

 9  * * *

10  * * *

11  * * *

12  * * *

13  * * *

14  * * *

15  * * *

16  * * *

17  * * *

18  * * *

19  * * *

20  * * *

21  * * *

22  * * *

23  * * *

24  * * *

25  * * *

26  * * *

27  * * *

28  * * *

29  * * *

30  * * *

```

So I am guessing the port 2525 is working?

----------

## AlexJGreen

_Last edited by AlexJGreen on Mon Dec 28, 2020 3:23 am; edited 1 time in total

----------

## Jaglover

 *tmcca wrote:*   

> I know that but I think my ISP blocks port 25.

 

ISP-s often block incoming traffic on port 25, sometimes they restrict also outgoing traffic to port 25, but they cannot block it as it would mean you cannot send email at all. You may need to use your ISP-s mail server as a relay in this case. Google may reject your mail if you do not have reverse MX record, too, when you try to send mail directly.

----------

## tmcca

Ok it is sending mail but how do I set it up to send mail from my domain instead of gmail account?

Do I make an alias?

----------

## Ant P.

To send from your domain you just send mail with the correct From: address and tell the client to send it to your own server. Make sure to go in the domain registrar's DNS and set up a correct A record and SPF at a bare minimum, or most servers will reject it.

----------

## tmcca

I think that maybe issue that I don't have the DNS correct.

I am using namecheap advanced DNS

I have the following in my DNS

TYPE                                            Host                         Value

A                                                   @                             my ip address

A                                                   mail                          my ip address

A                                                   www                        my ip address

MX Record                                   @                             mail.giftboundgifts.com Priority 10 TTL Auto

When I telnet to mail.giftboundgifts.com 25 I get a connection but no response when I enter EHLO.. I tried also port 587 same thing.

I am lost

----------

## Jaglover

You started this thread asking help for sending email. Now you are talking about receiving. Make up your mind, these are different processes.

----------

## tmcca

I am asking help with both sorry. It seems this is the hardest configuration.

----------

## Jaglover

For receiving use a site like https://canyouseeme.org/ to make sure the port is open for world. Assuming your server is configured properly and is listening.

For sending use your ISP mail server as a relay. I think Google as relay does not work well, I hear they overwrite the header, haven't tried myself.

----------

