resubmit mails with bad extension
SMTP email proxy and relay server
Brought to you by:
graeme_walker
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
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>
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.
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.
Graeme thanks for the response
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
it works from all other servers in the network using this proxy-server as relay host.
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.
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.
Ah, so don't delete the .bad envelope files, just rename them by removing the .bad filename extension.
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.