Menu

#45 resubmit mails with bad extension

v1.0 (example)
closed
resubmit (1)
5
2021-02-13
2020-02-26
Tom
No

Hi Graeme

proxy server with emailrelay 2.1a:
/usr/local/emailrelay/sbin/emailrelay --as-server --syslog --pid-file /var/run/emailrelay/emailrelay.pid /usr/local/emailrelay/etc/emailrelay.conf

  1. How do i resend mails with .bad extension?
    no messages in maillog when i run the below command.
    /usr/local/emailrelay/sbin/emailrelay-submit --spool-dir=/usr/local/emailrelay/var/spool/emailrelay <smtp_server_name></smtp_server_name>

  2. not able to send emails from localhost eventhough postfix is configure to use localhost on port 587

Please let me know if you need any further details

Cheers.

Discussion

  • Graeme Walker

    Graeme Walker - 2020-02-26

    In general you should remove the ".bad" extension and they will be picked up on
    the next forwarding pass. If you are using "--forward-on-disconnect" or "--as-proxy" then you can easily trigger forwarding by connecting to the smtp port and immediately disconnecting, perhaps using netcat, something like "nc -d -q 1 127.0.0.1 25". Or just add "--poll 1" to the command-line, at least until you sort out the problem.

    The submit utility just stuffs a message into the spool directory, so there is no forwarding on the back of that. The submit command-line parameter is the email envelope "To:" address, not the smtp server, so I think you are probably running "emailrelay-submit" when you should be running "emailrelay --as-client".

    I can't interpret your second point. Are you running emailrelay and postfix on the same box? As always, command-lines, config files and "--verbose" log snippets would help.

     
  • Tom

    Tom - 2020-03-02

    Graeme thanks for the response

    1. still spool dir not clearing up after trying with the sugegstions you provided.

      emailrelay.conf:

      as-proxy smtprelay.test.com:25
      log
      remote-clients
      spool-dir /usr/local/emailrelay/var/spool/emailrelay
      verbose

    daemon:

    daemon 13182 1 0 Feb21 ? 00:00:03 /usr/local/emailrelay/sbin/emailrelay --as-server --syslog --pid-file /var/run/emailrelay/emailrelay.pid /usr/local/emailrelay/etc/emailrelay.conf

    maillog:

    Mar 2 13:20:29 emailproxy emailrelay[13182]: emailrelay: info: smtp connection from 127.0.0.1:38226
    Mar 2 13:20:29 emailproxy emailrelay[13182]: emailrelay: info: tx>>: "220 emailproxy.if.icap.com -- E-MailRelay V2.1a -- Service ready"
    Mar 2 13:20:38 emailproxy emailrelay[13182]: emailrelay: info: smtp connection closed: peer disconnected: 127.0.0.1:38226
    Mar 2 13:20:38 emailproxy emailrelay[13182]: emailrelay: info: forwarding: [client disconnect]
    Mar 2 13:20:38 emailproxy emailrelay[13182]: emailrelay: info: forwarding: no messages to send

    1. i am trying to send a test email to my self from proxy-server it self using postfix agent configured to use local server on port 25 as mailrelay server.
      it works from all other servers in the network using this proxy-server as relay host.
     
  • Graeme Walker

    Graeme Walker - 2020-03-03

    The 'no messages to send' log line indicates there are no files in the spool directory that end in ".envelope". Is that right? What happens if you use emailrelay-submit to create a message in the spool directory? Or even try creating a pair of empty files manually, "emailrelay.1.envelope" and "emailrelay.1.content". Also double-check the spelling of the spool directory; maybe as a result of your testing you have ended up with two directories with similar names.

     
  • Tom

    Tom - 2020-03-04

    only *.content files are there in spool folder, no envelope files after deleting all files with .bad extension.
    spool folder name is correct as i do see files with .busy extension when forwarding other mails in progress.

     
  • Graeme Walker

    Graeme Walker - 2020-03-04

    Ah, so don't delete the .bad envelope files, just rename them by removing the .bad filename extension.

    $ cd ...spool...
    $ for f in *.bad ; do mv $f `basename $f .bad` ; done
    

    There is a very simple example script (emailrelay-resubmit.sh) that does that for you, or you can use the --admin interface with the unfail-all command.

    You can look inside the .bad envelope files to see the error message.

     
  • Graeme Walker

    Graeme Walker - 2021-02-13
    • status: open --> closed
     

Log in to post a comment.