# Configure postfix as ETRN client



## kjpetrie (Oct 20, 2021)

Does anyone know how to configure mail/postfix to send ETRN to another MTA on start up?

There's a lot of information and even a HowTo on configuring postfix's ETRN response as a server, but none I can find on setting it to send the requests as a client.

I have started running postfix on my desktop to receive mail from my server, but the desktop is normally switched off when not in use, so delivery delays can become quite long, and it would be good to have the mail delivered soon after I boot the machine rather than having to wait up to an hour for it.


----------



## Jose (Oct 20, 2021)

Cross-post. Try Fetchmail:





						Fetchmail
					

The Fetchmail Project



					www.fetchmail.info


----------



## kjpetrie (Oct 20, 2021)

This is not a cross post. I simply mentioned the problem in a reply to another (Solved) thread after posting this.

Yes, I suppose Fetchmail could be used to send an ETRN, but it seems a bit of a sledgehammer to crack a nut. Are you saying Postfix can't do this?


----------



## Jose (Oct 20, 2021)

I meant *my* post was a cross-post.
I don't know if Postfix can do this or not. Fetchmail is what I used when I had an intermittent Internet connection.


----------



## kjpetrie (Oct 20, 2021)

Oh, sorry for the confusion. It would seem odd if a full-featured MTA can't send a simple request to another MTA to flush its queue, so I'm still hoping someone can point me in the direction of a simple configuration statement.


----------



## covacat (Oct 20, 2021)

nc isp.com 25
ehlo myhomebox.com
etrn mydomain.com
quit

this used to work a million years ago with my isp


----------



## kjpetrie (Oct 20, 2021)

It seems strange this functionality isn't built into postfix, that it knows how to handle incoming requests but can't seem to send them. I was hoping not to have to start a separate program to do it, but there we are.

*Update: *to run this as a script it needs to become something like:


```
nc -c 'echo "ehlo myhomebox.com";sleep 1;echo "etrn mydomain.com";sleep 1;echo "quit"' isp.com 25
```

The sleeps give the other end time to respond before sending the next command.


----------



## kjpetrie (Oct 21, 2021)

Unfortunately, this doesn't produce the intended result. I get the following in /var/log/maillog:

```
Oct 21 10:05:46 mailin postfix/smtpd[33659]: connect from master.localdomain[192.168.1.64]
Oct 21 10:06:03 mailin postfix/smtpd[33659]: disconnect from master.localdomain[192.168.1.64] etrn=1 quit=1 commands=2
```
 but the queue isn't flushed.


----------



## Jose (Oct 21, 2021)

kjpetrie said:


> Unfortunately, this doesn't produce the intended result. I get the following in /var/log/maillog:
> 
> ```
> Oct 21 10:05:46 mailin postfix/smtpd[33659]: connect from master.localdomain[192.168.1.64]
> ...


Looks like you're connecting to your local Postfix? I.e., the one you just booted up. It's queue is going to be empty if it just came up.


----------

