Re: Redirect queue to another smtp

2022-08-14 Thread Marcus MERIGHI
Hello Mik, 

mikyde...@yahoo.fr (Mik J), 2022.08.14 (Sun) 05:14 (CEST):
> I have received some mails on my "SMTP2" which is misconfigured and
> mails are stuck in the queue. They look like
> that25eed6a533daaed1|inet4|mda||cxxx@gmail.com|m...@e.xxx|m...@e.xxx|1660443800|1660443800|0|17|pending|181|"mail.maildir:
> No such file or directory"
> Is there a way to resend them to "SMTP1" ?
> I have tried to add rules such asaction TO-SMTP1 relay host smtp://10.1.2.2:25
> match mail-from " cxxx@gmail.com" for any action TO-SMTP1
> Or evenaction TO-SMTP1 relay host smtp://10.1.2.2:25match from any for
> any action TO-SMTP1

$ doas find /var/spool/smtpd/ -type f
/var/spool/smtpd/queue/6e/6e800d91/6e800d911b1d350c
/var/spool/smtpd/queue/6e/6e800d91/message

"message" is, hum, the message. "6e800d911b1d350c" is the control data
of OpenSMTPd: 

$ doas cat /var/spool/smtpd/queue/6e/6e800d91/6e800d911b1d350c
version: 3
dispatcher: outbound # <= the "action" that was applied
type: mta
smtpname: fifi.foo.bar
helo: localhost
hostname: fifi.foo.bar
sockaddr: local
sender: a...@def.gh
rcpt: i...@lmn.op
dest: i...@lmn.op
ctime: 1660479966
last-try: 0
last-bounce: 0
ttl: 0
retry: 0
flags: authenticated
dsn-notify: 0

With this information, look for the smtpd.conf(5) "action" named "outbound"
and change it to do what you want it to do. Restart smtpd(8) afterwards,
delivery according to your new "action" will start shortly.

Marcus



Re: Redirect queue to another smtp

2022-08-14 Thread Maksim Rodin
After you reconfigured your smtpd daemon may be you should have run
this:

smtpctl schedule envelope-id | message-id | all
(Mark as ready for immediate delivery a single envelope, envelopes
with the given message ID, or all envelopes.)


On Sun Aug 14 03:14:17 2022, Mik J wrote:
> Hello,
> I have received some mails on my "SMTP2" which is misconfigured and mails are 
> stuck in the queue. They look like 
> that25eed6a533daaed1|inet4|mda||cxxx@gmail.com|m...@e.xxx|m...@e.xxx|1660443800|1660443800|0|17|pending|181|"mail.maildir:
>  No such file or directory"
> Is there a way to resend them to "SMTP1" ?
> I have tried to add rules such asaction TO-SMTP1 relay host smtp://10.1.2.2:25
> match mail-from " cxxx@gmail.com" for any action TO-SMTP1
> Or evenaction TO-SMTP1 relay host smtp://10.1.2.2:25match from any for any 
> action TO-SMTP1
> 
> I didn't have any success.
> 
> What can we do when mails are stuck in the queue ?
> 

-- 
Maksim Rodin